Compilation error nrf52_dk plateformio



  • Hello,

    I'm new to mysensors and trying to test some nrf52832 cards.
    Currently I am able to communicate and load a basic program into the nrf52 card via a BMP.

    Basic code:

    #include <Arduino.h>
    
    void setup() {
      // put your setup code here, to run once:
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
    }
    

    Log:

    Processing nrf52_dk (platform: nordicnrf52; board: nrf52_dk; framework: arduino)
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
    Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nrf52_dk.html
    PLATFORM: Nordic nRF52 4.4.0 > Nordic nRF52-DK
    HARDWARE: NRF52832 64MHz, 64KB RAM, 512KB Flash
    DEBUG: Current (jlink) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
    PACKAGES:
     - framework-arduinonordicnrf5 1.600.190830 (6.0)
     - tool-bossac-nordicnrf52 1.10866.191129 (1.8.66)
     - tool-jlink 1.65200.0 (6.52.0)
     - tool-openocd 2.1000.190707 (10.0)
     - tool-sreccat 1.164.0 (1.64)
     - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    LibraryManager: Installing id=548
    Using cache: C:\Users\Ikes\.platformio\.cache\08\6b3d0755f5ced94725e5025051350d08
    MySensors @ 2.3.2 has been successfully installed!
    Found 37 compatible libraries
    Scanning dependencies...
    No dependencies
    Building in release mode
    Checking size .pio\build\nrf52_dk\firmware.elf
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM:   [          ]   0.2% (used 140 bytes from 65536 bytes)
    Flash: [          ]   0.4% (used 2256 bytes from 524288 bytes)
    Configuring upload protocol...
    AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, nrfjprog, stlink
    CURRENT: upload_protocol = blackmagic
    Looking for BlackMagic port...
    Auto-detected: COM6
    Uploading .pio\build\nrf52_dk\firmware.hex
    Target voltage: 3.02V
    Available Targets:
    No. Att Driver
     1      Nordic nRF52 M3/M4
     2      Nordic nRF52 Access Port
    0x000006ee in main ()
    Loading section .text, size 0x85c lma 0x0
    Loading section .ARM.exidx, size 0x8 lma 0x85c
    Loading section .data, size 0x6c lma 0x864
    Start address 0x4b8, load size 2256
    Transfer rate: 31 KB/sec, 451 bytes/write.
    Section .text, range 0x0 -- 0x85c: matched.
    Section .ARM.exidx, range 0x85c -- 0x864: matched.
    Section .data, range 0x864 -- 0x8d0: matched.
    Kill the program being debugged? (y or n) [answered Y; input not from terminal]
    ========================================================================================== [SUCCESS] Took 4.02 seconds ==========================================================================================
    

    When I try to download a sample sketch (pulse counter, mysensors library sample), I get compilation errors.

    Log:

    Compiling .pio\build\nrf52_dk\lib45d\Time_ID44\DateStrings.cpp.o
    In file included from src\main.cpp:2:0:
    .pio\libdeps\nrf52_dk\MySensors/MySensors.h:426:2: error: #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.
     #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.
      ^~~~~
    In file included from C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/Arduino.h:17:0,
                     from C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp:12:
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp: In function 'char* monthStr(uint8_t)':
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:105:49: error: 'const void*' is not a pointer-to-object type
     #define pgm_read_ptr(addr) (*(const void *)(addr))
                                                     ^
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:63:45: note: in definition of macro 'strcpy_P'
     #define strcpy_P(dest, src) strcpy((dest), (src))
                                                 ^~~
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp:72:29: note: in expansion of macro 'pgm_read_ptr'
         strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(monthNames_P[month])));
                                 ^~~~~~~~~~~~
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp: In function 'char* dayStr(uint8_t)':
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:105:49: error: 'const void*' is not a pointer-to-object type
     #define pgm_read_ptr(addr) (*(const void *)(addr))
                                                     ^
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:63:45: note: in definition of macro 'strcpy_P'
     #define strcpy_P(dest, src) strcpy((dest), (src))
                                                 ^~~
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp:86:28: note: in expansion of macro 'pgm_read_ptr'
        strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(dayNames_P[day])));
                                ^~~~~~~~~~~~
    *** [.pio\build\nrf52_dk\lib45d\Time_ID44\DateStrings.cpp.o] Error 1
    *** [.pio\build\nrf52_dk\src\main.cpp.o] Error 1
    

    Where can the problem come from?

    Thanks.

    Ikes


  • Mod

    Welcome to the forum @Ikes-72000

    No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.

    This message means that the sketch is configured as a node (not a gateway), but no transport is selected. Without a transport, a MySensors node can't do much.

    If you just want to try the most basic nrf5, add

    #define MY_GATEWAY_SERIAL
    

    to the sketch, before including MySensors.h.



  • I just tried this code and compilation fail.

    #define MY_GATEWAY_SERIAL
    #include <MySensors.h>
    
    void setup() {
      // put your setup code here, to run once:
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
    }
    

    Log:

    Processing nrf52_dk (platform: nordicnrf52; board: nrf52_dk; framework: arduino)
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nrf52_dk.html
    PLATFORM: Nordic nRF52 4.4.0 > Nordic nRF52-DK
    HARDWARE: NRF52832 64MHz, 64KB RAM, 512KB Flash
    DEBUG: Current (jlink) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
    PACKAGES:
     - framework-arduinonordicnrf5 1.600.190830 (6.0)
     - tool-sreccat 1.164.0 (1.64) 
     - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    LibraryManager: Installing id=548
    Using cache: C:\Users\Ikes\.platformio\.cache\08\6b3d0755f5ced94725e5025051350d08
    MySensors @ 2.3.2 has been successfully installed!
    Found 37 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <MySensors> 2.3.2
    |   |-- <Time> 1.6
    |   |-- <SPI> 1.0
    |   |-- <Wire> 1.0
    Building in release mode
    Compiling .pio\build\nrf52_dk\src\main.cpp.o
    Compiling .pio\build\nrf52_dk\lib45d\Time_ID44\DateStrings.cpp.o
    Compiling .pio\build\nrf52_dk\FrameworkArduino\Stream.cpp.o
    Compiling .pio\build\nrf52_dk\FrameworkArduino\Uart.cpp.o
    In file included from C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/Arduino.h:17:0,
                     from C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp:12:
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp: In function 'char* monthStr(uint8_t)':
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:105:49: error: 'const void*' is not a pointer-to-object type
     #define pgm_read_ptr(addr) (*(const void *)(addr))
                                                     ^
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:63:45: note: in definition of macro 'strcpy_P'
     #define strcpy_P(dest, src) strcpy((dest), (src))
                                                 ^~~
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp:72:29: note: in expansion of macro 'pgm_read_ptr'
         strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(monthNames_P[month])));
                                 ^~~~~~~~~~~~
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp: In function 'char* dayStr(uint8_t)':
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:105:49: error: 'const void*' is not a pointer-to-object type
     #define pgm_read_ptr(addr) (*(const void *)(addr))
                                                     ^
    C:\users\ikes\.platformio\packages\framework-arduinonordicnrf5\cores\nRF5/avr/pgmspace.h:63:45: note: in definition of macro 'strcpy_P'
     #define strcpy_P(dest, src) strcpy((dest), (src))
                                                 ^~~
    C:\users\ikes\.platformio\lib\Time_ID44\DateStrings.cpp:86:28: note: in expansion of macro 'pgm_read_ptr'
        strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(dayNames_P[day])));
                                ^~~~~~~~~~~~
    In file included from .pio\libdeps\nrf52_dk\MySensors/MySensors.h:74:0,
                     from src\main.cpp:7:
    .pio\libdeps\nrf52_dk\MySensors/hal/architecture/NRF5/MyHwNRF5.cpp: In function 'uint16_t hwCPUVoltage()':
    .pio\libdeps\nrf52_dk\MySensors/hal/architecture/NRF5/MyHwNRF5.cpp:506:16: warning: 'sample' is used uninitialized in this function [-Wuninitialized]
      return (sample*3600)/255;
             ~~~~~~~^~~~~~
    *** [.pio\build\nrf52_dk\lib45d\Time_ID44\DateStrings.cpp.o] Error 1
    =========================================================================================== [FAILED] Took 5.57 seconds ===========================================================================================
    


  • @Ikes-72000 said in Compilation error nrf52_dk plateformio:

    Scanning dependencies...
    Dependency Graph
    |-- <MySensors> 2.3.2
    | |-- <Time> 1.6
    | |-- <SPI> 1.0
    | |-- <Wire> 1.0

    Why does it list this Time library as a dependency? This shouldn't be here. Did you, at some point, include it in lib_deps? Because your current issue seems to be related to this lib, not MySensors. Without it, it should compile just fine.

    Processing nrf52_dk (platform: nordicnrf52; board: nrf52_dk; framework: arduino)
    -----------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nrf52_dk.html
    PLATFORM: Nordic nRF52 4.4.0 > Nordic nRF52-DK
    HARDWARE: NRF52832 64MHz, 64KB RAM, 512KB Flash
    DEBUG: Current (jlink) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
    PACKAGES:
     - framework-arduinonordicnrf5 1.600.190830 (6.0)
     - tool-sreccat 1.164.0 (1.64)
     - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 6 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <MySensors> 2.3.2
    |   |-- <Wire> 1.0
    |   |-- <SPI> 1.0
    Building in release mode
    Checking size .pio\build\nrf52_dk\firmware.elf
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM:   [          ]   2.1% (used 1352 bytes from 65536 bytes)
    Flash: [          ]   3.8% (used 19784 bytes from 524288 bytes)
    ============================== [SUCCESS] Took 1.51 seconds ==============================
    

    Try pio lib uninstall Time or remove it manually from the libdeps folder and rebuild the sketch.



  • @BearWithBeard, compilation works fine after remove time lib. Thanks.

    Now I can play with mysensors. 😃


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 3
  • 6
  • 3
  • 1

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts