Hello,
I recently started to work with a nRF52-DK board and I meet an include issue. I already has a successfully based on the PlatformIO Tuto here but when I try to implement a time based serial logger as in the Nordic docs examples (see nRF5_SDK_16.0.0_98a08e2>peripheral>timer) I get an error :
#include <stdbool.h> //OK
#include <stdint.h> //OK
#include "nrf.h" //OK
#include "nrf_drv_timer.h" //NOK (even with <>, and file is well here : Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_timer.h)
#include <bsp.h> //NOK (even with <>, and file is well here : /Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/components/libraries/bsp/bsp.h)
#include <app_error.h> //NOK (even with <>, and file is well here : /Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/components/libraries/util/app_error.h)
According to platformIO Documentation I tried to add the following to my PlatformIO.ini
build_flags=
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/components/libraries/
But nothing seems to work.
I then tried explicit add with
build_flags=
...
-include/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_timer.h
that worked this this the first include but not for it’ local dependencies…
As it looks like a config error, here is the summup then full configs :
Summup
[env:nordicnrf52]
build_flags=
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/components/libraries/util
lib_deps =
Wire
SPI
framework = arduino
platform = nordicnrf52
board = nrf52_dk
debug_tool = jlink
monitor_speed = 115200
Full
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
;[env:nanoatmega328]
;platform = atmelavr
;board = nanoatmega328
;framework = arduino
;monitor_speed = 115200
;upload_port = /dev/cu.wchusbserial1420
;monitor_port = /dev/cu.wchusbserial1420
;lib_deps =
; Wire
; SPI
; ; gpio_expander
[env:nordicnrf52]
build_flags=
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy
-I/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/components/libraries/util
;-include/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_timer.h
lib_deps =
Wire
SPI
; gpio_expander
framework = arduino
platform = nordicnrf52
board = nrf52_dk
debug_tool = jlink
monitor_speed = 115200
Thank you in advance