Page 1 of 3

[NEW] Portable multi-device/board ChibiOS applications

Posted: Mon Aug 28, 2017 10:13 am
by Giovanni
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

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

Posted: Wed Aug 30, 2017 7:42 am
by tecnologic
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

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

Posted: Wed Aug 30, 2017 7:47 am
by Giovanni
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

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

Posted: Wed Aug 30, 2017 10:15 pm
by tfAteba
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?

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

Posted: Thu Aug 31, 2017 7:53 am
by Giovanni
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

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

Posted: Sun Sep 03, 2017 4:53 pm
by tfAteba
I will then make some tests and give feedback when I will have some time to spend on it.

Thanks

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

Posted: Wed Sep 06, 2017 6:39 am
by e_l_tang
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.

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

Posted: Wed Sep 06, 2017 9:35 pm
by tfAteba
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.

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

Posted: Wed Sep 06, 2017 10:02 pm
by tfAteba
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.

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

Posted: Thu Sep 07, 2017 7:54 am
by Giovanni
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