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

Serial port only works when debugging

Custom app running on a nRF52 devboard. Serial port runs when I use the debugger and continues after I exit the debugger, but does not run from a cold start.

using the Nordic UART FIFO code. NRF_LOG_USES_UART=1 and DEBUG are defined in the C preprocessor settings

flow control disabled

Any ideas? Thanks

  • Yes the examples work fine, it's definitely something I ( or actually the previous developer did, as it has never worked right )

  • FormerMember
    0 FormerMember

    When the chip is running in debug mode, the HFCLK (HF crystal) is constantly running, could the problem be related to the HFCLK?

  • Hello I have the same Problem. I use nRF52840, nRF5_SDK_15.0.0_a53641a, nrf5_SDK_for_Mesh_v2.0.1, Python3.5.2 64bit on linux mint 18 64bit. JLink_Linux_V633f_x86_64.

    In aci_uart.py I set :  def __init__(self, port, baudrate=115200, device_name=None, rtscts=False):

    In Debug-mode it works:

    Activating auto-logging. Current session state plus future input saved.
    Filename       : log/18-178-8-46_interactive_session.log
    Mode           : backup
    Output logging : False
    Raw input log  : False
    Timestamping   : False
    State          : active
    Python 3.5.2 (default, Nov 23 2017, 16:37:01)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

    In [1]: send(cmd.Echo("test"))

    In [2]: 2018-06-27 08:46:48,476 - INFO - ttyACM0: {event: DeviceEchoRsp, data: {'data': bytearray(b'test')}}

    But if i plug out plug-in the device i get :

    In [2]: 2018-06-27 08:49:12,153 - INFO - ttyACM0: cmd Echo, timeout waiting for event

    in examples/serial/include/sdk_config.h  there are a lot of definitions with UART what exactly should i set to 1, if this is the problem ?

    I'm new in this topic and my aim is to receive all the packets in the mesh and to send them to the host pc but first i whant to understand how to work with UART and this Board.

  • FormerMember
    0 FormerMember in reply to smart_life

    When I test ble_app_uart here, RTT works, and nRF_LOG has the following settings:

    The log is set to DEFERRED mode, and the LOG is processed in idle_state_handle(). idle_stat_handle_should look like the following for correct processing of the log (bug in ble_app_uart SDK15):

    static void idle_state_handle(void)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            nrf_pwr_mgmt_run();
        }
    }
    

Related