This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

app_ble_uart example not initializing BLE on nRF52DK PCA10040 SDKv16 and S132 soft device

Hi

I am trying to get the ble_app_uart to run on my nRF52DK with the nRF52832 on board. I am using SDK version 16 and SoftDevice version 132.

When compile and download the program, i do not see it advertising as it is not visible in the scanned device list on the nRF Connect app on my iPad.

Upon debugging, I find that during initialization in main(), the program seems to run into an error and goes to the app_error_weak() function and stays there.

The call stack shows that it arrived there from the following function - APP_ERROR_CHECK(err_code) after bsp_init() funct

<code>

static void buttons_leds_init(bool * p_erase_bonds)
{
    bsp_event_t startup_event;

    uint32_t err_code = bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, bsp_event_handler);
    APP_ERROR_CHECK(err_code);

    err_code = bsp_btn_ble_init(NULL, &startup_event);
    APP_ERROR_CHECK(err_code);

    *p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);
}
</code>

Since there were no logging calls in place in the code until this point, there was no information on the Debug terminal.  I will put in some logging calls to indicate the status of the execution and post it here soon.

PS: To confirm if the hardware is ok, I downloaded the LED_blinky example and it works fine - i am able to see the blinky device on the nRF LED_Blinky app on my iPad and communicate with it.

So it appears the problem is happening only with this example, which sounds strange. I haven't made any changes yet, just using the default example code. 

Regards

Sreenivasa Chary

  • Hi Sreenivasa, 

    When compile and download the program, i do not see it advertising as it is not visible in the scanned device list on the nRF Connect app on my iPad.

    Did you use the Segger ble_app_uart_pca10040_s132 project file? If not, did you flash the application image with s132_nrf52_7.0.1_softdevice.hex? Did you also Erase the kit board before loading the hex? If you use segger, you should be able to see the log in the Debug Terminal window of Segger. If you still have the issue, I would suggest you download SDK16 again.

    -Amanda H.

  • Hello Amanda

    I use the Segger SES example and when I download the application, the output log shows me the following:

    Connecting ‘J-Link’ using ‘USB’
    Connecting to target using SWD
    Loaded C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.30c/bin/JLink_x64.dll
    Firmware Version: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 21 2020 17:30:48
    DLL Version: 6.54c
    Hardware Version: V1.00
    Target Voltage: 3.300
    Device "NRF52832_XXAA" selected.
    InitTarget() start
    InitTarget() end
    Found SW-DP with ID 0x2BA01477
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x02880000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    Preparing target for download
    Executing Reset script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘s132_nrf52_7.0.1_softdevice.hex’ to J-Link
    Programming 2.7 KB of addresses 00000000 — 00000aff
    Programming 146.1 KB of addresses 00001000 — 000258bf
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful
    Downloading ‘ble_app_uart_pca10040_s132.elf’ to J-Link
    Programming 62.1 KB of addresses 00026000 — 0003587f
    Programming 0.1 KB of addresses 00035880 — 0003591f
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful

    Regards

    Sreenivasa Chary

    s132_nrf52_7.0.1_softdevice.hex
  • I also erased the kit and reloaded the software - both the soft device and the app, but still the same issue is seen.

  • Hi Sreenivasa, 

    After loading images, did you press   again to run? What is the log you see in the Debug Terminal window? Did you see LED1 blinking  (BSP_INDICATE_CONNECTED)? If not, Could you flash the image with nRF Connect Programmer or Command Line Tools with the following commands:

    nrfjprog --family NRF52 --program s132_nrf52_7.0.1_softdevice.hex --chiperase --verify
    C:\Users\amhs\Downloads\nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart\hex
    nrfjprog --family NRF52 --program ble_app_uart_pca10040_s132.hex --sectorerase --verify
    nrfjprog -r

    Did you see LED1 blinking (BSP_INDICATE_CONNECTED)?

    -Amanda H.

  • Yes Amanda, I did press the Play button to start the target running, but as i mentioned, there are no NRF_LOG() statements in the code prior to the hanging point. So the debug terminal was empty. I will try to program as you said , from the nrfConnect tool and check again, will revert to you asap......

    REgards

    Chary BS

Related