printf not working on C32 compiler

770 views Asked by At

Why isn't the printf working on PIC32 like with PIC18?

For example this code works fine on PIC18, but not on PIC32,

printf("%lu",value);

With C32 compiler there is not output message, what did I miss?

1

There are 1 answers

1
chux - Reinstate Monica On

The sizeof(unsigned) on a PIC18 is 2
The sizeof(unsigned) on a PIC32 is 4
I suspect value is not long unsigned and so you have UB in

printf("%lu",value);

If so, insure the format specifier matches the variable type.