Changes in board files

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Changes in board files

Postby Giovanni » Sat Dec 18, 2010 9:37 pm

I think a change is required in how board files are organized, the current board files export hwinit0() and hwinit1() functions that are automatically invoked by the startup files.
Probably making assumptions on how the startup is organized is not such a good idea, it makes porting the RTOS on a different compiler more complicated.
I am thinking to modify the board files this way:
  • Optionally export an __early_init() function (most startup files support the concept of early initialization), this is basically the old hwinit0().
  • Export a boardInit() function that has to be invoked from the main() function.
  • halInit() and chSysInit() will have to be explicitly invoked from the main() function too, no more hidden initializations.

The changes will make the board files usable regardless the specific compiler and its startup files.

Another reason to do this is that I don't want to make demos for GCC, IAR, Keil etc. The demos will be generic and compilable using any supported compiler, I will just put the build files for IAR, Keil etc in subdirectories within the demo alongside the GNU makefile.

Giovanni

Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 17 guests