Adding STM32 board to zephyr-training

Hello Golioth,

I’m working on adding ST Nucleo-F767zi board support to the zephyr training.

So far I made the changes to the sdk and the zephyr-training repos so that I can build the examples/apps (02, 03 and 04) successfully.

I can also run examples/apps on my board without modifying any app code,

except the 05_golioth app, it seems that the build system doesn’t take into account my boards/nucleof767_stm32f767.conf file and when I try to force it using the -DCONF_FILE=“boards/nucleof767_stm32f767.conf” in the west commands it overrides the prj.conf and I get a build error.

The 05_golioth app only worked when I moved my board specific configs inside the prj.conf file

Here is my environment:

  • Zephy SDK and dependencies setup according to official docs
  • Windows 11
  • PowerShell 7
  • Python virtual environment to run west

and here the changes on my GitHub forks for the zephyr-training and Golioth SDK where you can find the changes I made to add my STM32 board:

Please note that I’m new to west and zephyr build system and even though I can build and run the examples, I’m not really sure if I made the correct changes or if there is a better way to handle this.

Thank you in advance,
Bayrem

Hi, Bayrem!

What’s the actual build error you’re getting? Can you paste it in this thread? Also, what’s the exact build command you’re using?

Cheers,
Tim

Hi Tim,

for my board I need these 2 configs to connect to network:

CONFIG_NET_DHCPV4=y
CONFIG_GOLIOTH_SAMPLE_DHCP_BIND=y

If I add these configs inside the app\05_golioth\prj.conf and build with the following command everything works fine.
west build -b nucleo_f767zi -- -DDTC_OVERLAY_FILE="boards/nucleof767_stm32f767.overlay"

However I want to add those configs in app\05_golioth\boards\nucleof767_stm32f767.conf and when I do that those configs are not taken into consideration when building.

I also tried to force it using the west command like the following, but then the prj.conf file is not taken into consideration when building.

west build -b nucleo_f767zi -- -DDTC_OVERLAY_FILE="boards/nucleof767_stm32f767.overlay" -DCONF_FILE="boards/nucleof767_stm32f767.conf"

I’m not sure how to tell the build system to use both the prj.conf and the boards/nucleof767_stm32f767.conf

Regards,
Bayrem

Hi Bayrem,

West will automatically pick up board overlay and board config files based on the name of the board. If you put the overlay at boards/nucleo_f767zi.overlay and the config file at boards/nucleo_f767zi.conf then you can build with west build -b nucleo_f767zi. Just make sure the file names match the board name you pass to west.

Sam

1 Like

Hi Sam!

Thank you for the answer, that worked!

Now I can build and run the following apps on my board successfully:

  • 02_helloworld
  • 03_LED
  • 04_blinkRTOS
  • 05_golioth (I’m able to get an IP address from DHCP)

However when I try to build the 01_IOT app I get a build error stating that it cannot find qcbor.

So I added qcbor include path to the app\01_IOT\CMakeLists.txt file like the following:

target_include_directories(app PUBLIC ${ZEPHYR_BASE}/../modules/tee/tf-m/qcbor/inc)

That solved the include error, but now I’m getting a new error of undefined reference of ``QCBOREncode_AddBuffer` function:

Am I missing something here?

You can find here all my changes to the zephyr-training repo.

Regards,
Bayrem