printf() cannot be retargeted on S32K344 EVB

cancel
Showing results for 
Search instead for 
Did you mean: 

printf() cannot be retargeted on S32K344 EVB

Jump to solution
283 Views
jacst
Contributor II

Hi,I used the MCAL demo that comes with the S32K344 EVB and configured the UART module. The EVB can send messages normally. I added printf(), but the program does not seem to be retargeted. I need help, thank you very much.

0 Kudos
1 Solution
253 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @jacst,

Sorry for late reply. Looks like there are three problems in your project:

1. The NEW_LIB library is linked to the old compiler (gcc_b1620, not gcc_9.2). I have to change the path as below:

namnguyenviet_0-1634635565067.png

2. In retarget.c, write function only has 1 underscore instead of 2 (_write instead of __write).

3. You need to implement Uart_SyncSend function in _write function instead of async, otherwise you will need to wait until the transmission is completed. 

I have attached the fixed project, after fix these things I can see printf function is retargeted.

Best Regards,

Nam

 

View solution in original post

0 Kudos
2 Replies
254 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @jacst,

Sorry for late reply. Looks like there are three problems in your project:

1. The NEW_LIB library is linked to the old compiler (gcc_b1620, not gcc_9.2). I have to change the path as below:

namnguyenviet_0-1634635565067.png

2. In retarget.c, write function only has 1 underscore instead of 2 (_write instead of __write).

3. You need to implement Uart_SyncSend function in _write function instead of async, otherwise you will need to wait until the transmission is completed. 

I have attached the fixed project, after fix these things I can see printf function is retargeted.

Best Regards,

Nam

 

0 Kudos
246 Views
jacst
Contributor II

@namnguyenviet Thank you so much for solving our problem.

Tags (1)
0 Kudos