I'm trying to use a section of the TM4C129ENCPDTI3 Flash memory to store some log data in a circular fashion within one of the 16K sections. I've computed a region safely outside/above the areas where the program is stored and wrote some code to erase and periodically write 32byte records consecutively until I get close to the end of the 16K section.
Problem is that after a write a few records, the system locks up and breaks the connection to my debugger (Blackhawk XDS100V2) . Then its hard to re-establish the connection once this occurs. I have to time the downloading of the program just write while I keep rebooting my board to get the debugger connect (I suspect before it gets to my test code for writing to the flash) If I comment out my writes I have not problems.
My code is very simple. I just use these two functions:
ROM_FlashProgram() // to write the data, yes its multiple of 4 bytes
ROM_FlashErase // to erase the 16K block (yes its on a 16K - based address
And read my data simply by using a direct pointer and typecasting.
Are there other things I need to be doing in my erasing and writing? I also check the return codes from the erase and program and do not get any errors.
Thanks,
Bill