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

BLE runs only while debugging on custom board (probably RTT issue)

I have problems with my custom board.

I developed the firmware with the nrf52840-PDK and there the firmware runs standalone (with RTT connected and without) or when debugged via eclipse.

Both boards (nrf52840-PDK and my custom board) have the nrf52840 QIAAAA and I'm working with Softdevice 140 and SDK 14.2.

If I run the firmware from my own custom board, everything seems to work when debugging via eclipse or when RTT is not connected. The advertising starts and the device can be found from e.g. nrf-connect and connected.

Usually I use RTT for debugging (on nrf52840-PDK) and everything works fine. The custom board is programmed via jlink from an external nrf52 DK.

If I connect via RTT to my custom board, the advertising does not work correctly. Without RTT, it works.

The power profile (with PPK) looks the same if connected with RTT and without, the advertising seems to have started but nrf-Connect can't receive advertising packets.

Could it be some timing/crystal issue? What are the differences when connected via RTT and when not?

I changed NRF_SDH_CLOCK_LF_SRC from NRF_CLOCK_LF_SRC_XTAL to NRF_CLOCK_LF_SRC_SYNTH and the behaviour is the same. So the 32khz crystal should not be the problem.

It seems to have something to do with the hardware as I can't see this behaviour on the nrf52840-PDK.

21.03.18 Updated LF test, updated to clarify the problem. There was another connection problem but it seems they are different issues (see https://devzone.nordicsemi.com/f/nordic-q-a/32590/error-133-0x85-gatt-error-with-htc-u11-life)

Parents
  • Hi,

    Could you try to enable the HF crystal after startup just to see if it makes any difference? The HF crystal is always "on" in debug interface mode. Although it does not explain why it works when RTT is disabled.

    int main()

    {

        NRF_CLOCK->TASKS_START  = 1;

        while ( NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

        //app initalization

     Do you have any IOs,etc on the custom board that could be used to indicate if the program goes in a reset loop? 

     

     

  • I had to use the following code snippet

        NRF_CLOCK->TASKS_HFCLKSTART  = 1;
        while ( NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

    In some test apps I had issues to start and with this code, it seems to start. Does this mean there is an issue with the HF crystal?

    Unfortunately it does not help with the rtt problem, as you already mentioned.

    I can connect only when RTT is not used,

  • Sorry, meant to say NRF_CLOCK->TASKS_HFCLKSTART. 

    "I can connect only when RTT is not used"

    Just so I understand this correctly, when not used, does that mean that you have disabled RTT logging in the code, or that you are not connecting the debugger and viewing the logs? 

    I have not managed to reproduce this issue here. Please try with the hex file below on your board to see if you get the same result (RTT is enabled in code):

    hrs_w_s140.hex 

     

Reply Children
Related