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
  • Thanks for the response! When I drill in with the debugger, aa_uart_put() seems to function. Calls the fifo functions properly. Im not seeing any errors. It seems to get to the end of the code to put into the fifo and then doesnt return to the top level to continue executing the code in main(). This is similar behavior to printf(). My latest theory is that the SPI code is using the log functionality which is competing with the UART retarget code.

Reply
  • Thanks for the response! When I drill in with the debugger, aa_uart_put() seems to function. Calls the fifo functions properly. Im not seeing any errors. It seems to get to the end of the code to put into the fifo and then doesnt return to the top level to continue executing the code in main(). This is similar behavior to printf(). My latest theory is that the SPI code is using the log functionality which is competing with the UART retarget code.

Children
No Data
Related