[已解决]基于 esp-idf release v4.3 (588436db) 编译 esp-at 工程 异常
Posted: 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
芯片: 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