BUG MQX UART INTERRUPT

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

BUG MQX UART INTERRUPT

1,014 次查看
ThiagoE
Contributor I

Hi,

 

I Think that a found a bug in the file serl_int.c in:

 

C:\Program Files\Freescale\Freescale MQX 3.3\mqx\source\io\serial\int

 

in line 226/227 is write:

 

226: int_io_dev_ptr->FLAGS = (_mqx_uint)flags;

227: fd_ptr->FLAGS      = (_mqx_uint)flags;

 

But, it's incorrect because "flags" its a pointer to char and not a unsigned int. The correct is:

 

226: int_io_dev_ptr->FLAGS = (_mqx_uint)(*flags);

227: fd_ptr->FLAGS      = (_mqx_uint)(*flags);

 

The original code may be cause an intermittent behavior of your firmware, because the value of fd_ptr->FLAGS will be a address of SRAM and may change with each compilation.

 

Thanks
Thiago Esteves

 

 

0 项奖励
回复
1 回复

436 次查看
JuroV
NXP Employee
NXP Employee

The code is correct, there is no bug. The parameter passed to the open is a combination of flags resulting to 32-bit number, which is for sure not pointer. The function takes indeed pointer param, but it is for API, compatibility with installing a driver.

0 项奖励
回复