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

Running nRF52840 on custom board with the ble_app_uart

Hi All,

I built a custom board that mounts a nrf52840 chip and I followed the schematic N 5 of the datasheet.

I also have 2 evaluation boards nrf52840 EVB "PCA10056", with which I have tested the various applications in "nRF5_SDK_15.1.0_a8c0c4d" including the ble_app_uart.
I tested this application using "Segger Embedded studio for ARM 3.40" and it worked great.

I was able to send data via UART (coming from another board) to nrf52840 EVB_1, send them over BLE to the other nrf52840 EVB_2 and print the data on terminal.

At this point I would liked to test this application on the custom board using a "SEGGER J-Link Base" and through the Segger Embedded studio, I tried to program the custom board and the download was successful, in debug mode it seems running normally, but I can't see any advertising instead with the same app running on the nrf 52840 EVBoard I can see the Bluetooth "Nordic_UART".

The idea was to compare the behaviour of the 2 boards in debug mode and find the problem through some breakpoints.

The problem is that using the breakpoints the program goes to NRF_BREAKPOINT_COND; "both in the case of the evaluation and in the case of the custom board.

I state that from the original code of "nRF5_SDK_15.1.0_a8c0c4d" I only changed the clock in order to use the internal RC oscillator (in the schematic that I used to realize the custom I did not put the LF clock optional)

#ifndef NRF_SDH_CLOCK_LF_SRC
#define NRF_SDH_CLOCK_LF_SRC 0
#endif

#ifndef NRF_SDH_CLOCK_LF_RC_CTIV
#define NRF_SDH_CLOCK_LF_RC_CTIV 16
#endif

#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
#endif

#ifndef NRF_SDH_CLOCK_LF_ACCURACY
#define NRF_SDH_CLOCK_LF_ACCURACY 1
#endif

in sdk_config.h.

Is there anybody who could help me?

Thanks

Parents
  • Hi,

    You cannot debug applications using breakpoints and stepping when you are using a softdevice. Hitting a breakpoint will halt the CPU and prevent the softdevice from handling timing critical events. You can set breakpoints in the code to see if the application runs to this point, but you cannot continue running from this point. Single stepping can be done until you meet a softdevice call, then the application will jump to the error handler and hit the NRF_BREAKPOINT_COND.

    I recommend that you have a look at this post and this video, showing how to debug the application and read out any error codes that occur.

    Best regards,
    Jørgen

  • Hi Jørgen,

    I did what you said and I can't see any errors, the code in the custom board run like the code in the Evaluation Board.

    I mean both program arrive in the main loop:

    // Enter main loop.
    for (;;)
    {
      idle_state_handle();
    }

    And I cannot see any error following the video that you sent in the app_error.c. Is it possible there is a mistake also if I got all these things?

    If you could confirm that if I run the application ble_app_uart in nRF5_SDK_15.1.0_a8c0c4d on a custom board mounting nrf52840 chip (in the configuration "SCHEMATIC N 5 of datasheet with no optional LF clock") doing the changes for RC oscillator and commenting the button_led_init

    // buttons_leds_init(&erase_bonds);

    using SEGGER J-Link Base as a probe it should works, maybe I have some hardware problem.

    Many thanks for your time.

Reply
  • Hi Jørgen,

    I did what you said and I can't see any errors, the code in the custom board run like the code in the Evaluation Board.

    I mean both program arrive in the main loop:

    // Enter main loop.
    for (;;)
    {
      idle_state_handle();
    }

    And I cannot see any error following the video that you sent in the app_error.c. Is it possible there is a mistake also if I got all these things?

    If you could confirm that if I run the application ble_app_uart in nRF5_SDK_15.1.0_a8c0c4d on a custom board mounting nrf52840 chip (in the configuration "SCHEMATIC N 5 of datasheet with no optional LF clock") doing the changes for RC oscillator and commenting the button_led_init

    // buttons_leds_init(&erase_bonds);

    using SEGGER J-Link Base as a probe it should works, maybe I have some hardware problem.

    Many thanks for your time.

Children
No Data
Related