Discussion Forum

bootloader and rtx problem

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Joe Nutter
Posted
6-Jan-2009 20:36 GMT
Toolset
ARM
New! bootloader and rtx problem

I wrote a simple bootloader program (doesn't do anything but jump to the application code in flash once a timer expires) and I am having trouble getting rtx to work in the application code. It gets to a point in os_sys_init()'s assembly code where it will stick. I also find that all my other interrupts do not work either, although the lst file that it is generated seems to be putting the applications vector tables in the correct place...any ideas?

Read-Only
Author
Per Westermark
Posted
6-Jan-2009 20:39 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

Your bootloader "owns" the normal flash interrupt vector table. What have you done to remap the vector table into an address range where your application may instal its own vector table?

You don't tell what chip you are using but many ARM variants have a configuration flag to map in a vector table from RAM to replace the boot loader vector table.

Read-Only
Author
Joe Nutter
Posted
6-Jan-2009 20:46 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

I am using the stm32f103ze cortex m3 chip.

I set the define in my startup file to be RAM_INTVEC REMAP RAM_MODE

should i be using the NVIC...will that help remap my interrupt vectors into the correct spot?

Read-Only
Author
Tamir Michael
Posted
9-Feb-2009 12:51 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

Joe,
Have you found a solution? I am bust integrating my bootloader with a RTX kernel and I have the same problem. The bootloader does the remapping of interrupts, but the call that you mentioned does not start the first task.

Read-Only
Author
Joe Nutter
Posted
9-Feb-2009 13:26 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

I did fix the problem. I used the NVIC Configuration to move my vector tables to the correct place. so i was putting my code at 0x8010000, so I used the following function:

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x10000);

You can check using the debugger that the vector table is in the right place in the beginning of the code. The first vector will be your stack pointer and the second vector will be the reset vector. The reset vector should be in the range of where you are putting your code, in my case it was 0x801013e or something like that.

Let me know if you have any more questions

joe

Read-Only
Author
Tamir Michael
Posted
9-Feb-2009 13:36 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

Joe,
Thanks for your reply. This is my situation (LPC2478): I have a boot loader from 0x0 to 0x4000, and an application that starts at 0x4000. the bootloader remaps the vector table and copies the application vector into RAM. I jump to 0x4000 as expected, eventually enter 'main', call 'os_sys_init' and...that's it. of course the application does not use internal RAM from 0x40000000, but rather 0x40000020.
did you do something special to handle SWIs...?

Read-Only
Author
Tamir Michael
Posted
9-Feb-2009 13:41 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

Joe,
I got it. Added 'RAM_INTVEC REMAP RAM_MODE' to the ASM define tab of the application (even though the bootloader already remaps and copied. hmmmm. this approach (above) did not work without RTX!

Read-Only
Author
Joe Nutter
Posted
9-Feb-2009 13:45 GMT
Toolset
ARM
New! RE: bootloader and rtx problem

Sounds like you are jumping to the beggining of the code space vice jumping to the reset vector. Your reset vector will be in the beginning of your code (we are using different micros), but your bootloader should read in the vector and jump to the address that is listed in the vector

Next Thread | Thread List | Previous Thread Start a Thread | Settings