cpu info:nrf5340
software:nrf connect sdk 1.6.1
hi professor,
In the uart interrupt I call k_fifo_put to trigger rx process thread but it is not take effect.What person cause this question?


cpu info:nrf5340
software:nrf connect sdk 1.6.1
hi professor,
In the uart interrupt I call k_fifo_put to trigger rx process thread but it is not take effect.What person cause this question?


Hello,
Have you verified through debugging that k_fifo_put() actually gets called?
Thanks,
Vidar
I'm sure k_fifo_put was called.
But how to you confirm what the actual interrupt sequence is? --- The number 9 indicates uart irq running. The number 10 indicates gpio irq running.So actual interrupt sequence is 9->10. The number 9 timestamp is 2375092975 ns.The number 10 timesatmp is 3370454303 ns. That's meaning uart irq not trigger rx process thread unitl gpio irq was called.
I see. So the uart irq is not processed until after gpio irq, even though the uart irq came first.
Is your UART IRQ configured as a Zero latency interrupt by any chance? The documentation states that you should not use kernel APIs from such interrupts and that it can lead to undefined behavior.
I use the "IRQ_DIRECT_CONNECT(SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQn, 0, nrfx_uarte_0_irq_handler,0)" to init uart irq. It is zero latency interrupt. But I use the "IRQ_CONNECT(SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQn, 0, nrfx_uarte_0_irq_handler, NULL, 0)" to init uart irq. The problem remains.So How to init uart irq? Actually I don't need zero latency interrupt.
Please pass 'nrfx_isr' to the IRQ_CONNECT() macro like we do in our nrfx sample here: https://github.com/nrfconnect/sdk-zephyr/blob/c3208e7ff49d22d8271f305344382e9306fdde99/samples/boards/nrf/nrfx/src/main.c#L37
According to the link, I use the "IRQ_CONNECT(SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQn, 0, nrfx_isr, nrfx_uarte_0_irq_handler, 0)" to init uart irq.But the problem remains.
According to the link, I use the "IRQ_CONNECT(SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQn, 0, nrfx_isr, nrfx_uarte_0_irq_handler, 0)" to init uart irq.But the problem remains.
Thanks for confirming. But I'm afraid I can't think of anything else that can cause this behavior. Are you able to share the rest of your code or create a minimal sample that will allow me to reproduce this here?
Edit: Can you show the struct declaration for sensor_operate_t ?
typedef struct
{
void *fifo_reserved;
uint32_t uiSensorState;
}sensor_operate_t;
I'm unable to extract your *.rar file for some reason. Could you please try to upload it again and maybe as a .zip instead?
hi Vidar Berg,
Did you find any problems in my code?