Part Number: TMS320F280049
We are writing a bootloader for a TMSF280049. The application code is sent to the device using bank 1 as a scratch space, then written to flash bank 0. This is working as intended.
I have now written some OTP settings to the device. I have all memory and flash bank 0 sectors allocated to zone 1 (GRABRAM = 0x55555555, GRABSECT = 0x55555555), and the CSM password written. I have not yet written to Z1OTP_PSWDLOCK. I can unlock the device to reupload my bootloader, and the bootloader is still running. I have not written to zone 2 OTP, and bank 1 flash is unsecured.
When I use my bootloader to upload application code, it's failing around the time we read the application code from bank 1, and write it into bank 0 using the ROM Flash API.
I'm struggling to debug this because I now can't debug the code via JTAG. It seems Fapi_issueProgrammingCommand is not returning any errors, but our following CRC check fails.
The code should be running from secure memory. Do we need to use CsmUnlock() before writing to secure flash belonging to the same CSM zone?
Do we also need bank 1 flash to belong to zone 1?
In CCS, when using JTAG debug, is it possible to unlock the device with our CSM password so we can debug freely?
Any other ideas to help debug would be appreciated.
Thanks