CDC ACM UART ISR not triggered during ESB connection

I am trying to port some code I wrote for Gazell, which I guess acts more elegant since it uses PPI, a workqueue, timeslots, etc. I have an ESB connection in which I receive data in every packet. I am trying to enable tx interrupts in ESB_EVENT_RX_RECEIVE in my esb event handler after adding the data to a ringbuf. That way, my CDC ACM interrupt handler can take data until and fill the uart fifo to be handled by the usb driver or whatever. This worked fine in Gazell, probably because there was plenty of time for the interrupt to start, but what I am noticing is that the interrupt never happens after enabling the uart tx irq. Sometimes the interrupt callback gets triggered, but it is very slow and is often stopped by a mem manage exception from ringbuf_get. I tried to give it some time with ksleep, but it fails the arch in isr assertion (I guess we are still in the esb interrupt during the callback)?

Since the NRF USB supports higher throughput than ESB, I do not want to delay the ESB transmits in order to allow the interrupt to happen anyway, even though I could not even get that to work. How can I get this interrupt triggered? There should be time for the interrupt to trigger during the ~2ms while the radio is waiting for a response. Would the UART Async API instead of interrupt-driven work faster/better for my case? Would it work with CDC ACM?

Related