Getting compile errors for NRF_SDK15=1

Posted on
  • I've done a git pull to get 2v19. I'm seeing this on all NRF52840 boards that previously compiled OK (I'm guessing circa 2v16 or so)...

    targets/nrf5x/bluetooth.c: In function 'jsble_exec_pending':
    targets/nrf5x/bluetooth.c:445:9: error: 'BLEP_BONDING_STATUS' undeclared (first use in this function)
        case BLEP_BONDING_STATUS: {
             ^
    targets/nrf5x/bluetooth.c:445:9: note: each undeclared identifier is reported only once for each function it appears in
    targets/nrf5x/bluetooth.c:542:33: error: implicit declaration of function 'bleGetActiveBluetoothGattServer' [-Werror=implicit-function-declaration]
                 JsVar *gattServer = bleGetActiveBluetoothGattServer(centralI­dx);
                                     ^
    targets/nrf5x/bluetooth.c:542:33: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    targets/nrf5x/bluetooth.c: In function 'pm_evt_handler':
    targets/nrf5x/bluetooth.c:1735:31: error: 'BLEP_BONDING_STATUS' undeclared (first use in this function)
               jsble_queue_pending(BLEP_BONDING_STATUS,­ BLE_BOND_START);
                                   ^
    targets/nrf5x/bluetooth.c: In function 'services_init':
    targets/nrf5x/bluetooth.c:2449:17: error: 'ble_nus_init_t {aka struct <anonymous>}' has no member named mitmProtect'
             nus_init.mitmProtect = true;
                     ^
    targets/nrf5x/bluetooth.c: In function 'jsble_startBonding':
    targets/nrf5x/bluetooth.c:3223:23: error: 'BLEP_BONDING_STATUS' undeclared (first use in this function)
       jsble_queue_pending(BLEP_BONDING_STATUS,­ BLE_BOND_REQUEST); // report that we've requested bonding
                           ^
    targets/nrf5x/bluetooth.c: In function 'jsble_set_tx_power':
    targets/nrf5x/bluetooth.c:3383:9: error: 'm_central_conn_handles' undeclared (first use in this function)
         if (m_central_conn_handles[i] != BLE_CONN_HANDLE_INVALID)
    

    I can't find BLEP_BONDING_STATUS in any *.h file!

    I'm also getting a FLASH overrun error trying to compile BANGLEJS2:

    /usr/local/gcc-arm-none-eabi-5_4-2016q3/­bin/../lib/gcc/arm-none-eabi/5.4.1/../..­/../../arm-none-eabi/bin/ld: bin/bootloader_espruino_2v19.179_banglej­s2.elf section `.text' will not fit in region `FLASH'
    /usr/local/gcc-arm-none-eabi-5_4-2016q3/­bin/../lib/gcc/arm-none-eabi/5.4.1/../..­/../../arm-none-eabi/bin/ld: region FLASH overflowed with .data and user data
    /usr/local/gcc-arm-none-eabi-5_4-2016q3/­bin/../lib/gcc/arm-none-eabi/5.4.1/../..­/../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 1892 bytes
    collect2: error: ld returned 1 exit status
    make: *** [make/targets/ARM.make:3: bin/bootloader_espruino_2v19.179_banglej­s2.elf] Error 1
    In file included from targetlibs/nrf5x_15/modules/nrfx/mdk/nrf­_peripherals.h:63:0,
                     from targetlibs/nrf5x_15/modules/nrfx/drivers­/nrfx_common.h:49,
                     from targetlibs/nrf5x_15/modules/nrfx/nrfx.h:­45,
                     from targetlibs/nrf5x_15/modules/nrfx/hal/nrf­_gpio.h:44,
                     from targets/nrf5x_dfu/hardware.h:18,
                     from targets/nrf5x_dfu/lcd.c:15:
    
  • it is better to use the provision script with your board name
    . ./scripts/provision.sh boardname
    it will download and patch sdk15 and also add good compiler to the path, your gcc 5.4 is not the best choice

  • I just tried another build using BOARD=NRF52840DK and that works fine here - so as @fanoush says I'd definitely look at doing provision (you may have to delete all extra files in targetlibs/nrf5x_15 beforehand to get it to work them out again).

    I can't find BLEP_BONDING_STATUS in any *.h file!

    It's there:

    ./libs/bluetooth/bluetooth.h:  BLEP_BONDING_STATUS,              //< Bonding negotiation status (data is one of BLEBondingStatus)
    

    So I think likely when you did git pull maybe there was some merge error? I'm not sure what changes you have made yourself but I'd consider checking out fresh from the Espruino repo and then trying to re-apply your changes on top of what's there now

  • Just realised what this is - in whatever build you're doing you're compiling with the peer manager but with no central connections enabled. I'll try and sort the build out properly soon but the easy method would be to copy the lines from NRF52840DK that ensure you have central connections enabled

  • That makes sense, as I did start with the NRF52840DK board file and removed the central defines, but I just made a fresh clone, copied my board file as-is, and it built fine (after provisioning).

    That tree may indeed have some issues, good to start fresh.

    Thank you!
    jv

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Getting compile errors for NRF_SDK15=1

Posted by Avatar for yngv126399 @yngv126399

Actions