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

[RFC] PlatformIO packaging

Postby Dzarda » Tue Mar 09, 2021 12:14 am

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 169 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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [RFC] PlatformIO packaging

Postby Giovanni » Tue Mar 09, 2021 10:38 am

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
Location: Brno, Czech Republic
Has thanked: 7 times
Been thanked: 5 times

Re: [RFC] PlatformIO packaging

Postby Dzarda » Tue Mar 09, 2021 1:03 pm

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
Location: Brno, Czech Republic
Has thanked: 7 times
Been thanked: 5 times

Re: [RFC] PlatformIO packaging

Postby Dzarda » Thu Jul 01, 2021 8:16 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [RFC] PlatformIO packaging

Postby Giovanni » Thu Jul 01, 2021 8:24 pm

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
Location: Brno, Czech Republic
Has thanked: 7 times
Been thanked: 5 times

Re: [RFC] PlatformIO packaging

Postby Dzarda » Thu Jul 01, 2021 8:26 pm

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


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 26 guests