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

How exactly does the printf to UART work?

Hello, I migrated codes that I believed to be relevant to the UART output to a new project, namely the uart_init function and others, and it worked in main.c, which is where I put the "uart_init" function.

However, it does not work elsewhere i.e. if I use the printf function, the whole program goes into hard fault handler. Also, when I try to "go to definition" printf, I get nothing.

Why is that?

Thank you for looking into the problem.

The code: http://textuploader.com/5nqxs

The problem is that I can get correct results as long as I use printf in the main.c not anywhere else, even by reference.

Parents
  • Im encountering a similar problem, 

    I ran a software with uart_init and print from main.c

    it worked on the NRF51_DK 

    but when I programmed  my own custome made hw with it , it failed after the 4th char , sending me to UART0_IRQHandler error interrupt. my custome hardware is NRF51822 (not NRF51422 like the NRF51_DK)

    did you have any luck understanding what causes the error ?

    Thanks

    Eran

Reply
  • Im encountering a similar problem, 

    I ran a software with uart_init and print from main.c

    it worked on the NRF51_DK 

    but when I programmed  my own custome made hw with it , it failed after the 4th char , sending me to UART0_IRQHandler error interrupt. my custome hardware is NRF51822 (not NRF51422 like the NRF51_DK)

    did you have any luck understanding what causes the error ?

    Thanks

    Eran

Children
Related