Simultaneous work USB and i2s

tantal
Posts: 2
Joined: Wed Oct 13, 2021 10:15 am

Simultaneous work USB and i2s

Postby tantal » Tue Apr 04, 2023 9:53 am

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)

ESP_Sprite
Posts: 9769
Joined: Thu Nov 26, 2015 4:08 am

Re: Simultaneous work USB and i2s

Postby ESP_Sprite » Wed Apr 05, 2023 12:30 am

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.

Who is online

Users browsing this forum: No registered users and 114 guests