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

BLE_APP_UART_PCA10010 change doesn´t work

Hi,

I´m trying to change the "BLE_APP_UART_PCA10010" example, main.c file.

I would like to delete following functions, because I don´t need UART in my project:

void uart_event_handle()

static void uart_init(void)

But when I comment out "uart_init();" in main function and flash this to nRF52833, it doesn´t work. The BLE device can´t be found by nRF connect app. I can´t find any relation between this UART functionality and the BLE stack.

Can you give me more information, whats gonna be wrong?

Thanks in advance

Simon

  • Hi,

    I see. If you don't need logging, then that is OK. But you need a way to easily check which function failed. Even without logging and just using the debugger you can get good help from the error handling in the SDK. If you use debug builds and break after an error has happened, you can inspect the error handler with a debugger to see the file name, line number and error code of the issue as described here. Also, note that when using a SoftDevice and scanning/advertising/in a connection, you cannot continue after a breakpoint, but need to move the breakpoint and reset, since the SoftDevice will assert if it loses timing.

  • Hi,

    That is odd. It could be that the error causes problems since the example use deferred logging. You could try to disable deferred logging by setting NRF_LOG_DEFERRED to 0 in sdk_config.h and commenting out the call to NRF_LOG_PROCESS() in main.c.

    You could also take advantage of the error handling in the SDK without using logging but inspecting the error handler with a debugger as suggested in this post, but it is more tedious.

  • That is odd. It could be that the error causes problems since the example use deferred logging. You could try to disable deferred logging by setting NRF_LOG_DEFERRED to 0 in sdk_config.h and commenting out the call to NRF_LOG_PROCESS() in main.c.

    Now, after doing this, I got a message to the debug terminal as shown in screenshot attached.

    I did the following steps:

    1. Build and debug button

    2. Go to debug terminal window (no entries)

    3. Press the play button

    I think that is not the result we would like to see. Or where can I see the errors in it?

  • Hi,

    simon1516 said:
    I think that is not the result we would like to see. Or where can I see the errors in it?

    No, there is something odd here. First of all, I would have expected to see an error log message if an error actually occurred. And I would also have expected to see "Debug logging for UART over RTT started." printed. At least with deferred logging, that should be printed, unless the error happens earlier and prevents the log to be output. In that case, you should be able to see something useful by breaking the execution, though. I.e. you should be able to see what state the system is in, what code is being executed (where the program counter points), etc.

  • Okay...so how can we react? I think the logging and debugging is an important functionallity, we can´t dispense in the futured development. How can we solve this? Do you have any ideas?

Related