第二个例子LED调光驱动2_light_drivers在编译build时报错

Moderator: ESP_ZT

myadmin
Posts: 5
Joined: Tue Nov 29, 2022 1:23 pm

第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby myadmin » Tue Nov 29, 2022 1:26 pm

C:/rainmaker/device_firmware/components/light_driver/iot_led.c:66:46: error: 'ti
mg_txconfig_reg_t' {aka 'volatile union <anonymous>'} has no member named 'enabl
e'
TG[group_num]->hw_timer[timer_num].config.enable = 0;
^
C:/rainmaker/device_firmware/components/light_driver/iot_led.c: In function '_io
t_set_fade_with_time':
C:/rainmaker/device_firmware/components/light_driver/iot_led.c:169:99: error: 'v
olatile union <anonymous>' has no member named 'tick_sel'
uint32_t timer_source_clk = LEDC.timer_group[speed_mode].timer[g_light_conf
ig->timer_num].conf.tick_sel;

^
C:/rainmaker/device_firmware/components/light_driver/iot_led.c: In function 'fad
e_timercb':
C:/rainmaker/device_firmware/components/light_driver/iot_led.c:278:39: error: 't
img_dev_t' {aka 'struct <anonymous>'} has no member named 'int_st'
uint32_t intr_status = TIMERG0.int_st.val;
^
C:/rainmaker/device_firmware/components/light_driver/iot_led.c:287:20: error: 't
img_dev_t' {aka 'struct <anonymous>'} has no member named 'int_clr'
TIMERG0.int_clr.t0 = 1;
^
C:/rainmaker/device_firmware/components/light_driver/iot_led.c:302:44: error: 't
img_txconfig_reg_t' {aka 'volatile union <anonymous>'} has no member named 'alar
m_en'; did you mean 'tx_alarm_en'?
TIMERG0.hw_timer[timer_idx].config.alarm_en = TIMER_ALARM_EN;
^~~~~~~~
tx_alarm_en
[1003/1017] Building C object esp-idf/...akeFiles/__idf_main.dir/app_main.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

ESP_YJM
Posts: 300
Joined: Fri Feb 26, 2021 10:30 am

Re: 第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby ESP_YJM » Thu Dec 01, 2022 9:22 am

你使用的 IDF 版本是多少?你可以根据错误找下对应结构体里有没有该成员变量。

myadmin
Posts: 5
Joined: Tue Nov 29, 2022 1:23 pm

Re: 第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby myadmin » Thu Dec 01, 2022 2:53 pm

idf版本是:ESP-IDF v4.4.3-dirty

aabb7788
Posts: 1
Joined: Sun Dec 04, 2022 2:49 pm

Re: 第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby aabb7788 » Sun Dec 04, 2022 2:55 pm

你好,我也是一样的问题,IDF版本4.4.3,soc/ledc_reg.h貌似读取了esp32/include/soc里面的文件,而没有读取到esp32c3的文件

ESP_@In逍遥子
Posts: 132
Joined: Thu Nov 15, 2018 2:06 am

Re: 第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby ESP_@In逍遥子 » Mon Dec 05, 2022 3:37 am

您使用的编译平台/芯片也可以提供下。 (C3 还是 esp32)

wfqysu
Posts: 6
Joined: Thu Dec 08, 2022 3:40 am

Re: 第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby wfqysu » Mon Dec 12, 2022 7:56 am

我的C3也是这样
D:/esp/book-esp32c3-iot-projects-main/device_firmware/components/light_driver/iot_led.c: In function '_iot_set_fade_with_time':
D:/esp/book-esp32c3-iot-projects-main/device_firmware/components/light_driver/iot_led.c:171:99: error: 'volatile union <anonymous>' has no member named 'tick_sel'
uint32_t timer_source_clk = LEDC.timer_group[speed_mode].timer[g_light_config->timer_num].conf.tick_sel;
^
D:/esp/book-esp32c3-iot-projects-main/device_firmware/components/light_driver/iot_led.c: In function 'fade_timercb':
D:/esp/book-esp32c3-iot-projects-main/device_firmware/components/light_driver/iot_led.c:280:39: error: 'timg_dev_t' {aka 'struct <anonymous>'} has no member named 'int_st'
uint32_t intr_status = TIMERG0.int_st.val;
^
D:/esp/book-esp32c3-iot-projects-main/device_firmware/components/light_driver/iot_led.c:289:20: error: 'timg_dev_t' {aka 'struct <anonymous>'} has no member named 'int_clr'
TIMERG0.int_clr.t0 = 1;
^
D:/esp/book-esp32c3-iot-projects-main/device_firmware/components/light_driver/iot_led.c:304:44: error: 'timg_txconfig_reg_t' {aka 'volatile union <anonymous>'} has no member named 'alarm_en'; did you mean 'tx_alarm_en'?
TIMERG0.hw_timer[timer_idx].config.alarm_en = TIMER_ALARM_EN;
^~~~~~~~
tx_alarm_en
[1006/1016] Building C object esp-idf/wifi_provisioning/CMakeFiles/__idf_wifi_provisioning.dir/src/manager.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

ESP_@In逍遥子
Posts: 132
Joined: Thu Nov 15, 2018 2:06 am

Re: 第二个例子LED调光驱动2_light_drivers在编译build时报错

Postby ESP_@In逍遥子 » Mon Dec 26, 2022 7:14 am

使用配套工程,我们推荐使用 v4.3.2 版本,其他版本还没有适配/测试:开发环境搭建

Who is online

Users browsing this forum: No registered users and 2 guests