FreeRTOS, queue byte alignment
For whatever reason, I'm getting byte alignment problems with queues. I have a 32 byte queue, and the last two bytes are now garbage (they weren't before). No system settings have been changed, and I'm using all the defaults. If I expand the size of the queue from 32 bytes to, say, 34 or 36 bytes, the garbage area moves down.
The data structure is a mixture of uint16_t and bytes. FreeRTOS queues take pointers to data structures.
I've had the same thing when writing the structure to an NRF24L01, having to reduce the active part of the packet by two bytes, which are then trashed with surprising regularity.
So the workaround is to write more data to the queues maintained by FreeRTOS, then use only the good part of it.
The problem with the NRF24L01 is "solved" by reducing the payload significant data from 32 bytes to 30 bytes, but still using a packet size of 32 bytes. It's not the chip, since data arrives (using shockburst) with the proper checksum, packet ack, and no errors on transmission.
Shockburst mode sends a packet to the receiver, performs a checksum, then sends an ACK/NACK back to the transmitter to validate reception. So a packet that's been acked has been received properly and validated at the other end. The packet at the other end had the garbage last two bytes, so that's the way the chip at the transmitter end got it.
Any comments?
Workaround are ok, but it might be nice to fix this properly.
