[RFC] PlatformIO packaging

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.
Post Reply
Dzarda
Posts: 21
Joined: Sat Feb 28, 2015 2:28 pm
Has thanked: 7 times
Been thanked: 5 times

[RFC] PlatformIO packaging

Post 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 471 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!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [RFC] PlatformIO packaging

Post 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
Dzarda
Posts: 21
Joined: Sat Feb 28, 2015 2:28 pm
Has thanked: 7 times
Been thanked: 5 times

Re: [RFC] PlatformIO packaging

Post 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.
Dzarda
Posts: 21
Joined: Sat Feb 28, 2015 2:28 pm
Has thanked: 7 times
Been thanked: 5 times

Re: [RFC] PlatformIO packaging

Post 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...
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [RFC] PlatformIO packaging

Post by Giovanni »

Hi,

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

Giovanni
Dzarda
Posts: 21
Joined: Sat Feb 28, 2015 2:28 pm
Has thanked: 7 times
Been thanked: 5 times

Re: [RFC] PlatformIO packaging

Post by Dzarda »

Wow you're quick, I only just managed to figure it out while you've already fixed it :D
Post Reply