Printf %c broken in MQX 3.8 for the null character

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

Printf %c broken in MQX 3.8 for the null character

548 Views
PhilH
Contributor II

In upgrading from 3.7 to 3.8 I found that printf was broken.  I was using a series of "%c%c" format to generate a Modbus packet to a sensor.  Printf in 3.7 did the right thing with a '\0' character (sent a null character) but in 3.8, it ignores it and does not output anything.  I was able to work around it by using a series of "fputc()" calls instead.  I did submit a bug report to Freescale but I have not heard back.

0 Kudos
2 Replies

328 Views
KJFPE
Contributor III

 

It may be that in user_config.h that the BSP_DEFAULT_IO_OPEN_MODE is set to this

 

#define BSP_DEFAULT_IO_OPEN_MODE                      (pointer) (IO_SERIAL_XON_XOFF | IO_SERIAL_TRANSLATION)

 

Try this

 

#define BSP_DEFAULT_IO_OPEN_MODE                      (pointer) (IO_SERIAL_XON_XOFF | IO_SERIAL_RAW_IO)

 

0 Kudos

328 Views
c0170
Senior Contributor III

Hello PhilH,

 

I took a quick look what you have described. It's been reported and  I will let you know here when this is fixed.

The defines (BSP_DEFAULT_IO_OPEN_MODE) do not have any affect to this problem.

 

Thank you for your finding!

 

Regards,

MartinK

0 Kudos