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

debugging nRF51822.

Hello,

My project is on nrf51822 in which I am using BLE and UART interfaces.

There is single UART available on nRF51822 and I am using it for communication with an STM32. Now the problem is to debug the application.

Is there any solution to debug without UART.

I am working on nRF51822, SDK12 & S130 and I have a j-TAG.

Any Idea would be appreciated.

Thanks in advance.

Parents
  • Any good solution? Not really. You can use SWD for halt/step-in debugging until you use some time-critical operations such as any BLE link managed by Soft Device. You could also try to include some SW UART implementation (using simple GPIO routines and timers), it could be OK for some low throughput tracing because you don't need Rx just Tx for debug messages. But it might be interfering with standard APP/SD operation so you would need to be very careful where and how long messages you can put into your code. In cases like yours I usually use just simple GPIO indications and logical analyzer to read them. It gives you idea where in the code you are. You can use number of pulses and and length of LOW/HIGH parts to "spray" your code with dozens of markers (typical logical analyzer can operate in microsecond range so pulses don't need to take more than 0.1ms, typically much less). You can even signal some values by the timing and number of pulses (e.g. some simple integer values in reasonable ranges like 0-100).

    Edit

    SEGGER RTT missing in my previous answer and added by John is actually the best option!

Reply
  • Any good solution? Not really. You can use SWD for halt/step-in debugging until you use some time-critical operations such as any BLE link managed by Soft Device. You could also try to include some SW UART implementation (using simple GPIO routines and timers), it could be OK for some low throughput tracing because you don't need Rx just Tx for debug messages. But it might be interfering with standard APP/SD operation so you would need to be very careful where and how long messages you can put into your code. In cases like yours I usually use just simple GPIO indications and logical analyzer to read them. It gives you idea where in the code you are. You can use number of pulses and and length of LOW/HIGH parts to "spray" your code with dozens of markers (typical logical analyzer can operate in microsecond range so pulses don't need to take more than 0.1ms, typically much less). You can even signal some values by the timing and number of pulses (e.g. some simple integer values in reasonable ranges like 0-100).

    Edit

    SEGGER RTT missing in my previous answer and added by John is actually the best option!

Children
No Data
Related