Trying to build nrf52-ble-image-transfer-demo project in Keil but getting build errors

Hello,

I am trying to the build the following demo from github on Keil:

https://github.com/NordicPlayground/nrf52-ble-image-transfer-demo

I am using Keil uVision V5 MDK-Lite with default compiler V6 along with nRF5SDK160098a08e2 and s132nrf52701 softdevice

I managed to get the softdevice, Nordic Packages, etc. setup properly (I think!)

I flashed (loaded) the s132_nrf52_7.0.1_softdevice.hex to the nRF52 DK nRF52832 eval boards

I get the following build errors:

Build started: Project: image_transfer_demo_pca10040_s132
*** Using Compiler 'V6.19', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
*** Warning: You are compiling one or more files of source type C++ and have selected 'use MicroLIB'. MicroLIB does not support C++!

Build target 'nrf52832_xxaa'
ArmClang: error: no such file or directory: '../../../../../../components/libraries/bsp/bsp.c'
ArmClang: error: no input files
compiling bsp.c...
ArmClang: error: no such file or directory: '../../../../../../components/libraries/bsp/bsp_btn_ble.c'
ArmClang: error: no input files
compiling bsp_btn_ble.c...
RTE/Device/nRF52832_xxAA/system_nrf52.c(30): error: 'nrf52_erratas.h' file not found
#include "nrf52_erratas.h"
^~~~~~~~~~~~~~~~~
1 error generated.
compiling system_nrf52.c...
C:/Nordic/sdk/nRF5SDK160098a08e2/components/libraries/util/app_error_handler_keil.c(45): error: expected '(' after 'asm'
__ASM void app_error_handler(ret_code_t error_code, uint32_t line_num, const uint8_t * p_file_name)
^
C:/Nordic/sdk/nRF5SDK160098a08e2/components/libraries/util/app_error_handler_keil.c(45): error: expected ';' after top-level asm block
__ASM void app_error_handler(ret_code_t error_code, uint32_t line_num, const uint8_t * p_file_name)
^
;
C:/Nordic/sdk/nRF5SDK160098a08e2/components/libraries/util/app_error_handler_keil.c(47): error: use of undeclared identifier 'PRESERVE8'
PRESERVE8 {TRUE}
^
3 errors generated.
compiling app_error_handler_keil.c...
".\_build\nrf52832_xxaa.axf" - 8 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01

For the 

ArmClang: error: no such file or directory: '../../../../../../components/libraries/bsp/bsp.c'
ArmClang: error: no input files
compiling bsp.c...
ArmClang: error: no such file or directory: '../../../../../../components/libraries/bsp/bsp_btn_ble.c'
ArmClang: error: no input files

errors: I did make sure the both C/C++ and ASM Include Paths point to the SDK I downloaded but I still get these errors.

Please advise. 

Thanks,

Adnan

Parents Reply Children
  • Hello Torbjorn,

    Hope all is well. I was wondering if you knew what nRF_DeviceFamilyPack version is required of the build? I am suing the latest one 8.44.1 but that is giving me odd:

    ".\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrf_drv_ppi_init (referred from main.o)." type errors. 

    There are a lot of versions to pick from so wanted to know if you knew the correct one.

    Please advise.

    Thanks,

    Adnan

  • Hi Adnan

    You should be able to use the latest device family pack, which is v8.52.0. 

    That said, there seems to be an issue when using later versions of Keil with the older SDK's. I couldn't get the sample to build until I followed the instructions shared in this case.

    Please give that a go and see if it fixes your issue. 

    If you still get the undefined symbol error, double check if the nrf_drv_ppi.c file is included in your project. 

    Best regards
    Torbjørn 

  • Hello Torbjorn,

    Thank you for the info. So the latest Device Family Pack I have access to via the Package manager is 8.44.1 (maybe because I an using MDK Lite?).

    I did actually follow the instructions given in case https://devzone.nordicsemi.com/f/nordic-q-a/55378/mdk-uvision-sdk-16-0-keil-family-pack-installation/224413#224413 but no luck.

    I still have the same errors as I gave yesterday. I can also confirm that file nrf_drv_ppi.c is included in my project. Can there an issue with the apply_old_config.h file?

    Please advise.

    Thanks,

    Adnan

  • Hi Adnan

    You can download all the device family packs from here:
    https://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/

    Could you try to install v8.52.0 and see if it works better?

    You need to double click the file after downloading it, and it will launch the installer. 

    Best regards
    Torbjørn

  • Hello Torbjorn,

    Thank you for the follow up. I took your advise and switched to Segger Embedded Studio over the weekend. I managed to get the project setup and had to modify the common include paths and paths in the .emProject file but now the project compiles and am able to download it onto the nRF52 DK eval board. So thank you for your guidance on this issue.

    The issue I am now having is that I get the following error on the J-Link RTT Viewer:

    00> <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at C:\Nordic\sdk\nRF5SDK160098a08e2\examples\nrf52-ble-image-transfer-demo-master_segger\main.c:463
    00> PC at: 0x0002786D
    00> <error> app: End of error report

    The line number points to the following function:

    /**@brief Function for the SoftDevice initialization.
    *
    * @details This function initializes the SoftDevice and the BLE event interrupt.
    */
    static void ble_stack_init(void)
    {
    ret_code_t err_code;

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    // Configure the BLE stack using the default settings.
    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&ram_start);
    APP_ERROR_CHECK(err_code);

    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
    }

    I am wondering if the SoftDevice needs to be configured as I have not done anything with respect to that? Or maybe I need to configure anything else?

    Please advise and thanks!

    Adnan

Related