cancel
Showing results for 
Search instead for 
Did you mean: 

Running Keil's RTX OS after a jump from from bank 1 to bank 0

tomt
Associate II
Posted on April 03, 2009 at 03:44

Running Keil's RTX OS after a jump from from bank 1 to bank 0

1 REPLY 1
tomt
Associate II
Posted on May 17, 2011 at 09:58

Hi everyone,

I am working on the bootloader for the STR912FAW44. The bootloader is stored in bank 1. The application is stored at bank 0. So far, I got it to boot from bank 1 (0x0) and jump to bank 0 (0x80000) to execute in main. In application main, it suppose to initialize the RTX OS provided by Keil. It gets stuck in the os_sys_init function of the RTOS. Upon further investigation, I realize that the interrupt vector table is still based on the bootup of bank 1, so all IRQ jumps to address 0x18, which is in bank 1. Therefore, the interrupt-handling is not correct. The RTX OS is dependent on the timer interrupt to update it's tick count. My guess is that the ticks never update and hence, there's no task-switch once the RTX runs. I was wondering if someone has knowledge of how to get the RTX OS to work after the bank jump. I have thought about writing a jump condition is based on a variable that I set once I get to main. In all of the handlers, i.e., DAbt, FIQ, IRQ, SWI, etc., it will check for this flag and if set it will jump to a IRAM address which will handle the exception. Not sure this will work or not.

Has anyone gotten this to work or any ideas specifically the STR912 and RTX OS?

One thing that is troublesome is that the flash controller can not be reset completely, hence, why this software workaround must be done. In the normal working situation, one would simply boot from bank 1 and upgrade the firmware in bank 0, and reset. If no upgrade is needed, it simply remaps the banks to boot from bank 0. But limitation on STR91xFAxx is documented and it doesn't reset one of the flash configuration registers, which means that the remap isn't set and hence still boot from bank 1. :(

If anyone has any ideas, please comments.

Thanks,

Tom