Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange bug while using a cheap nano 3.0 clone #29

Open
MRjimbob81 opened this issue Dec 13, 2022 · 0 comments
Open

Strange bug while using a cheap nano 3.0 clone #29

MRjimbob81 opened this issue Dec 13, 2022 · 0 comments

Comments

@MRjimbob81
Copy link

Having just built my first uno2iec with a nano clone I found a glitch in the logging code that will cause some cheap Chinese nano clones to constantly hardware reset after sending the 'connect_arduino:2' message.

With five Nano's to test from (4 being the same type) - 4 had the ch341 USB chip and 1 had a genuine FTDI USB chip. The 4 with the ch341 all presented the same reset problem while the 5th FTDI version had no issues. I don't believe the USB chip is the problem but I've written the chip type here as an easy way to identify the clone Nano's. I also disabled the auto-reset on power up from the ch341 USB chip in case that was the culprit.

Diving deeper and debugging the code to find out where the Nano was resetting lead me into the registerFacilities() function inside log.cpp
Commenting out one line at a time narrowed down the offending/resetting code to this one line:
strcat_P(strBuf, (PGM_P)facilities[i].string); /* this line seems to cause the nano3 clone to continuously reset */

My guess is some sort of RAM buffer overflow or address corruption is happening on these cheap nasty clones...
What registerFacilities() does or is need for, I don't know but I've commented out the call to that function and have not had an issue with the operation or performance of uno2iec. Also just commenting out the offending line of code also produces a working uno2iec with no undue effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant