printf compiles into something bizarre

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

printf compiles into something bizarre

ソリューションへジャンプ
558件の閲覧回数
seandonohue
Contributor II

I'm trying to add printf functionality on LINFlex_1 on an MPC5675K. I have written the stub functions InitializeUART, ReadUARTN, and WriteUARTN, but these are never called. No warnings or errors either. When I look at what is compiled from the EWL C library, it makes no sense to me. This is the program flow after calling printf("rbInit"):

 

printformat.c

line 114     __pformatter

line 95     {

line 113     va_start

line 114      __pformatter

line 113     va_start

line 114     __pformatter

line 113     va_start

line 114     __pformatter

line 1906     {

 

runtime.c

__create_frame_and_save_gpr_21

 

printformat.c

line 2138     num_chars = ...

line 1932      chars_written = 0

line 2377     *buff_ptr = '%'

line 1934     while(*format_ptr) {

line 2479     return (chars_written)

 

runtime.c

__restore_gpr_21_exit

 

And finally back to main. num_chars is never updated, buffers seem to be filled with all 0's, and many lines of code are just never executed or compiled. What is going on here?

ラベル(1)
タグ(3)
0 件の賞賛
1 解決策
384件の閲覧回数
seandonohue
Contributor II

Nevermind. Didn't copy the ROM sections containing the print strings to RAM.

元の投稿で解決策を見る

0 件の賞賛
1 返信
385件の閲覧回数
seandonohue
Contributor II

Nevermind. Didn't copy the ROM sections containing the print strings to RAM.

0 件の賞賛