Keil uVision V5 Legacy Nordic Project Compile Errors

Hello,

I am trying to compile a legacy Nordic Project for evaluation purposes and I am getting some compile errors. The details are as follows:

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

Keil: uVision V5.38.0.0 MDK-Lite

ARM Compiler: V5.06 Update 6 (Build 750)

Nordic SDK: v16.0.0.

Nordic SoftDevice: S132 v7.0.1

Keil nRF_DeviceFamilyPack: 8.44.1

Other settings:

The compile errors I am getting as as follows:

linking...
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrf_drv_ppi_init (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_ppi_channel_alloc (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_ppi_channel_assign (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_ppi_channel_enable (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_saadc_buffer_convert (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_saadc_channel_init (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_saadc_init (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_saadc_sample_task_get (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_timer_enable (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_timer_extended_compare (referred from main.o).
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_timer_init (referred from main.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.

I removed the default ..\nRF5SDK160098a08e2\modules\nrfx\mdk folder from the C/C++ include table and replaced it with ..\Arm\Packs\NordicSemiconductor\nRF_DeviceFamilyPack\8.44.1\Device\Include folder

I noticed that in the apply_old_config.h file all of the drivers seem to be disabled even though in the sdk_config.h file, the necessary drivers are enabled.

I am sure I am doing something wrong in the file structures or some configurations.

Please advise.

Thanks,

Adnan

  • Hello Simon,

    So I checked and please note the following:

    1) The Additional Load File [0] does indeed point to the SoftDevice recommended for the project S132

    2) The preprocessor definitions are as follows:

    BOARD_PCA10040

    CONFIG_GPIO_AS_PINRESET

    FLOAT_ABI_HARD

    INITIALIZE_USER_SECTIONS

    NO_VTOR_CONFIG

    NRF52

    NRF52832_XXAA

    NRF52_PAN_74

    NRF_SD_BLE_API_VERSION=6

    S132

    SOFTDEVICE_PRESENT

    SWI_DISABLE0

    OV5642_MINI_5MP

    3) The RAM and Flash start values I took from the Keil settings and are as follows:

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x80000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x10000

    FLASH_START=0x26000

    FLASH_SIZE=0x5a000

    RAM_START=0x20004010

    RAM_SIZE=0xd568

    The Adjustment of RAM and Flash memory note doesn't have any values for S132 V7.0.1 so I am using the above values.

    After all that I am still getting the error:

    <info> app: Start Main. Initialize BLE components...
    <info> app: Timer Init: YES
    <info> app: Buttons LED Init: YES
    <info> app: ble_stack_init(void): ENTER
    <debug> nrf_sdh: State request: 0x00000000
    <debug> nrf_sdh: Notify observer 0x00035D08 => ready
    <debug> nrf_sdh: State change: 0x00000000
    <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at C:\Nordic\sdk\nRF5SDK160098a08e2\examples\nrf52-ble-image-transfer-demo-master_segger\main.c:464
    PC at: 0x0002789F

    I have tried doing a RESET on the DK board but with no luck.

    Please advise.

    Thanks,

    Adnan

  • Hi

    After another look, the INVALID_STATE from the nrf_sdh_enable_request(); function should only be triggered if the SoftDevice is already enabled somehow.

    ret_code_t nrf_sdh_enable_request(void)
    {
        ret_code_t ret_code;
    
        if (m_nrf_sdh_enabled)
        {
            return NRF_ERROR_INVALID_STATE;
        }

    This is usually due to the ble_stack_init() being called twice or when a bootloader has been used before the main application to do DFU over BLE, that has not disabled the SoftDevice after being done and just directly jumped into the main application. The RAM and Flash memory for specific releases can be found in the release notes downloadable here, but they are these should be correct for v7.0.1 as well. 

    Best regards,

    Simon

  • Hello Simon,

    The ble_stack_init() is only called once in the main function. The RAM and Flash memory values being used are:

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x80000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x10000

    FLASH_START=0x26000

    FLASH_SIZE=0x5a000

    RAM_START=0x20004010

    RAM_SIZE=0xd568

    This line: "when a bootloader has been used before the main application to do DFU over BLE, that has not disabled the SoftDevice after being done and just directly jumped into the main application." Is confusing I am not sure what you mean, also if this is the case how do I fix it?

    Lastly, this issue seems to disappear when I am in debug mode.

    Please advise.

    Thanks,

    Adnan

  • Hi

    Okay, can you upload your project here so we can take a look at it. There must be some changes made on your end that enables the SoftDevice twice at some reason. That should be the only reason for this INVALID_STATE error to trig when enabling the BLE stack. I'm assuming you don't have a bootloader as part of your project as you're not sure what I mean about it.

    Best regards,
    Simon

  • Hello Simon,

    Please see the attached project below.

    Thanks,

    Adnan

Related