This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52-DK + PlatformIO + VSCode : Upadte include path

Hello,

I recently decided to upgrade an Arduino project to you nice and well documented products :) 

I successfully built and run the example provided here and tried to implement my very first function : a time based serial logger. I then rushed into the nRF5_SDK_16.0.0_98a08e2 examples and thought the peripheral>timer was the perfect match.

Unfortunatelly,, includes do not seem to work

#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. Can you please give me a hint ?
I'm on PlatformIO 4.3.4, VSCode, MacBook Pro retina mid 2012 MacOS 10.15.5 (19F101)
Parents
  • If this can help for troubleshooting, manually adding 

    build_flags=
    ...
    -include/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_timer.h

    Removes the build error on this very #include. unfortunately this do not solve it' inner dependencies and then I ha even more errors. 
    This really looks like a missconfuguration su here is mine :
    ; 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
    ;     https://github.com/PJCzx/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
        https://github.com/PJCzx/gpio_expander
    framework = arduino
    platform = nordicnrf52
    board = nrf52_dk
    debug_tool = jlink
    monitor_speed = 115200
Reply
  • If this can help for troubleshooting, manually adding 

    build_flags=
    ...
    -include/Users/pierrejuliencazaux/Documents/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_timer.h

    Removes the build error on this very #include. unfortunately this do not solve it' inner dependencies and then I ha even more errors. 
    This really looks like a missconfuguration su here is mine :
    ; 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
    ;     https://github.com/PJCzx/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
        https://github.com/PJCzx/gpio_expander
    framework = arduino
    platform = nordicnrf52
    board = nrf52_dk
    debug_tool = jlink
    monitor_speed = 115200
Children
No Data
Related