Page 1 of 1

Simultaneous work USB and i2s

Posted: Tue Apr 04, 2023 9:53 am
by tantal
I ran into a problem that I can’t use I2s with configured

Code: Select all

esp_console_dev_usb_serial_jtag_config_t
I am getting the following error when initializing the i2s

Code: Select all

E (11406) gdma: gdma_install_rx_interrupt(773): alloc interrupt failed
E (11416) gdma: gdma_register_rx_event_callbacks(435): install interrupt service failed
I tried to set up shared interrupts, although I'm not sure that I correctly understood the purpose of this function

Code: Select all

ESP_ERROR_CHECK(esp_intr_mark_shared(PERIPH_I2S0_MODULE, 1, true));
If you have any ideas I would really appreciate your help.

Version esp idf

Code: Select all

commit a4afa44435ef4488d018399e1de50ad2ee964be8 (grafted, HEAD, tag: v5.0.1)

Re: Simultaneous work USB and i2s

Posted: Wed Apr 05, 2023 12:30 am
by ESP_Sprite
A shared interrupt is an interrupt that can be raised by multiple devices. It saves on interrupts at the cost of some interrupt latency. The easiest way to make use of it is to pass ESP_INTR_FLAG_SHARED to in the flags for some peripherals whose drivers support passing interrupt flags. (Usb-serial-JTAG is not amongst them, but if you pass that flag to some other drivers, it'll free up an interrupt for USB-serial-JTAG to use.)

esp_intr_mark_shared only marks an interrupt as usable for shared interrupts, it doesn't really do anything else. You shouldn't have to call it yourself, if the interrupt allocator needs an interrupt for this it'll allocate one itself.