Error compiling in a library #define "hal/uhci_ll.h"

jprpower104
Posts: 16
Joined: Tue Jul 18, 2023 3:59 am

Error compiling in a library #define "hal/uhci_ll.h"

Postby jprpower104 » Fri Dec 15, 2023 2:41 pm

I have this error before never give me an error, but now yes:

Code: Select all


In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h: In function 'void uhci_ll_set_seper_chr(uhci_dev_t*, uhci_seper_chr_t*)':
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:57:51: error: no matching function for call to  
$_anon_104(volatile uhci_dev_s::<unnamed union>&)'
   57 |         typeof(hw->esc_conf0) esc_conf0_reg = hw->esc_conf0;
      |                                                   ^~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:190:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(const uhci_dev_s::<unnamed union>&)' (near match)
  190 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:190:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:57:51: error: binding reference of type 'const uhci_dev_s::<unnamed union>&' to 'volatile uhci_dev_s::<unnamed union>' discards qualifiers
   57 |         typeof(hw->esc_conf0) esc_conf0_reg = hw->esc_conf0;
      |                                               ~~~~^~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:190:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(uhci_dev_s::<unnamed union>&&)' (near match)
  190 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:190:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:57:51: error: cannot bind rvalue reference of type 'uhci_dev_s::<unnamed union>&&' to lvalue of type 'volatile uhci_dev_s::<unnamed union>'
   57 |         typeof(hw->esc_conf0) esc_conf0_reg = hw->esc_conf0;
      |                                               ~~~~^~~~~~~~~
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h: In function 'void uhci_ll_set_swflow_ctrl_sub_chr(uhci_dev_t*, uhci_swflow_ctrl_sub_chr_t*)':
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:78:51: error: no matching function for call to  
$_anon_95(volatile uhci_dev_s::<unnamed union>&)'
   78 |     typeof(hw->escape_conf) escape_conf_reg = hw->escape_conf;
      |                                                   ^~~~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:142:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(const uhci_dev_s::<unnamed union>&)' (near match)
  142 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:142:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:78:51: error: binding reference of type 'const uhci_dev_s::<unnamed union>&' to 'volatile uhci_dev_s::<unnamed union>' discards qualifiers
   78 |     typeof(hw->escape_conf) escape_conf_reg = hw->escape_conf;
      |                                               ~~~~^~~~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:142:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(uhci_dev_s::<unnamed union>&&)' (near match)
  142 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:142:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:78:51: error: cannot bind rvalue reference of type 'uhci_dev_s::<unnamed union>&&' to lvalue of type 'volatile uhci_dev_s::<unnamed union>'
   78 |     typeof(hw->escape_conf) escape_conf_reg = hw->escape_conf;
      |                                               ~~~~^~~~~~~~~~~
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:80:51: error: no matching function for call to  
$_anon_108(volatile uhci_dev_s::<unnamed union>&)'
   80 |         typeof(hw->esc_conf2) esc_conf2_reg = hw->esc_conf2;
      |                                                   ^~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:208:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(const uhci_dev_s::<unnamed union>&)' (near match)
  208 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:208:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:80:51: error: binding reference of type 'const uhci_dev_s::<unnamed union>&' to 'volatile uhci_dev_s::<unnamed union>' discards qualifiers
   80 |         typeof(hw->esc_conf2) esc_conf2_reg = hw->esc_conf2;
      |                                               ~~~~^~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:208:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(uhci_dev_s::<unnamed union>&&)' (near match)
  208 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:208:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:80:51: error: cannot bind rvalue reference of type 'uhci_dev_s::<unnamed union>&&' to lvalue of type 'volatile uhci_dev_s::<unnamed union>'
   80 |         typeof(hw->esc_conf2) esc_conf2_reg = hw->esc_conf2;
      |                                               ~~~~^~~~~~~~~
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:81:51: error: no matching function for call to  
$_anon_110(volatile uhci_dev_s::<unnamed union>&)'
   81 |         typeof(hw->esc_conf3) esc_conf3_reg = hw->esc_conf3;
      |                                                   ^~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:217:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(const uhci_dev_s::<unnamed union>&)' (near match)
  217 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:217:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:81:51: error: binding reference of type 'const uhci_dev_s::<unnamed union>&' to 'volatile uhci_dev_s::<unnamed union>' discards qualifiers
   81 |         typeof(hw->esc_conf3) esc_conf3_reg = hw->esc_conf3;
      |                                               ~~~~^~~~~~~~~
