This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCBSTR9 bootloader on bank1 and run main application on bank 0

I have a MCBSTR9 eval board and in the process of implementing a bootloader. The bootloader boots from bank 1 and once it has finished with the firmware upgrade, it should remap the flash controller to boot from bank 0 and do a system reset. I could not get this to work. After digging around, I found out from the ST website that the STR912FAW44 has a flaw on the chip, where it doesn't reset one of the FMI registers. This flaw causes flash controller to retain it's current configuration(booting from bank1). The system reset does not to reset the peripheral registers and hence the system still think it's booting from bank 1.

I am trying their workaround and they (ST) suggested to boot from bank 1 and DON'T remap the flash controller to boot from bank 0. But rather, jump to a hard address in bank 0, i.e. 0x80000. I had compiled my main application mapping all of the code to start from 0x80000. At 0x80000, the reset handler for the main application resides here. I am not sure whether I should even have a reset handler for the main application since, I am just jumping there to execute code. I am also not sure whether this will work or not because I've checked the MAP file and this section's attribute is marked as read-only. Is it possible to execute code from a flash memory region declared as read-only? I don't know how to change the flash memory section attribute to allow it to be executable.

I keep getting caught in the Prefetch Abort Exception as I jump to this address 0x80000. Could this be that the memory attribute is read-only?

Couple of main questions:

1) Is it possible to run this scheme? { Assumption: YES }

2) Do I need the reset handler in the main application based on my scheme? { Assumption: NO }

3) How can I change the flash memory region to be read/write/execute? { Assumption: ??? }

Thanks,
Tom

0