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


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

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'
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. 



  • Hello Torbjorn,

    Thank you for the info. So the OV2640 came in and after initial setup everything is working! I should have just gone with the OV2640 from the start lol

    I will proceed now with the OV2640 for the eval, prototype phase. We will upgrade to the new Mega with latest nRF Connect SDK for the production versions.

    I have one issue though, sometimes the images captured come out like this:


    Partially missing. Doesn't matter which resolution or Phy setting I use.

    Is there a way to fix this issue?

    Please advise. Thanks!


  • Hi Adnan

    Good to hear that you got the OV2640 module working more easily Slight smile

    It looks like there is some data corruption in the transfer, which is causing the JPG decoding on the phone side to fail. Typically with JPG images a single corrupt byte will cause the rest of the image to be unrecoverable. 

    Data corruption over BLE is close to impossible, so most likely something is happening on the SPI bus. 

    Which supply voltage are you running the module at? 

    Could you try to reduce the SPI clock frequency by changing line 325 in ArduCAM.c? 

    Try with NRF_SPIM_FREQ_1M first, and if that doesn't help try something even lower such as NRF_SPIM_FREQ_250K. 

    Best regards

  • Hello Torbjorn

    I am using the VDD (PIN )output for the sensor power so under 3V (~2.7V). 

    Having said that, do you think it might still be a good idea to close the SB10 solder bridge on the DK to bring the voltage up to 3.3V? We will providing our own power supply anyways.

    For the NRF_SPIM_FREQ, I tried using NRF_SPIM_FREQ_2M but that did not give me any images at all, any ideas why? Dropping it to NRF_SPIM_FREQ_1M does seem to be working much better, no corrupted images yet.

    Please advise,



  • Hi Adnan

    Do you have a lab power supply available? 
    If so you could just provide 3.3V on the external supply connector of the DK. 

    If everything works at 1M but not 4M it could be because the supply is insufficient. 

    Then again it is very common to have issues with high SPI frequencies when you are connecting a module via long wires from the DK. If you end up making a PCB with more direct connections then you should easily be able to support higher clock speeds. 

    Why nothing worked at 2M I don't really understand. Did you test this several times? 
    Some times a full power reset of the board is necessary to make everything work well. 

    Either way, I don't think there is much point investigating this until you find a way to provide 3.3V to the module. As it is now you are running it outside the specified operation range, which can cause various unpredictable issues. 

    Best regards