We have 5 Spark Flexes on our robot this year. One of them (shooter motor left) appears to be losing its CAN configuration on power cycle. We connect the REV hardware client, see its CAN ID has reverted to 0 and has lost its other settings, we fix them, click Burn Flash, and it will operate as expected until power cycling the robot again.
Firmware is at latest on all Flexes (2024.0.5). None of the others are exhibiting this issue.
Code if it matters, but we are using it in a very simple way
It is good practice to, in the constructor, call restoreFactoryDefaults(), configure your settings and then call burnFlash() this will ensure that the settings are always correct even if they would get changed.
I’m wondering if doing this over and over and over will eventually burn out the flash memory as well. From my experience with microcontrollers they had a limited number of operations writing the flash, reading wouldn’t hurt it though. It’s somewhere in the ten to hundreds of thousands though, so probably not something you’ll see in a single season
The conspiratorial part of me thinks that Rev wrote the MAXSwerve example with burnFlash() to burn out the flash memory more quickly-thus you need to buy 8 more controllers.
If we knew the exact chips involved inside a spark Max we could get a better estimate of the lifetime. Still like I said it’s not gonna burn out right away. I haven’t burned out an Arduino flash in awhile. I did have a program spamming it once in a loop and that did it
We had this issue, through testing we found we could burn the config and it would stay if we held the reset button on the rio down from the time we power it on until the ID is set and config burn. Now they seem to be functioning normally
We have one that seems to randomly reset itself, but it is not every power cycle. It is really strange. We may just need to change this motor out, but it will work a week with no issues then all of a sudden forgets it CAN ID and settings. It seems if we reset everything and burn flash it works good for a while again.
We used to always restore factory defaults and then would burn the flash on code initialization every time. It seems like sometimes restore factory defaults works, setting all the individual parameters works, but then burning the flash would not work.
That would mean that as long as everything was working correctly, the parameters would be saved until power was lost. Something would then cause a hiccup and the parameters would go back to factory defaults. This happened on at least two teams robots this year where the motor controller would lose that it was inverted and caused a shooter to spin backwards and one swerve wheel to fight the rest (these were regular sparks not flexes though)