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

Program stuck inside log_init

Hi,

I am developing my own PCB board and application based on a nrf52832 module (MDBT42Q). To test the board, I tried downloading an example program onto the module, in this case, I use the ble_app_uart example. I am using a nrf52 Dk to download the program to the module.  I have external 32K crystal and 12pF capacitors connected to the module, and also a 10uH and 15nH inductor in series with a 1uF to ground (DC-DC mode).

The program compiles and downloads successfully, but its stuck at the log_init function when I try to debug. When I pause the debugger, it get stucked inside the function static void log_skip(void) and at the line "rd_idx       += (p_header->base.pushed.len + p_header->base.pushed.offset);"

I have no idea what is wrong.  Downloading the same program into the NRF52 DK  itself gives no problems and it doesn't hang.

I noticed that I do not have a 10K pull up resistor on the RESET pin. Now the reset pin is just floating. Could that be the cause?

Anyone can help?

Thanks in advance!

Update: 10/4

I tried uploading other programs and some of them works. For example, ble_app_alert_notification, ble_beacon, ble_blinky, ble_app_template, ble_app_hrs works! Just not the ble_app_uart example which I need.

Parents Reply Children
  • Hi Jorgen,

    I am using SDK_14.2.0. I just did a clean install of the SDK so the examples are unmodified. I have soft device S132 loaded onto the module.

    I had never had any problems downloading programs to an external nrf52832 in the past when I designed my own PCBs. But this is the first time I am using a module. I am very sure my connection are correct. I have VDD, VTG, SWDIO, SWDCLK on P20 connected to my module's VCC, SWDIO, SWDCLK. And I have the GND pin on the NRF52 DK connected to the GND of my module.

    With the ble_app_uart example, it stucked inside this while loop of the log_skip function:

        // Skip any string that is pushed to the circular buffer.
        while (p_header->base.generic.type == HEADER_TYPE_PUSHED)
        {
            rd_idx       += PUSHED_HEADER_SIZE;
            rd_idx       += (p_header->base.pushed.len + p_header->base.pushed.offset);
            p_header = (nrf_log_header_t *)&m_log_data.buffer[rd_idx & mask];
        }

    I tried to remove the log_init and commented out the call to NRF_LOG_INFO in the main function. Then I also uncheck "NRF_LOG_BACKEND_RTT_ENABLED" and "NRF_LOG_ENABLED" in sdk_config;h.

    With logging disabled, I go into a NRF_BREAKPOINT_COND in app_error_weak.c

    I tired with another (same) spare module and its giving the same problem.

    Interestingly a few examples like ble_app_blinky and ble_app_beacon works! But not the ble_app_uart which I need!

  • Could you check if there is any error codes returned when you end up in NRF_BREAKPOINT_COND/app_error_weak.c, as described in this post?

  • Hi Jorgen,

    The error code is 0x00004001

    If I comment out uart_init, the program actually manages to debug and run. I can scan and see it advertising from nrf connect app..

    Now I am sure uart_init is causing the problem. But why?

Related