I2C Read Register during GPIOTE callback

The application here is reading a Manchester stream on a GPIO. which comes from a MAX41473 radio IC.

Decoding is working fine using GPIOTE, timers & PPI to time & decode the data stream. But when I have detected the signature of a valid packet I need to read a I2C register on the MAX41473 in order to get the RSSI value from the radio with as little latency as possible - otherwise I could be reading the RSSI when the packet has finished. Getting the packet RSSI is a must-have for this application.

If I call i2c_reg_read_byte() during the GPIO callback it fails with a return code of 251. If for example I set a flag and call the same from main() it works.

Is this an IRQ priority issue, stack levels or something else?

Using nRF54L15, IO pin P1.05 and comms is on I2C30.

Parents Reply
  • Surely passing to a kernel work queue is exactly what I don't want in terms of latency? I need to obtain the value in the radio's RSSI register in real-time while it is receiving the packet... i.e. in a few milliseconds of decoding the magic number bytes.

    Note there will be other stuff going on including BLE advertising, GATT connection and possibly printk() via UART although not all at once.

Children
Related