Greetings,
I am working on a project in which I use RMT of ESP32S3 to transmit data on a LED strip and WiFi for LED configuration. I have observed that some of the LEDs will flicker especially when the number of connected sockets changes in WiFi driver. And the LEDs will be much more stable if WiFi is off.
The LED driver I am using is https://components.espressif.com/compon ... /led_strip (version 2.5.3). So far I have done the following changes and the flickering still exists:
1. DMA is enabled on RMT Tx
2. the freeRToS thread that calls the LED driver (led_strip_new_rmt_device) runs in Core 1.
3. WiFi task is pinned to Core 0 in menuconfig. So do the other application threads in freeRToS.
4. the priority of interrupts in RMT TX is set to level 3. Higher than 3 is not possbile.
5. SPI RAM config: allocate memory of WiFi and LWIP in SPIRAM first. [/list]
I don't understand why the RMT transaction is still corrupted by WiFi driver because the tasks and ISR are supposed to run on different cores. Does anybody have any idea? Thanks!
RMT transaction on led strip corrupted by WiFi interrupts
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: RMT transaction on led strip corrupted by WiFi interrupts
Can you post your code?
Re: RMT transaction on led strip corrupted by WiFi interrupts
Configuration of the LED driver
Thread for LED strip
Thread for WiFi. I have mdns also running on core 0.
- esp_err_t ledSetup()
- {
- led_strip_config_t strip_config = {
- .strip_gpio_num = LED_RMT_TX_GPIO,
- .max_leds = LED_MAX_LENGTH,
- .led_pixel_format = LED_PIXEL_FORMAT_GRB,
- .led_model = LED_MODEL_WS2812,
- .flags.invert_out = false,
- };
- led_strip_rmt_config_t rmt_config = {
- .clk_src = RMT_CLK_SRC_DEFAULT,
- .resolution_hz = 10 * 1000 * 1000, // 10MHz
- .flags.with_dma = true,
- };
- ESP_RETURN_ON_ERROR(led_strip_new_rmt_device(&strip_config, &rmt_config, &h_led_strip),
- TAG, "failed to init RMT device");
- return ESP_OK;
- }
Thread for LED strip
- xTaskCreatePinnedToCore(&mode_init, "mode_thread", 8192, NULL, 24, NULL, 1);
- xTaskCreatePinnedToCore(wifi_app_task, "wifi-app", 8192, NULL, 6, NULL, 0);
- Attachments
-
- 2024-08-02 09_43_33-Window.png (33.41 KiB) Viewed 2191 times
-
- 2024-08-02 09_42_17-Window.png (26.84 KiB) Viewed 2191 times
Re: RMT transaction on led strip corrupted by WiFi interrupts
ESP_Sprite, do you have any idea?
-
- Posts: 71
- Joined: Sat Mar 02, 2019 8:06 pm
Re: RMT transaction on led strip corrupted by WiFi interrupts
Do you need to use multiple RMT channels for different LED strips?
As for me, I worked this around by using SPI
As for me, I worked this around by using SPI
Re: RMT transaction on led strip corrupted by WiFi interrupts
Hi dmitrij999, thanks for help. I am only using one RMT channel for one strip.
Workaround with SPI would be my last option if i really could not fix it with RMT.
Workaround with SPI would be my last option if i really could not fix it with RMT.
-
- Posts: 40
- Joined: Thu Feb 22, 2024 3:59 pm
Re: RMT transaction on led strip corrupted by WiFi interrupts
I saw this once, but it was 2.4GHz radio transmission was sagging power supply slightly, so then RMT bitstream level was not reaching VIH level for LED strip.
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: RMT transaction on led strip corrupted by WiFi interrupts
That could be it, tbh. If you're using DMA, I'm not sure what else could interrupt the data stream.
Re: RMT transaction on led strip corrupted by WiFi interrupts
Thank you for the help. I think I found the cause of my problem. The DMA buffer size for RMT is by default too small in my case. The data frame has to break into several pieces and then extra delay caused by WiFi is then added in between the fragments. I have increased the mem_block_symbols in led_strip_rmt_config_t and then I don't see any unexpected error on LED strip so far.
Who is online
Users browsing this forum: No registered users and 270 guests