BUG MQX UART INTERRUPT

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

BUG MQX UART INTERRUPT

861 Views
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 Kudos
1 Reply

283 Views
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 Kudos