IO_IOCTL_SERIAL_GET_STATS

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

IO_IOCTL_SERIAL_GET_STATS

570 Views
billnd
Contributor IV

The ioctl command, when used with IO_IOCTL_SERIAL_GET_STATS returns a number of uint_32 to a buffer pointed to by the supplied param_ptr. I don't see any documentation for how many uint_32 may be written, and hence how large the buffer needs to be. Currently, by checking the source code, it looks like it writes 8 words.

What happens if this changes in the future MQX releases, perhaps by supplying 9 words? This is a recipe for disaster. Am I missing something?

Also, is there a method of getting/clearing only some of the statistics, ie just the error counts?

And lastly, why is RX_NOISE_ERRORS not included in the current methods?

Cheers

Bill

Tags (2)
0 Kudos
1 Reply

229 Views
soledad
NXP Employee
NXP Employee

Hi,

IO_IOCTL_SERIAL_GET_STATS is used to get the statistics information of the serial port, e.g. Rx parity error, overrun, etc.

If you want to check whether there is character received, _io_fstatus() could be used like:

bCharRecved = _io_fstatus(uart3_file);

I recommend you to take a look to the AN3902 “How to develop I/O Drivers for MQX” for getting a better understanding of MQX drivers.

http://cache.freescale.com/files/32bit/doc/app_note/AN3902.pdf

Regards

Sol

0 Kudos