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

Error in ble_app_uart when programming to custom board from nRF52DK

Hello,

I'm trying to program the ble_app_uart example program from SDK 17.0.2 in Segger Embedded Studio using softdevice 132 to a custom PCB (with the nRF52832 chip) using this setup on the chip and nRF52DK:

I'm using a GND pin from the DK go ground both the GND detect as well as the custom PCB.  I'm using the VDD and VTG pins to connect the VDD pin on my custom board.  The other two pins on my board are connected to SWDIO and SWDCLK as above.  I tested the ble_app_uart program to build to the chip on the DK which works fine, but when I try to program to the custom PCB with the above setup I noticed it crashing in debug mode.  

The program breaks immediately upon stepping into the ble_stack_init() function.  In the call stack I can see that the functions uart_event_handler, app_error_handler_bare and finally app_error_fault handler are called before reaching NRF_BREAKPOINT_COND.  This series of functions made me think that uart_event_handler sent an error to app_error_handler_bare and finally to app_error_fault_handler which caused the program to stop.  I wanted to figure out what this error was but wasn't sure how to figure out the error or exactly where it came from.  Any help in figuring this out would be greatly appreciated!  Thanks!

  • Hi

    Jing might be onto something here. Alternatively, it could be that you're trying to add breakpoints while the SoftDevice is running, an error like this would occur as well, as the SoftDevice won't react well to being interrupted, as it handles a lot of timing-critical operations like the radio and timers to stay in BLE spec.

    Best regards,

    Simon

  • This was the cause of the error.  I ended up getting ERROR 4 [NRF_ERROR_NO_MEM] in debug mode.  To pull up the rx line I went to:

    /nrf52_sdk/modules/nrfx/drivers/src/nrfx_uarte.c

    and changed the code as follows:

    static void apply_config(nrfx_uarte_t        const * p_instance,
                             nrfx_uarte_config_t const * p_config)
    {
        if (p_config->pseltxd != NRF_UARTE_PSEL_DISCONNECTED)
        {
            nrf_gpio_pin_set(p_config->pseltxd);
            nrf_gpio_cfg_output(p_config->pseltxd);
        }
        if (p_config->pselrxd != NRF_UARTE_PSEL_DISCONNECTED)
        {
            //nrf_gpio_cfg_input(p_config->pselrxd, NRF_GPIO_PIN_NOPULL);
            nrf_gpio_cfg_input(p_config->pselrxd, NRF_GPIO_PIN_PULLUP);
        }
    
        nrf_uarte_baudrate_set(p_instance->p_reg, p_config->baudrate);
        nrf_uarte_configure(p_instance->p_reg, p_config->parity, p_config->hwfc);
        nrf_uarte_txrx_pins_set(p_instance->p_reg, p_config->pseltxd, p_config->pselrxd);
        if (p_config->hwfc == NRF_UARTE_HWFC_ENABLED)
        {
            if (p_config->pselcts != NRF_UARTE_PSEL_DISCONNECTED)
            {
                nrf_gpio_cfg_input(p_config->pselcts, NRF_GPIO_PIN_NOPULL);
            }
            if (p_config->pselrts != NRF_UARTE_PSEL_DISCONNECTED)
            {
                nrf_gpio_pin_set(p_config->pselrts);
                nrf_gpio_cfg_output(p_config->pselrts);
            }
            nrf_uarte_hwfc_pins_set(p_instance->p_reg, p_config->pselrts, p_config->pselcts);
        }
    }

    Which was commenting out line 11 and adding line 12.  Thanks for the help.

  • I've tried running in debug mode without breakpoints and I'm able to receive RTT and get.

    <info> app_timer: RTC: initialized.
    <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at ..\main.c:510
    PC at: 0x0002F829
    <error> app: End of error report

    How can I check where this ERROR 4 is being generated?

Related