Redirect printf to debugger console in S32DS for power architecture

cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect printf to debugger console in S32DS for power architecture

385 Views
Xtian
NXP Employee
NXP Employee

How to redirect printf to debugger console in S32DS for power architecture v2.1? 

Reading through some posts about this topic, I seem to understand that it would be sufficient  to simply use a C standard library that includes debugger console support for printf to be redirected. In my case the project where I want to add this functionality is the lwip example running on MPC5748G that is included in the SDK. 

This project by default is using the "newlib" library. So I  go to project settings--> C/C++ Build --> Settings --> Target Processor --> Libraries support  and select the closest alternative  "newlib  debugger console".

Are there any more steps? simply doing this is not redirecting my printf to a debugger console (looking at S32DS debugger console window does not show anything) 

Second question: Alternatively,  I also looked at this post about how to redirect printf to a LIN UART : How to use printf function in S32DS for Power Arch... - NXP Community

This works for a project using an EWL C  library, but does not work on a project using newlib .  Do you have suggestions on how to make this work on  a newlib project ? 

Thanks.

0 Kudos
3 Replies

363 Views
Xtian
NXP Employee
NXP Employee

Yes I have enabled  semihosting console on the debugger / Startup settings but  this is not working. When executing printf statement, the debugger window displays "Program received signal SIGINT, Interrupt" that routes execution towards an unimplemented interrupt that just loops around itself.  after investigation this is an IVOR 8 interrupt. 

 

BR.

0 Kudos

357 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

it is possible share your project? You may send it to my NXP email. 

 

BR, 

Jiri 

0 Kudos

374 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

 

did you enabled Semihosting console in Debug configurations? You may find helpful this thread - it is for ARM, but the principle is same: 
https://community.nxp.com/t5/S32K/printf-in-FreeRTOS/td-p/1180777

 

BR, 

Jiri 

0 Kudos