Redirect printf to debugger console in S32DS for power architecture

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Redirect printf to debugger console in S32DS for power architecture

4,466 次查看
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 项奖励
回复
6 回复数

2,676 次查看
gajendrahattimare
Contributor I

 I am not able to see the newlib semihosting option over there, what i can enable ...?

 

0 项奖励
回复

2,664 次查看
jiri_kral
NXP Employee
NXP Employee

Hi,

what's your target device and S32DS version? 

0 项奖励
回复

2,661 次查看
gajendrahattimare
Contributor I

Target Device Cortex- M7 S32K344 and  3.4 S32DS version 

0 项奖励
回复

4,444 次查看
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 项奖励
回复

4,438 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

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

 

BR, 

Jiri 

0 项奖励
回复

4,455 次查看
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 项奖励
回复