Having issues getting up and going with Zephyr on PlatformIO

The problem I am trying to resolve as of right now (and I am behooved as to how this is happening) is ‘.platformio/packages/framework-zephyr/include/zephyr/toolchain/gcc.h:99:10: fatal error: stdbool.h: No such file or directory’

I would think that the pio/zephyr build environment should include such an elementary header file as part of the C standard library. I do know that embedded devices don’t often use the full standard library that a computer OS would use…

And other things seem to point to potential issues with my pio install too, since I noticed that:

  • pio CLI didn’t appear to be installed, or at least it wasn’t in my PATH in the linux shell

  • DNF (Fedora) does find PIO, but it fails to install since the repository for it is returning 404

  • having installed pio via pip and the default python3 in Fedora 43, I think the python version is too new and gives errors. (It’s starting to get outside the scope of me figuring out zephyr but I may need to go down this rabbit hole to fix the environment I’m working in.

  • menuconfig doesn’t work? is there a PIO abstraction I need to be made aware or is my system hoopajouped?

Anyways, regarding another question, how do I, within the PIO ecosystem, do Kconfig without guessing what goes into my prj.conf blind or copying other peoples’ code, based on the documentation found at places like this display?

I think(?) I got the device tree configured correctly for it…

&spi1 {
    status = "okay";
};

/ {
    chosen {
        zephyr,display = &ili9341;
    };

    mipi_dbi: mipi-dbi {
        compatible = "zephyr,mipi-dbi-spi";
        spi-dev = <&spi1>;
        dc-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;
        #address-cells = <1>;
        #size-cells = <0>;
        // backlight-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;

        ili9341: display@0 {
            compatible = "ilitek,ili9341";
            reg = <0>;
            mipi-max-frequency = <20000000>;
            mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
            width = <240>;
            height = <320>;
            pixel-format = <0>;
            rotation = <0>;
            status = "okay";
        };
    };
};

And then for the prj.conf:

CONFIG_SPI=y
CONFIG_GPIO=y
CONFIG_DISPLAY=y
CONFIG_ILI9341=y
CONFIG_INPUT=y
CONFIG_INPUT_XPT2046=y

CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_LVGL=y
CONFIG_DISPLAY=y
CONFIG_ILI9341=y

platformio.ini:

[env:nucleo_g474re]
platform = ststm32
board = nucleo_g474re
framework = zephyr
build_flags = -DOVERLAY_FILE="boards/nucleo_g474re.overlay"

Source code for the moment is just an abomination of the blinky example and some LVGL example I wanted to print hello world to the display. Currently I’m still trying to get all the dev enviroment stuff to work.

The full output of the error for stdbool.h is as follows:

 *  Executing task in folder getting_started: platformio run 

Processing nucleo_g474re (platform: ststm32; board: nucleo_g474re; framework: zephyr)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_g474re.html
PLATFORM: ST STM32 (19.4.0) > Nucleo G474RE
HARDWARE: STM32G474RET6 170MHz, 128KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES: 
 - framework-zephyr @ 3.40201.251021 (4.2.1) 
 - tool-cmake @ 3.21.3 
 - tool-dtc @ 1.4.7 
 - tool-gperf @ 3.0.4 
 - tool-ninja @ 1.7.1 
 - toolchain-gccarmnoneeabi @ 1.120301.0 (12.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- lvgl @ 9.4.0
Building in release mode
Compiling .pio/build/nucleo_g474re/libf58/lvgl/draw/sw/blend/helium/lv_blend_helium.o
In file included from /home/powermax/.platformio/packages/framework-zephyr/include/zephyr/toolchain.h:52,
                 from /home/powermax/.platformio/packages/framework-zephyr/modules/lvgl/include/lv_conf.h:11,
                 from .pio/libdeps/nucleo_g474re/lvgl/src/draw/sw/blend/helium/../../../../lv_conf_internal.h:56,
                 from .pio/libdeps/nucleo_g474re/lvgl/src/draw/sw/blend/helium/lv_blend_helium.h:22,
                 from .pio/libdeps/nucleo_g474re/lvgl/src/draw/sw/blend/helium/lv_blend_helium.S:10:
/home/powermax/.platformio/packages/framework-zephyr/include/zephyr/toolchain/gcc.h:99:10: fatal error: stdbool.h: No such file or directory

***********************************************************************
* Looking for stdbool.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stdbool.h"
* Web  > https://registry.platformio.org/search?q=header:%1B%5Bm%1B%5BKstdbool.h
*
***********************************************************************

   99 | #include <stdbool.h>
      |          ^~~~~~~~~~~
compilation terminated.
Compiling .pio/build/nucleo_g474re/libf58/lvgl/draw/sw/blend/lv_draw_sw_blend_to_argb8888_premultiplied.o
*** [.pio/build/nucleo_g474re/libf58/lvgl/draw/sw/blend/helium/lv_blend_helium.o] Error 1
================================================================================================================================== [FAILED] Took 5.39 seconds ==================================================================================================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.