ESP32-S3 with IDF v5 and new GCC

MaHGue
Posts: 2
Joined: Sun May 22, 2022 2:31 pm

ESP32-S3 with IDF v5 and new GCC

Postby MaHGue » Fri Feb 17, 2023 10:07 am

Compilation using the new GCC as used by IDF v5 fails with:

Code: Select all

../libs/esp-idf/components/hal/esp32s3/include/hal/gdma_ll.h: In function 'void gdma_ll_rx_enable_interrupt(gdma_dev_t*, uint32_t, uint32_t, bool)':
../libs/esp-idf/components/hal/esp32s3/include/hal/gdma_ll.h:89:46: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
   89 |         dev->channel[channel].in.int_ena.val |= mask;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../libs/esp-idf/components/hal/esp32s3/include/hal/gdma_ll.h:91:46: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
   91 |         dev->channel[channel].in.int_ena.val &= ~mask;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
../libs/esp-idf/components/hal/esp32s3/include/hal/gdma_ll.h: In function 'void gdma_ll_tx_enable_interrupt(gdma_dev_t*, uint32_t, uint32_t, bool)':
../libs/esp-idf/components/hal/esp32s3/include/hal/gdma_ll.h:327:47: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  327 |         dev->channel[channel].out.int_ena.val |= mask;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../libs/esp-idf/components/hal/esp32s3/include/hal/gdma_ll.h:329:47: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  329 |         dev->channel[channel].out.int_ena.val &= ~mask;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../components/LovyanGFX/src/lgfx/v1/platforms/esp32s3/Bus_RGB.cpp:32:
../libs/esp-idf/components/hal/esp32s3/include/hal/lcd_ll.h: In function 'void lcd_ll_enable_interrupt(lcd_cam_dev_t*, uint32_t, bool)':
../libs/esp-idf/components/hal/esp32s3/include/hal/lcd_ll.h:557:33: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  557 |         dev->lc_dma_int_ena.val |= mask & 0x03;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
../libs/esp-idf/components/hal/esp32s3/include/hal/lcd_ll.h:559:33: error: compound assignment with 'volatile'-qualified left operand is deprecated [-Werror=volatile]
  559 |         dev->lc_dma_int_ena.val &= ~(mask & 0x03);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
and can be fixed with

Code: Select all

diff --git a/components/hal/esp32s3/include/hal/gdma_ll.h b/components/hal/esp32s3/include/hal/gdma_ll.h
index de8337468d..2440c33975 100644
--- a/components/hal/esp32s3/include/hal/gdma_ll.h
+++ b/components/hal/esp32s3/include/hal/gdma_ll.h
@@ -86,9 +86,9 @@ static inline uint32_t gdma_ll_rx_get_interrupt_status(gdma_dev_t *dev, uint32_t
 static inline void gdma_ll_rx_enable_interrupt(gdma_dev_t *dev, uint32_t channel, uint32_t mask, bool enable)
 {
     if (enable) {
-        dev->channel[channel].in.int_ena.val |= mask;
+        dev->channel[channel].in.int_ena.val = dev->channel[channel].in.int_ena.val | mask;
     } else {
-        dev->channel[channel].in.int_ena.val &= ~mask;
+        dev->channel[channel].in.int_ena.val = dev->channel[channel].in.int_ena.val & ~mask;
     }
 }
 
@@ -324,9 +324,9 @@ static inline uint32_t gdma_ll_tx_get_interrupt_status(gdma_dev_t *dev, uint32_t
 static inline void gdma_ll_tx_enable_interrupt(gdma_dev_t *dev, uint32_t channel, uint32_t mask, bool enable)
 {
     if (enable) {
-        dev->channel[channel].out.int_ena.val |= mask;
+        dev->channel[channel].out.int_ena.val = dev->channel[channel].out.int_ena.val | mask;
     } else {
-        dev->channel[channel].out.int_ena.val &= ~mask;
+        dev->channel[channel].out.int_ena.val = dev->channel[channel].out.int_ena.val & ~mask;
     }
 }
 
diff --git a/components/hal/esp32s3/include/hal/lcd_ll.h b/components/hal/esp32s3/include/hal/lcd_ll.h
index f2cc1487be..5dcd536c27 100644
--- a/components/hal/esp32s3/include/hal/lcd_ll.h
+++ b/components/hal/esp32s3/include/hal/lcd_ll.h
@@ -554,9 +554,9 @@ static inline void lcd_ll_set_data_delay_ticks(lcd_cam_dev_t *dev, uint32_t dela
 static inline void lcd_ll_enable_interrupt(lcd_cam_dev_t *dev, uint32_t mask, bool en)
 {
     if (en) {
-        dev->lc_dma_int_ena.val |= mask & 0x03;
+        dev->lc_dma_int_ena.val = dev->lc_dma_int_ena.val | (mask & 0x03);
     } else {
-        dev->lc_dma_int_ena.val &= ~(mask & 0x03);
+        dev->lc_dma_int_ena.val = dev->lc_dma_int_ena.val & ~(mask & 0x03);
     }
 }
Using an ESP32-S3-WROOM-1 and head of branch release/v5.0

MaHGue
Posts: 2
Joined: Sun May 22, 2022 2:31 pm

Re: ESP32-S3 with IDF v5 and new GCC

Postby MaHGue » Fri Feb 17, 2023 12:48 pm


Who is online

Users browsing this forum: No registered users and 71 guests