Porting ChibiOS to a Board with Bootloader

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
clausi
Posts: 3
Joined: Wed Oct 12, 2011 7:56 am

Porting ChibiOS to a Board with Bootloader

Post by clausi »

Hi all,
first thanks for your great work on ChibiOS...I love it

However I've got a STM32F103 based board that has a bootloader between 0x8000000 and 0x8004000. I modified the ch.ld file to start the flash at 0x8004000 and wrote the board.h/board.c to meet my hardware layout.
On startup the main() is called but it seems that the sheduler does not start so the system stops at the first chThdSleepMilliseconds(...). Did I missed something to port for this special bootloader setup?

Cheers
Clausi
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Porting ChibiOS to a Board with Bootloader

Post by Giovanni »

Hi,

The default startup file makes some initializations to the core, the kernel expects the main() to be invoked under the following conditions:
- Dual stack mode.
- Stacks initialized in the correct position defined by the ld file.
- Supervisor mode.
- Interrupts disabled.

See crt0.c for details.

Giovanni
Post Reply