Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
I am using the partial receive mode on the advanced Rx command on a CC1312. I'm receiving UAT packets, which don't include a length field nad need to have their type code and preamble investigated to know their expected length. They have a wide range of lengrhs, ranging from 34 to 552 bytes. Right now I am using the partial receive mode to receive these packets, so I set maxPktLen to 0, and then set the expected packet length in the rx callback after the N bytes received event is triggered. This works great until I enable my SPI interrupts, in which case I eventually get a full microcontroller crash after somewhere between a few minutes and a few hours (while subjecting the device to heavy packet load).
My best guess is that somewhere along the line, the SPI interrupt stomps on the RF event that would trigger a packet length write, and the RF core writes well beyond the end of the packet buffer and corrupts other memory.
I tried to address this by setting maxPktLen to 552 bytes, the max packet size I would ever expect (which my partial receive buffer is sized to handle), but then all of my partial receive packets seem to ignore my RF_cmdPropSetLen and always return with a length equal to my max packet size.
I've tried playing with interrupt priorities, by reducing the hardware and software interrupt priorities of the SPI peripheral compared to the RF peripheral in sysconfig, but this doesn't completely solve the problem. Currently the only way I can solve this problem reliably is to hardcode maxPktLen to 552 bytes, but if I do this I'm wasting a large amount of valuable airtime by ingesting 552 bytes for every 34 byte packet (there are a lot more 34 byte packets than 552 byte packets).
Do you have any tips for solving this problem? A snippet of my code is included below (C++).
```