Using Tiva '129 (TM4C129XNCZAD) CPU
CCS v6.1.3.00033
I have an application where I write to the upper half of CPU flash (0x80000 and above).
The code I am using verifies that the flash about to be written is all 0xFFs.
I am using the function ROM_FlashProgram. Prior to loading the driverlib/rom.h include file there is the following line: #define TARGET_IS_TM4C129_RA0 1
I am attempting to write 1024 bytes per call.
Very often I am able to write the entire 256K without issue. Then it will get into a mode where the first call to write 1024 bytes does not return.
Usually when it gets into this mode, it continues for awhile through power cycles and resets and then at some point it starts working again. Very frustrating.
When I say 'Does not return', I see the following symptoms:
If connected to JTAG, the following appears in the Console window of the debugger: CORTEX_M4_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.407.6. There is no exception or assertion posted.
If not connected to JTAG, the CPU reboots with no exceptions or assertions being posted, it looks just like the CPU reset button had been pressed.
In the TivaWare docs, I see that it says 'SysCtlClockFreqSet' may need to be called. I am not doing that. I have been letting the .CFG file set the CPU clock.
What changes can I make to have flash writes always succeed or at least return with a -1 which is what the docs say it should do?