printf() cannot be retargeted on S32K344 EVB

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

printf() cannot be retargeted on S32K344 EVB

ソリューションへジャンプ
2,740件の閲覧回数
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 件の賞賛
返信
1 解決策
2,710件の閲覧回数
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.pngnamnguyenviet_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 件の賞賛
返信
2 返答(返信)
2,711件の閲覧回数
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.pngnamnguyenviet_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 件の賞賛
返信
2,703件の閲覧回数
jacst
Contributor II

@namnguyenviet Thank you so much for solving our problem.

タグ(1)
0 件の賞賛
返信