Source download missing file

I created a project targeting the nRF52840 DK with a HTS221 temperature and humidity sensor. It worked fine on the nRF52840 board wired to the HTS221 sensor. Then I wanted to try to download the source and modify some of the HTS221 sensor configuration settings.

Since this uses Mbed, I thought I should be able to use Mbed Studio to build a local version on my Windows 10 workstation. To do this, I created an empty Mbed OS project, then added the downloaded source and the mbed_app.json file. Mbed Studio appeared to be set up OK with the source files.

My initial build complained the following was missing:
.\source\ble\ble_nordic.cpp:4:10: fatal error: ‘ble/GapAdvertisingData.h’ file not found
#include “ble/GapAdvertisingData.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~

I don’t know if this was intentional. I did not find the GapAdvertisingData.h file in what was downloaded.

BTW, I was using the DigiKey IoT version of Atmosphere. I assume it would be completely up to date.

Thanks, Max

I imported this project into Atmosphere IoT Studio, compiled, and downloaded. I’m still missing a couple of the .h files called out in #include statements in ble_nordic.cpp.

Max,

MBED tends to be highly dependent upon the MBED version for a given project. For the NRF board, make sure you’re using this exact version of mbed-os:

Thanks! This was very helpful. I wasn’t aware of that and was trying to use a more recent version of mbed-os.

So I configured Mbed Studio to use the library that was downloaded with the source files. This came up as mbed-os 5.13.0 Commit: 7482462434d5cf718177653ef797547a976a7c5e. Mbed Studio then added all the correct library files, which I found worked rather nicely. I was then able to build the project. It appears the “missing” files were generated during the build process. I was then able to program the nRF52840 DK with the resulting .hex file and connect using the Atmosphere IoT app on an Android tablet as before.

Looks like I’m good to go for building locally on my Windows 10 workstation using Mbed Studio.

Max