Fatal error: stm32f2xx.h: No such file or directory

I have a P1 project that builds the firmware and the application together locally, using .5.1 Firmware for the P1. I am running on a Mac with the arm-none-eabi-xxx v 5.3.1 20160307 release. I have a team member that is trying to get setup to build the project and is receiving an error.

To help him figure it out, I downloaded a fresh copy of the repository (including the firmware) and can replicate his error, but in my original local repository everything is fine and I get no errors even on a clean build. I have also tried downloading .5.3 and .6 firmware on my machine and updating the project and I am seeing the same error when attempting those builds. So it feels like a missing include dir or something along those lines. The Firmware builds fine, it is only when we go to build the app now that we get the following error, and no where are we including this file, it is within the firmware.

This is the error we receive:

In file included from …/wiring/inc/spark_wiring_system.h:34:0,
from …/wiring/inc/spark_wiring.h:47,
from src/spark_wiring_gpio.cpp:28:
…/hal/inc/interrupts_hal.h:98:23: fatal error: stm32f2xx.h: No such file or directory
compilation terminated.
make[2]: *** […/build/target/wiring_globals/platform-8-m/src/spark_wiring_gpio.o] Error 1
make[1]: *** [wiring_globals] Error 2
make: *** [modules/photon/user-part] Error 2

Any ideas what I am missing, I feel it is something stupid that I am forgetting or a step I missed.

@davismwfl, which directory are you compiling your app from? How are you invoking make?

I am running it from firmware/main

My make command is:
make -s $CLEAN_CMD all $BUILD_FLAGS APPDIR=…/…/device/src TARGET_DIR=…/…/device/binary TARGET_FILE=application PLATFORM=P1

$BUILD_FLAGS is where I specify a few build flags to configure things in our app but nothing that changes any firmware settings. For example we set a default locale for the build via a -D make option

Like I said this works in my existing repository but if I clone a new copy or try to upgrade the firmware it breaks with the error described.

Any ideas?
Thank you

@davismwfl, have you tried a “plain jane” make like “make clean all PLATFORM=P1 PARTICLE_DEVELOP=1 APP=xxx”?

1 Like

@peekay123 Thank you. I pulled out our $BUILD_FLAGS, which consisted of adding one to two -D statements to CFLAGS on the command line and the build worked.

So then I added the same flags back but used CPPFLAGS instead of CFLAGS and the build works fine. Very strange, but seemingly something changed in a firmware makefile between firmware releases. Our two build flags are only used to set some values like Locale and Build Revision in our code, so they “shouldn’t” actually affect the build process.

Seems a little odd how it manifested but super happy to have it at least resolved, but I will have to dig some more to figure out what changed.

Thanks for the help

1 Like