MCUXpresso SDK sprintf function

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

MCUXpresso SDK sprintf function

ソリューションへジャンプ
1,803件の閲覧回数
kk7xo
Contributor III

I'm using the SDK for the LPCXpresso845MAX board  I would like to use sprintf() but I see that it is not included in the SDK.  I see that in your devices/LPC845/utilities/debug_console_lite directory you have a files named fsl_debug_console.c/h.  I like using this driver because it provides a printf() function I can use with my UART. 

However, I notice that you declare DbgConsole_PrintfFormattedData() (line 605 in my copy) as static, which means I cannot access it from outside the file.  This is unfortunate because I could easily use that function to create a sprintf() by passing in a pointer to a function that writes to a character string.

Since I cannot do that and I do not want to alter my copy of the SDK, I am forced to include the libnano version of sprintf(), which drags in a bunch of unwanted library functions such as malloc() and free() that compete with my own versions.

I would ask that you make DbgConsole_PrintfFormattedData() non-static in future versions of the SDK so we can access its functionality from our code without modifying the SDK files themselves.

Regards,

Albert

0 件の賞賛
返信
1 解決策
1,797件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Albert,

Thanks for your sharing.

Just kindly reminder, you can create PRINTF by Config Tool:

Alice_Yang_0-1647504731268.png

BR

Alice

 

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,791件の閲覧回数
kk7xo
Contributor III

Yes I realize I can get printf.  It's sprintf that I'm looking for. 

I don't want to edit my copy of fsl_debug_console.c/h to make the necessary function accessible externally, otherwise my changes will get overwritten whenever I update my copy of the SDK.

0 件の賞賛
返信
1,784件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

OK, I know your meaning, and will submit request to SDK team, thanks for your suggestion.

 

BR

Alice

0 件の賞賛
返信
1,798件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Albert,

Thanks for your sharing.

Just kindly reminder, you can create PRINTF by Config Tool:

Alice_Yang_0-1647504731268.png

BR

Alice

 

0 件の賞賛
返信