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

nrf52832 combining SPI and UART printf problem

Hi all,

I took the example SPI program and I am trying to add UART code to it to debug the SPI transfers. Both examples are working well for me separately. I was able to combine both sets of code (main.c looks good and sdk_config.h looks good) and add all the Libraries and drivers. It is able to compile and run.

In the process of integrating the two examples, I was manually adding the UART code to the SPI code. With everything combined, I run the normal SPI code and it blinks the LED every 200ms (as it should). Verified everything is generally working.

Next, I add a printf statement like the UART code to verify that any old printf will work. This command seems to block all code after it. When I drill in with the debugger, it seems like no errors are being thrown.

Two questions:

  • why wont printf statements work?
  • is there a smarter way to print out debug information in the framework of the SPI code? I read about RTT.
Parents
  • I did add that to the sdk_config.h (using 13.x alpha). We were able to get UART and SPI working at the same time but there definitely is something strange going on with the logging and the UART. Things we do to get it working are:

    • remove NRF_LOG_INFO steps from the code
    • It never works the first time we run the code, but when you unplug and plug the dev kit and open and close the COM window (I use Putty), there is a combination that allows it to start working.

    As you can tell I havent fully debugged but hopefully that helps someone else with the same issues. Thanks for the debug help!

Reply
  • I did add that to the sdk_config.h (using 13.x alpha). We were able to get UART and SPI working at the same time but there definitely is something strange going on with the logging and the UART. Things we do to get it working are:

    • remove NRF_LOG_INFO steps from the code
    • It never works the first time we run the code, but when you unplug and plug the dev kit and open and close the COM window (I use Putty), there is a combination that allows it to start working.

    As you can tell I havent fully debugged but hopefully that helps someone else with the same issues. Thanks for the debug help!

Children
No Data
Related