Printf %c broken in MQX 3.8 for the null character

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Printf %c broken in MQX 3.8 for the null character

564 次查看
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 项奖励
2 回复数

344 次查看
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 项奖励

344 次查看
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 项奖励