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
  • Hi Adnan

    I would recommend using Segger Embedded Studio if you can. This has been the main development platform for Nordic products for a while, and is the one I used when writing the image transfer demo example. 

    That being said I think your issue is caused by using the wrong compiler. 

    If you open Options for Target nrf52832_xxaa in Keil uVision and go to the Target tab you can select which compiler to use. In my case I can get it to build if I select "Use default compiler version 5" or "V5.06 update 6 (build 750)":

    Please note that your list might look different, depending on which compilers you have installed. 

    After selecting the right compiler I get a different issue related to the nrf_erratas.h file, but this apparently is a known issue. The issue is described in more detail in the below case:
    https://devzone.nordicsemi.com/f/nordic-q-a/53946/rte-device-nrf52832_xxaa-system_nrf52-c-29-error-5-cannot-open-source-input-file-nrf_erratas-h-no-such-file-or-directory

    Best regards
    Torbjørn

  • Hello Torbjorn,

    Thank you for the quick response. I was wondering if also the nRF5 SDK + Softdevice versions maybe causing an issue? I can change it to the older nRF5SDK153059ac345 and s132nrf52611 Softdevice.

    Please advise. 

    Thanks,

    Adnan

  • Hi Adnan

    The required SDK and SoftDevice version is included in the readme of the repo. It should be SDK v16.0.0 and v7.x.x of the SoftDevice. 

    It might work with a later SDK version, but I doubt it will work with SDK v15.3.0. 

    Best regards
    Torbjørn

  • Hi Torbjorn,

    Understood. Thank you for the clarification.

    Thanks,

    Adnan

  • Hello Torbjorn,

    Sorry I forgot to ask which which nRF_DeviceFamilyPack version from Keil Packs Selector should I be using for this project? There are quite a few of them. Please advise.

    Thanks,

    Adnan

Reply
  • Hello Torbjorn,

    Sorry I forgot to ask which which nRF_DeviceFamilyPack version from Keil Packs Selector should I be using for this project? There are quite a few of them. Please advise.

    Thanks,

    Adnan

Children
  • Its OK.  I think I figured it out. Thanks!

  • Sounds good, I will consider the case resolved then Slight smile

  • 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