Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Serial port fails after softdevice_setup in RUN mode. Works in DEBUG. HFCLK?

ANT S212, nRF52:

I've read all the links in the forum regarding serial port running in debug mode and not in run mode.

In my case, it works in RUN mode until softdevice_setup() is called.

In other words: 

s_write("tst2\n\r");    // this prints in RUN
softdevice_setup();
s_write("tst3\n\r"); // this prints in DEBUG, does not in RUN.

Could this be a HFCLK issue? 

I have followed the serial_pca10040 settings but that is not accessing the softdevice functionality. 

My code is based upon the scan_and_forward application, which I had modified to use a 16 bit device id.

It steps through correctly under the debugger, so the fault may not be there.

My feeling is that the uart interrupt handler has a conflict with the scan_and_forward interrupts ?

Parents
  • Hi,

    If the code is running after softdevice_init function call, it does sound like this could be an issue with the HFCLK, as all clocks are run in Debug mode. However, it sounds strange that the clock should be running before initializing the softdevice, but not after. Have you tried calling sd_clock_hfclk_request after softdevice_init, to see if this solve the issue?

    Could you provide some more details on what is happening in the s_write function, and the UART/softdevice config?

    Best regards,
    Jørgen

Reply
  • Hi,

    If the code is running after softdevice_init function call, it does sound like this could be an issue with the HFCLK, as all clocks are run in Debug mode. However, it sounds strange that the clock should be running before initializing the softdevice, but not after. Have you tried calling sd_clock_hfclk_request after softdevice_init, to see if this solve the issue?

    Could you provide some more details on what is happening in the s_write function, and the UART/softdevice config?

    Best regards,
    Jørgen

Children
Related