Custom boards definitions can be used by putting them in de boards
directory in the project directory. See the topic boards_dir. This is great!
When building a project using pio run
these boards are found and all compiles without any problems.
However, when you are creating a library this does not work anymore. The library project still has a directory boards in the project directory. Using the pio boards
command, these boards are present and listed. This seems to indicate the directory for the boards is correct.
However, when building the library using the pio ci --lib
command (for CI) the build for the example inside the library fails because it cannot find the board:
pio ci --lib=src --lib=include --exclude=example --exclude=boards --project-conf="example/platformio.ini" "example/main.cpp"
Project has been successfully updated!
Processing esp32-2424S012C (board: esp32-2424S012C; platform: espressif32; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
UnknownBoard: Unknown board ID 'esp32-2424S012C'
The library follows the recommended structure, as per Creating Library. The examples directory contains a platformio.ini file that references boards, present in the boards directory.
I tried to move the boards directory to the examples directory, played with the --project-conf options, the project-conf option set the boards directory and lots of fiddling but nothing helped.
Someone faced the same issue? Any suggestions?