Closed nolanhergert closed 9 years ago
Hi @nolanhergert - I recently added a fix to the address erase scheme - could you pull the latest code and try again. Specifically it affect addresses in the region you are writing to.
Seems to work well now! Thanks!
w00t! Thanks for coming back with that! :+1:
Hey Matt,
I am having problems when I'm using the AddressErase scheme. I've tried structs of both size 28 and 32 bytes, and a "flash size" of 980 and 1200 bytes, and the same thing happens for both. What happens is MultiWriteFlashStore::writeErasePage() gets caught somehow and does an infinite recursion and blows the stack.
When I wipe the flash and rerun my code, it works for 8 repetitions and then does the infinite recursion. When I don't erase the flash, it's random-ish when it shows up, but probably less than 8.
I added some printf's before line 224 to help debugging inside of the writeErasePageBuf function:
It seems to always be blowing up on the page boundary, but I don't have a good handle on the inner workings to debug it more. Can you help?
Normal Behavior
Writing to: 448 A: 000001cc, D: 00000e60, O: 0, L: 28, S: 128 A: 000001cc, D: 00000ee0, O: 16, L: 28, S: 128 Writing to: 476 A: 000001e8, D: 00000f40, O: 0, L: 23, S: 128 A: 000001e8, D: 00000fc0, O: 16, L: 23, S: 128 A: 000001ff, D: 00000ffe, O: 0, L: 5, S: 128 Writing to: 504 A: 00000204, D: 00001026, O: 0, L: 28, S: 128 A: 00000204, D: 000010a6, O: 16, L: 28, S: 128
Notes: The 2nd write encounters the end of the page boundary and handles it with an extra recursion. The code continues on normally.
After 8 Writes
Writing to: 448 A: 000001cc, D: 00000e60, O: 0, L: 28, S: 128 A: 000001cc, D: 00000ee0, O: 16, L: 28, S: 128 Writing to: 476 A: 000001e8, D: 00000f40, O: 0, L: 23, S: 128 A: 000001e8, D: 00000fc0, O: 16, L: 23, S: 128 A: 000001ff, D: 00000ffe, O: 0, L: 5, S: 128 A: 00000200, D: 00001006, O: 0, L: 4, S: 128 A: 00000200, D: 00001006, O: 0, L: 4, S: 128 A: 00000200, D: 00001006, O: 0, L: 4, S: 128 A: 00000200, D: 00001006, O: 0, L: 4, S: 128 A: 00000200, D: 00001006, O: 0, L: 4, S: 128
Notes: Normally, the write would finish, but it keeps recursing with the same values.
I have code! This is for a local build. Don't forget the printf above if you need it