platform-espressif32 icon indicating copy to clipboard operation
platform-espressif32 copied to clipboard

examples/espidf-arduino-blink build fails: unknown type name '_lock_t'

Open skiphansen opened this issue 3 years ago • 8 comments

I followed the directions in platform-espressif32/examples/espidf-arduino-blink/README.md exactly, but the build failed with error: unknown type name '_lock_t' in lots of places.

Instead of using the zip file I also tired cloning https://github.com/platformio/platform-espressif32.git directly but the example failed the same way in both the master and develop branches.

The examples/arduino-blink builds fine.

I'm new to platformio and I'm trying to build a project that uses classic bluetooth which appears to need a tweak using menuconfig to build. Researching that issue lead me to the espidf-arduino-blink.

Here's my build.log.

skip@Dell-7040:~/zips$ platformio --version
PlatformIO Core, version 5.2.3
skip@Dell-7040:~/zips$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
skip@Dell-7040:~/zips$

skiphansen avatar Dec 11 '21 00:12 skiphansen

I looks like the wrong lock.h is getting included. I've build quite a few projects since I first installed platform IO a week or so ago for several different boards.

skip@Dell-7040:~$ find .platformio/ -name lock.h
.platformio/packages/[email protected]/components/newlib/include/sys/lock.h
.platformio/packages/[email protected]/components/spi_flash/sim/stubs/newlib/include/sys/lock.h
.platformio/packages/[email protected]/xtensa-esp32-elf/include/sys/lock.h
.platformio/packages/[email protected]/xtensa-esp32-elf/include/include/sys/lock.h
.platformio/packages/[email protected]/xtensa-esp32-elf/sysroot/usr/include/sys/lock.h
.platformio/packages/framework-espidf/components/newlib/platform_include/sys/lock.h
.platformio/packages/framework-espidf/components/spi_flash/sim/stubs/newlib/include/sys/lock.h
.platformio/packages/toolchain-xtensa32/xtensa-esp32-elf/sys-include/sys/lock.h
.platformio/packages/toolchain-xtensa32/xtensa-esp32-elf/include/sys/lock.h
.platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/sys-include/sys/lock.h
.platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/include/sys/lock.h
.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/sys-include/sys/lock.h
.platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/sys/lock.h
.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib/sys/lock.h
.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src/az_iot/c-utility/inc/azure_c_shared_utility/lock.h
.platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/sys-include/sys/lock.h
.platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/sys/lock.h

I just created a temporary user and installed platformio from scratch and then tried the example and it built without a problem.

Earlier I thought I had caught platformio using the main repo of a library when platformio.ini has specified a particular branch, but I didn't chase that down.

There's still an issue somewhere, but it isn't specific to this example.

skiphansen avatar Dec 11 '21 18:12 skiphansen

Sounds simliar to https://github.com/platformio/platform-espressif32/issues/646#issuecomment-948358453, does the same workaround work?

maxgerhardt avatar Dec 18 '21 14:12 maxgerhardt

I don't know. When I discovered that a virgin install didn't have the issue I wiped my .platformio/packages directory and that fixed it. I think there's still an issue with a builds not using the correct headers. I don't know enough about platformio to chase it further.

skiphansen avatar Dec 18 '21 16:12 skiphansen

I builded a actual framework. Arduino Core v2.0.2 and IDF v4.4. All included examples in this builded framework do work

platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2idf/platform-espressif32-2.0.2.zip

Jason2866 avatar Dec 28 '21 19:12 Jason2866

@skiphansen Did you find a solution? I have the same problem.

60pfennig avatar Jan 20 '22 20:01 60pfennig

He already said

wiped my .platformio/packages directory and that fixed it.

Same as this person.

maxgerhardt avatar Jan 20 '22 20:01 maxgerhardt

@Jason2866 I tried your build to be able to use the arduino,espidf sample (https://github.com/tasmota/platform-espressif32/tree/Arduino2022/IDF44/examples/espidf-arduino-wifiscan) , and I have an error about the crt_bundle file not found...

platform = https://github.com/Jason2866/platform-espressif32/releases/download/v2.0.2/platform-espressif32-2.0.2.zip
Generating assembly for certificate bundle...
CMake Error at C:/Users/xyz/.platformio/packages/framework-espidf/tools/cmake/scripts/data_file_embed_asm.cmake:26 (file):
  file failed to open for reading (No such file or directory):

    D:\project\.pio\build\esp32dev\x509_crt_bundle

It's look like a problem with python3 be more strict on validating the certificate bundles.

followed the instruction here https://github.com/espressif/esp-idf/issues/7631#issuecomment-934212224, delete the sdkconfig.esp32 and now the build is passing.

Regards,

dumarjo avatar Feb 11 '22 13:02 dumarjo

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 31 '22 20:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 22:09 stale[bot]