Hi,
I have my own bootloader in FLASHA and B. I am trying to erase and then program the application in consecutive flash sectors.
I setup security zone 1 by:
1) Z1-GRABSECT = 0x0555 5555 (all flash sectors in zone Z1)
2) Z1-GRABRAM = 0x1000 5015 (cla, ramd0, ramd1, ramls0-2 in the zone)
Flash programming functions are located in ramd0-1, by linker settings:
.TI.ramfunc: { -l F021_API_F2837xD_FPU32.lib }
LOAD = FLASHAB, PAGE = 0
RUN = RAMD0_1, PAGE = 0,
LOAD_START(_RamfuncsLoadStart),
LOAD_SIZE(_RamfuncsLoadSize),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
RUN_SIZE(_RamfuncsRunSize),
RUN_END(_RamfuncsRunEnd),
table(BINIT)
When there is no security setup the application is programmed properly, it means corresponding flash sector (i.e. flashC) is properly erased and programmed and next started.
When the security zone is enabled the operation of erasing the sector hangs inside the function:
Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32 *)address); // (address is 0x84000)
It is called but never returns.
I read "Updating Firmware on Security Enabled TMS320F2837xx or TMS320F2807x Devices", and followed the second option when providing the key and unlock is not necessary:
"Since code running from within a zone can reprogram any Flash memory in that zone, the password for that zone need not be written into the KEY register and the zone will stay locked in the view of the other zone and unsecure space"
Regards,
Piotr Romaniuk