UART_INIT causing no RTT LOG output

Custom board using BL654 (NRF52840)

SDK 17.1.0

SD140 7.2.0

I was able to run the ble_app_uart totally successfully (with RTT LOG output) until I tried to add uart capability. Now I get no output at all on RTT viewer (before I did), and when on the debugger, it crashes before the first function call in main saying unknown function at 0x00000A60. The uart is connected to a peripheral and is only supposed to fetch data for processing, not redirected to bluetooth or anything.

Parents Reply Children
  • Hi there,

    JGusler said:
    THe only message at all that I get is "Unknown function at 0x00000A60" which occurs right after I hit resume after the debugger pauses at main

    You can't resume a Softdevice application after halting the program. You need to restart the program after each time it hits a breakpoint or the core is halted. The Softdevice will hardfault due to internal timing if the program is resumed after it has been halted. See this thread for more.

    regards

    Jared 

  • Okay that is good to know. However I'm still seeing absolutely nothing now on J-Link RTT  Viewer when doing either debug or release build with maximum debug output. And this only happens as soon as I allow uart_init() to run (which is the first function call inside main)

  • Hi,

    What is NRF_LOG_BACKEND_RTT_ENABLED and NRF_LOG_BACKEND_UART_ENABLED set to in your sdk_config.h file?

    regards
    Jared
  • Okay so everything is working now. What I changed was to put the log_init() function (I'm using RTT not UART for logging) before anything else in main(which is not the default configuration and it should be). What was happening was a fatal error in the uart_init function. I had been using a buffer size NOT a power of two which I couldn't see because logging was initialized yet. Either way, I propose a change that for ANY example using log_init() that that call comes first in main before anything else.

  • Hi,

    Good that you found the issue. 

    JGusler said:
    I had been using a buffer size NOT a power of two which I couldn't see because logging was initialized yet. Either way, I propose a change that for ANY example using log_init() that that call comes first in main before anything else.

    Valid point, actually in most of our examples it's actually the case. Only case I found so far, where this is not the case is ble_app_uart?

    regards

    Jared 

Related