Page 1 of 1

[RFC] PlatformIO packaging

Posted: Tue Mar 09, 2021 12:14 am
by Dzarda
Hi,

I've been thinking about a solution for making ChibiOS available simply/cleanly within PlatformIO (or generally without Makefiles). This is aimed at covering a (IMHO) major case when:
    - One uses PlatformIO
    - Wants RT+HAL

I did an experiment where I run make -n, parse the output and package up relevant sources. Can be seen here https://github.com/dzarda/ChibiPIO
Example package:
ChibiPIO-STM32F0.7z
(354.31 KiB) Downloaded 473 times


At this point I simply zip up relevant files into src/ and include/ directories. This package is then downloaded automatically by PIO according to the platformio.ini project manifest.

Roadmap:
    1. Add makefiles for all STM32 families (or employ existing Makefiles)
    2. Build and publish packages automatically upon Chibi releases
    3. Make it into a "framework", thus handling the linker scripts etc. automatically

Few things I'm not sure about still:
- What about the USE_FPU/USE_FPU_OPT options? Would have to be handled in framework .py code

Any comments and ideas are wanted.
Thank you!

Re: [RFC] PlatformIO packaging

Posted: Tue Mar 09, 2021 10:38 am
by Giovanni
Hi,

Interesting but note that makefiles also handle settings like FPU (as you already found), stack sizes, critical compiler options. How those would be handled? just packaging source files is not sufficient.

In addition there are other requirements for linker scatter files, I don't see those in the package.

Giovanni

Re: [RFC] PlatformIO packaging

Posted: Tue Mar 09, 2021 1:03 pm
by Dzarda
Please keep in mind the experimental nature. In the current state it can help with lowering the bar in third party build integration. IMO even in this raw state it can help significantly. Things like --defsym=__main_stack_size__=0x200 must be handled manually now.

Automation of .ld, FPU and -mcpu= flags can be handled *relatively* painlessly when this is turned into a PlatformIO Framework.

Re: [RFC] PlatformIO packaging

Posted: Thu Jul 01, 2021 8:16 pm
by Dzarda
In v21.6.1 I'm not able to get chrfcu.c to be compiled without `USE_SMART_BUILD = yes` - which I don't want as I want to include all sources regardless of configuration. Can't figure out what's the deal with that...

Re: [RFC] PlatformIO packaging

Posted: Thu Jul 01, 2021 8:24 pm
by Giovanni
Hi,

The file is missing in rt.mk, it is fixed in repository.

Giovanni

Re: [RFC] PlatformIO packaging

Posted: Thu Jul 01, 2021 8:26 pm
by Dzarda
Wow you're quick, I only just managed to figure it out while you've already fixed it :D