Closed PladsElsker closed 2 years ago
Can you provide any information about what you mean by "broke"? Permanently? It required a power cycle? What board and microcontroller were you using?
This is the board. It's an arduino micro R3.
What I mean by "broken" is that the board is no longer programmable using the arduino software, because the board cannot be recognized by windows.
In my pc's device manager, the board is no logner recognized. I will post a screenshot of this later.
Is it possible to mess with the bootloader using this library? I would be surprised if that was the case, but I'm asking anyway...
Else, do you think this could be related to how the serial communication is handled in the library?
By the way, I don't think I will be using this board again in the future, so it's not really problematic for me. I think it could be for other people, though.
Here is what my device manager looks like:
What's more, I can easily program other arduino boards, so the problem is probably not with the instalation of arduino or with the windows drivers on my computer.
The bootloader should be protected so that user code cannot mess with it. AVRs have protection for this. If bad user code can mess with the bootloader the error is with fuses not being set correctly.
Since at least 2018-06-02 setClock()
has had limits to keep the clock period >= 2 µs and 510 µs (ie clock frequency must be in range 1960 Hz to 500 kHz).
I cannot see how the error is due to the SoftWire
library.
Very interesting. The issue must be something else on my side, then. I cannot see how it can be something else, but that's my own problem :p Thanks for the update
I don't have the source code anymore sadly, and I am kind of scared to repreduce the results on another board. The code was very simple, though. It was something like that:
I'm not sure if I called
setClock(0)
before or after thebegin()
call.I'm pretty sure that's what broke it because the parameter
0
in thesetClock(0)
function is the only value I changed before and after compiling and uploading.If it's not only my hardware that's at risk, maybe it would be a good idea to prevent users from setting the clock to 0Hz, or to negative numbers (assuming that's even possible).