[NEW] Portable multi-device/board ChibiOS applications

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

[NEW] Portable multi-device/board ChibiOS applications

Postby Giovanni » Mon Aug 28, 2017 10:13 am

Hi,

I committed an example of a multi-device/multi-board project under ./testhal/STM32/USB_CDC.

The project is able to generate binaries for multiple devices/boards. The main Makefile compiles all the sub-makefiles, output goes in multiple ./build_xxx directories. It is possible to build only a single target using the command:

make -f Makefile_xxx

After importing the project in Eclipse, the "Default" configuration builds all targets, there are extra configurations that allow to build/clean specific ones.

New files have been introduced portab.c and portab.h, define target-specific structures and macros in there, the purpose is to isolate non-portable parts from the main application.

Probably all the demos in ./testhal will be ported to the new system in order to reduce the absurd number of projects we have to maintain.

Giovanni

tecnologic
Posts: 100
Joined: Tue Jan 10, 2012 8:42 am
Has thanked: 12 times
Been thanked: 2 times

Re: [INFO] Portable multi-device/board ChibiOS applications

Postby tecnologic » Wed Aug 30, 2017 7:42 am

Hi Giovanni,

great! But is it possible to have a board.h for each configuration? In my Project i use different CPUs but also the same CPU on different boards with different pinning but the same Signals so my LINE_.... definitions are named the same but the board.h maps them to other physical pins.

regards

Tec

User avatar
Giovanni
Site Admin
Posts: 10341
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 231 times
Been thanked: 205 times
Contact:

Re: [INFO] Portable multi-device/board ChibiOS applications

Postby Giovanni » Wed Aug 30, 2017 7:47 am

Hi,

It is possible, just refer a different board file from the various makefiles, if you have multiple custom board files the you could place them in those configuration directories, board files are basically configuration files.

Giovanni

User avatar
tfAteba
Posts: 422
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 55 times
Been thanked: 29 times

Re: [INFO] Portable multi-device/board ChibiOS applications

Postby tfAteba » Wed Aug 30, 2017 10:15 pm

Hi Giovanni, Hi all,

Great this is a cool feature but also useful.

Can this be use for a project where various architectures are combined?
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 10341
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 231 times
Been thanked: 205 times
Contact:

Re: [INFO] Portable multi-device/board ChibiOS applications

Postby Giovanni » Thu Aug 31, 2017 7:53 am

Yes it can, I placed it under /STM32 but if you are successful in adding AVR then it could be moved up one level. The problem is that AVR makefiles are not like ours, not sure if it is possible to relocate directories.

Giovanni

User avatar
tfAteba
Posts: 422
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 55 times
Been thanked: 29 times

Re: [INFO] Portable multi-device/board ChibiOS applications

Postby tfAteba » Sun Sep 03, 2017 4:53 pm

I will then make some tests and give feedback when I will have some time to spend on it.

Thanks
regards,

Theo.

e_l_tang
Posts: 31
Joined: Sun Jul 03, 2016 7:58 pm
Been thanked: 2 times

Re: [NEW] Portable multi-device/board ChibiOS applications

Postby e_l_tang » Wed Sep 06, 2017 6:39 am

I find this to be a very useful feature. I have been wondering if I could make my project compile for both AVR and ARM after converting it to run on ChibiOS. I'm looking forward to seeing the example.

User avatar
tfAteba
Posts: 422
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 55 times
Been thanked: 29 times

Re: [NEW] Portable multi-device/board ChibiOS applications

Postby tfAteba » Wed Sep 06, 2017 9:35 pm

Hello Giovanni,

I just added a demo to the multi folder for the stm32f429 discovery board. The demo build just fine but sorry I do not have the hardware with me so I can't make test until this week-end.

Thanks.
regards,

Theo.

User avatar
tfAteba
Posts: 422
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 55 times
Been thanked: 29 times

Re: [NEW] Portable multi-device/board ChibiOS applications

Postby tfAteba » Wed Sep 06, 2017 10:02 pm

Giovanni,

Adding the demo for the stm32f429 discovery was easy because this board is similar to the other boards supported at the moment.
(All boards have 2 or more debugging Leds).

What about adding a Nucleo board for example the stm32d401re (Only one debugging Led)?
I found that the main.c file must be modify in that case, Is it allow? Or would it be a good idea to make another directory for the nucleos boards ?

That will also help me to know what to do when I will try this feature with the AVR architecture.

Thanks.
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 10341
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 231 times
Been thanked: 205 times
Contact:

Re: [NEW] Portable multi-device/board ChibiOS applications

Postby Giovanni » Thu Sep 07, 2017 7:54 am

Nucleo can be added to the same project but I would not add too many F4s, better add one device per family or it will get cluttered.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 1 guest