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

  • Hello Torbjorn,

    Just an update: When I am in debug mode, the issue of nrf_sdh_enable_request failing seems to go away and the RESET button still doesn't help in normal run mode.

    Also now the ArduCAM SPI bus check keeps failing:

    while(1){
    //Check if the ArduCAM SPI bus is OK
    arducam_write_reg(ARDUCHIP_TEST1, 0x55);
    temp = arducam_read_reg(ARDUCHIP_TEST1);
    if (temp != 0x55){
    //Serial.println(F("ACK CMD SPI interface Error! END"));
    nrf_delay_ms(1000);
    continue;
    }else{
    //Serial.println(F("ACK CMD SPI interface OK. END"));break;
    }
    }

    It never returns 0x55. Can it be that both these issues are linked? Maybe something is going on with the SoftDevice. I am using S132 V7.0.1 as recommended by you.

    Please advise.

    Thanks,

    Adnan

  • Hi Adnan

    What does the read_reg function return then? 
    Could you check the value of the temp variable in the debugger?

    Are you sure that the Arducam is properly connected to the DK?
    Maybe you could share a picture of your setup?

    Best regards
    Torbjørn

  • Hello Torbjorn,

    The read_reg returns random values (between 0x00 - 0x67) and sometimes 0x55 and if it does, the software hangs on twim_busy in the function:

    //I2C Write 16bit address, 8bit data
    uint8_t arducam_wrSensorReg16_8(int regID, int regDat)
    {
    uint8_t txBuf[3] = {regID >> 8, regID & 0x00FF, regDat & 0x00FF};
    arducam_twi_tx_rx(txBuf, 3, 0, 0);
    while(twim_busy);
    nrf_delay_ms(1);
    return (1);
    }

    The Arducam is connected properly to the DK, I have checked it multiple times. I have connected it as follows:

    pinScl = 27;
    pinSda = 26;
    pinSck = 25;
    pinMiso = 24;
    pinMosi = 23;
    pinCsn = 22;

    pinVCC = 5V

    pinGND = GND

    Please advise.

    Thanks,

    Adnan

  • Hi Adnan

    What if you connect the VCC line to VDD on the DK (3V) rather than the 5V line? 

    Looking at the pictures here this is what we have used in the past. 

    Best regards
    Torbjørn

  • Hello Torbjorn,

    The OV5642 5MP Mini Plus requires Power supply: 3.3V~5V

    I did try switching to VDD (3V) on the DK but still no luck.

    I still think its something with the SPIM and TWIM drivers.

    I was using the Zephyr code base on this same board before, can that have something to do with this?

    Does the Build and Run option on Segger completely remove the Zephyr code base?

    Please advise.

    Thanks,

    Adnan

Related