[已解决]基于 esp-idf release v4.3 (588436db) 编译 esp-at 工程 异常

Moderator: ESP_XCGuang

anewlife
Posts: 5
Joined: Wed Aug 03, 2022 6:24 am

[已解决]基于 esp-idf release v4.3 (588436db) 编译 esp-at 工程 异常

Postby anewlife » Wed Aug 03, 2022 6:37 am

信息:
芯片: ESP32-PICO-D4
ESP-AT version: release/v2.1.0.0_esp32的基础上新增了自定义指令(原本使用IDF release v4.0,但该版本不再维护,故切换到v4.3)
ESP-IDF version: release v4.3 commit:588436db47da792736dade1c21fcbf2c879456a4
(官方固件ESP32-PICO-D4_AT_Bin_V2.4.0.0.zip 基于这个版本的IDF)
工具链环境等:通过install.sh 安装 工具链 python环境 依赖包等,通过export.sh设置环境变量

编译时出现如下问题:

log:CC build/newlib/locks.o
/home/yq/esp/esp-idf/components/newlib/locks.c:240:23: error: invalid application of 'sizeof' to incomplete type 'struct __lock'
_Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
^~~~~~
/home/yq/esp/esp-idf/components/newlib/locks.c:240:16: error: expression in static assertion is not an integer
_Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
^~~~~~
/home/yq/esp/esp-idf/components/newlib/locks.c: In function '__retarget_lock_init':
/home/yq/esp/esp-idf/components/newlib/locks.c:286:11: warning: assignment to '_LOCK_T' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
*lock = NULL; /* In case lock's memory is uninitialized */
^
/home/yq/esp/esp-idf/components/newlib/locks.c: In function '__retarget_lock_init_recursive':
/home/yq/esp/esp-idf/components/newlib/locks.c:292:11: warning: assignment to '_LOCK_T' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
*lock = NULL; /* In case lock's memory is uninitialized */
^
In file included from /home/yq/esp/esp-idf/components/esp_common/include/esp_err.h:18,
from /home/yq/esp/esp-idf/components/hal/include/hal/cpu_hal.h:20,
from /home/yq/esp/esp-idf/components/esp_hw_support/include/soc/cpu.h:32,
from /home/yq/esp/esp-idf/components/newlib/locks.c:19:
/home/yq/esp/esp-idf/components/newlib/locks.c: In function 'check_lock_nonzero':
/home/yq/esp/esp-idf/components/newlib/locks.c:309:17: warning: comparison between pointer and integer
assert(lock != NULL && "Uninitialized lock used");
^~
/home/yq/esp/esp-idf/components/newlib/platform_include/assert.h:50:42: note: in definition of macro 'assert'
#define assert(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func (__FILENAME__, __LINE__, \
^~~
/home/yq/esp/esp-idf/make/component_wrapper.mk:291: recipe for target 'locks.o' failed
make[1]: *** [locks.o] Error 1
/home/yq/esp/esp-idf/make/project.mk:635: recipe for target 'component-newlib-build' failed
make: *** [component-newlib-build] Error 2
Last edited by anewlife on Fri Aug 05, 2022 1:02 am, edited 2 times in total.

anewlife
Posts: 5
Joined: Wed Aug 03, 2022 6:24 am

Re: 基于 esp-idf release v4.3 (588436db) 编译 esp-at 工程 异常

Postby anewlife » Wed Aug 03, 2022 7:48 am

编译hello_world的例程也有同样的问题

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: 基于 esp-idf release v4.3 (588436db) 编译 esp-at 工程 异常

Postby ESP_Sun » Wed Aug 03, 2022 10:52 am

Hi,
每个 ESPAT 版本都有对应的 IDF 版本,如果要更新 IDF 版本可以参考文档:《如何更新 ESP-IDF 版本》(https://docs.espressif.com/projects/esp ... ml#esp-idf
企业微信截图_16595236902958.png
企业微信截图_16595236902958.png (47.89 KiB) Viewed 3932 times
如果您不想自己在 AT v2.1 版本适配 IDF 4.3 的话,其实可以直接使用 AT v2.4,因为它是兼容以前的功能。

anewlife
Posts: 5
Joined: Wed Aug 03, 2022 6:24 am

Re: 基于 esp-idf release v4.3 (588436db) 编译 esp-at 工程 异常

Postby anewlife » Thu Aug 04, 2022 1:10 am

好的,谢谢回复,我这边切换版本也是按文档所述操作的。
接下来我就尝试基于ESP-AT v2.4 增加自定义的改动。
仍然让我奇怪的是,基于ESP-IDF v4.3(commit:588436db47da792736dade1c21fcbf2c879456a4)编译自带的examples, locks.c也报错,但ESP-AT v2.4工程编译正常。

Who is online

Users browsing this forum: No registered users and 75 guests