In file included from C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:22,
                 from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:217:11: note: candidate: 'constexpr uhci_dev_s::<unnamed union>::<constructor>(uhci_dev_s::<unnamed union>&&)' (near match)
  217 |     union {
      |           ^
C:/Users/sopor/esp32/esp-idf/components/soc/esp32s3/include/soc/uhci_struct.h:217:11: note:   conversion of argument 1 would be ill-formed:
In file included from C:/workspace/Core_4G/HAL/Example/esp32/dma/GDMA_HAL_UHCI_UART_EXAMPLE/src/board/board.h:20,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.h:55,
                 from C:/workspace/Core_4G/HAL/EHAL/uart/esp32/specific_uart.cpp:22:
C:/Users/sopor/esp32/esp-idf/components/hal/esp32s3/include/hal/uhci_ll.h:81:51: error: cannot bind rvalue reference of type 'uhci_dev_s::<unnamed union>&&' to lvalue of type 'volatile uhci_dev_s::<unnamed union>'
   81 |         typeof(hw->esc_conf3) esc_conf3_reg = hw->esc_conf3;
   
   

jprpower104
Posts: 16
Joined: Tue Jul 18, 2023 3:59 am

Re: Error compiling in a library #define "hal/uhci_ll.h"

Postby jprpower104 » Thu Dec 21, 2023 12:59 pm

In this case is by a update of compiler and an error appear in hal/uhci_ll.h related to struct_uhci.h inicialization, then this code
become an error:

Code: Select all

typeof(hw->esc_conf0) esc_conf0_reg = hw->esc_conf0;
but with this code repair it:

Code: Select all

 
 typeof(hw->esc_conf0) esc_conf0_reg;
        esc_conf0_reg.val = hw->esc_conf0.val;
the functions affected are:

Code: Select all

static inline void uhci_ll_set_seper_chr(uhci_dev_t *hw, uhci_seper_chr_t *seper_char)
{
    if (seper_char->sub_chr_en) {
        typeof(hw->esc_conf0) esc_conf0_reg = hw->esc_conf0;
        esc_conf0_reg.seper_char = seper_char->seper_chr;
        esc_conf0_reg.seper_esc_char0 = seper_char->sub_chr1;
        esc_conf0_reg.seper_esc_char1 = seper_char->sub_chr2;
        hw->esc_conf0.val = esc_conf0_reg.val;
        hw->escape_conf.tx_c0_esc_en = 1;
        hw->escape_conf.rx_c0_esc_en = 1;
    } else {
        hw->escape_conf.tx_c0_esc_en = 0;
        hw->escape_conf.rx_c0_esc_en = 0;
    }
}

static inline void uhci_ll_get_seper_chr(uhci_dev_t *hw, uhci_seper_chr_t *seper_chr)
{
    (void)hw;
    (void)seper_chr;
}

static inline void uhci_ll_set_swflow_ctrl_sub_chr(uhci_dev_t *hw, uhci_swflow_ctrl_sub_chr_t *sub_ctr)
{
    typeof(hw->escape_conf) escape_conf_reg = hw->escape_conf;
    if (sub_ctr->flow_en == 1) {
        typeof(hw->esc_conf2) esc_conf2_reg = hw->esc_conf2;
        typeof(hw->esc_conf3) esc_conf3_reg = hw->esc_conf3;
        esc_conf2_reg.seq1 = sub_ctr->xon_chr;
        esc_conf2_reg.seq1_char0 = sub_ctr->xon_sub1;
        esc_conf2_reg.seq1_char1 = sub_ctr->xon_sub2;
        esc_conf3_reg.seq2 = sub_ctr->xoff_chr;
        esc_conf3_reg.seq2_char0 = sub_ctr->xoff_sub1;
        esc_conf3_reg.seq2_char1 = sub_ctr->xoff_sub2;
        escape_conf_reg.tx_11_esc_en = 1;
        escape_conf_reg.tx_13_esc_en = 1;
        escape_conf_reg.rx_11_esc_en = 1;
        escape_conf_reg.rx_13_esc_en = 1;
        hw->esc_conf2.val = esc_conf2_reg.val;
        hw->esc_conf3.val = esc_conf3_reg.val;
    } else {
        escape_conf_reg.tx_11_esc_en = 0;
        escape_conf_reg.tx_13_esc_en = 0;
        escape_conf_reg.rx_11_esc_en = 0;
        escape_conf_reg.rx_13_esc_en = 0;
    }
    hw->escape_conf.val = escape_conf_reg.val;
}
And this is his new version:

Code: Select all

static inline void uhci_ll_set_seper_chr(uhci_dev_t *hw, uhci_seper_chr_t *seper_char)
{
    if (seper_char->sub_chr_en) {
        typeof(hw->esc_conf0) esc_conf0_reg;
        esc_conf0_reg.val = hw->esc_conf0.val;
        esc_conf0_reg.seper_char = seper_char->seper_chr;
        esc_conf0_reg.seper_esc_char0 = seper_char->sub_chr1;
        esc_conf0_reg.seper_esc_char1 = seper_char->sub_chr2;
        hw->esc_conf0.val = esc_conf0_reg.val;
        hw->escape_conf.tx_c0_esc_en = 1;
        hw->escape_conf.rx_c0_esc_en = 1;
    } else {
        hw->escape_conf.tx_c0_esc_en = 0;
        hw->escape_conf.rx_c0_esc_en = 0;
    }
}

static inline void uhci_ll_get_seper_chr(uhci_dev_t *hw, uhci_seper_chr_t *seper_chr)
{
    (void)hw;
    (void)seper_chr;
}

static inline void uhci_ll_set_swflow_ctrl_sub_chr(uhci_dev_t *hw, uhci_swflow_ctrl_sub_chr_t *sub_ctr)
{
    typeof(hw->escape_conf) escape_conf_reg;
    escape_conf_reg.val = hw->escape_conf.val;
    if (sub_ctr->flow_en == 1) {
        typeof(hw->esc_conf2) esc_conf2_reg;
        esc_conf2_reg.val = hw->esc_conf2.val;
        typeof(hw->esc_conf3) esc_conf3_reg;
        esc_conf3_reg.val = hw->esc_conf3.val;
        esc_conf2_reg.seq1 = sub_ctr->xon_chr;
        esc_conf2_reg.seq1_char0 = sub_ctr->xon_sub1;
        esc_conf2_reg.seq1_char1 = sub_ctr->xon_sub2;
        esc_conf3_reg.seq2 = sub_ctr->xoff_chr;
        esc_conf3_reg.seq2_char0 = sub_ctr->xoff_sub1;
        esc_conf3_reg.seq2_char1 = sub_ctr->xoff_sub2;
        escape_conf_reg.tx_11_esc_en = 1;
        escape_conf_reg.tx_13_esc_en = 1;
        escape_conf_reg.rx_11_esc_en = 1;
        escape_conf_reg.rx_13_esc_en = 1;
        hw->esc_conf2.val = esc_conf2_reg.val;
        hw->esc_conf3.val = esc_conf3_reg.val;
    } else {
        escape_conf_reg.tx_11_esc_en = 0;
        escape_conf_reg.tx_13_esc_en = 0;
        escape_conf_reg.rx_11_esc_en = 0;
        escape_conf_reg.rx_13_esc_en = 0;
    }
    hw->escape_conf.val = escape_conf_reg.val;
}
Then error is repair!!!

Who is online

Users browsing this forum: No registered users and 37 guests