printf compiles into something bizarre

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

printf compiles into something bizarre

Jump to solution
559 Views
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?

Labels (1)
Tags (3)
0 Kudos
1 Solution
385 Views
seandonohue
Contributor II

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

View solution in original post

0 Kudos
1 Reply
386 Views
seandonohue
Contributor II

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

0 Kudos