Skip to content

ESP8266 - conflicting types for 'ets_delay_us' #8095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pacmac opened this issue Dec 17, 2021 · 6 comments
Closed

ESP8266 - conflicting types for 'ets_delay_us' #8095

pacmac opened this issue Dec 17, 2021 · 6 comments

Comments

@pacmac
Copy link

pacmac commented Dec 17, 2021

Is there a solution to this issue for ESP8266 GENERIC build ?

I saw a similar error in micropython forum, but no solution ?

In file included from ./esp_mphal.h:80:0,
                 from ../../py/mphal.h:33,
                 from ../../py/mpprint.c:33:
./etshal.h:9:6: error: conflicting types for 'ets_delay_us'
 void ets_delay_us(uint16_t us);
      ^
In file included from /usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/arch/cc.h:40:0,
                 from /usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/lwip/arch.h:43,
                 from /usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/lwip/debug.h:35,
                 from /usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/lwip/opt.h:46,
                 from /usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/lwip/ip_addr.h:35,
                 from /usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/user_interface.h:30,
                 from ./esp_mphal.h:27,
                 from ../../py/mphal.h:33,
                 from ../../py/mpprint.c:33:
/usr/share/upydev/esp8266/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/osapi.h:33:6: note: previous declaration of 'ets_delay_us' was here
 void ets_delay_us(uint32_t us);
      ^
CC ../../py/formatfloat.c
CC ../../py/parsenumbase.c
make: *** [build-GENERIC/py/mpprint.o] Error 1
../../py/mkrules.mk:77: recipe for target 'build-GENERIC/py/mpprint.o' failed
make: *** Waiting for unfinished jobs....
@mcauser
Copy link
Contributor

mcauser commented Dec 20, 2021

In SDK 2.1.x the ets_delay_us method us argument was unsigned 16bit, but in SDK 2.2.x it was changed to unsigned 32bit.

Try changing the us data type from uint16_t to uint32_t in:

https://github.com/micropython/micropython/blob/master/ports/esp8266/etshal.h#L9

// void ets_delay_us(uint16_t us);
void ets_delay_us(uint32_t us);

@mcauser
Copy link
Contributor

mcauser commented Dec 20, 2021

There was another change to the esp_init_data_default.bin file, mentioned here:
#6359

And further attempts at getting SDK 3.0.x working here:
#4318

@dpgeorge
Copy link
Member

It sounds like we should just remove that declaration in etshal.h.

dpgeorge added a commit to dpgeorge/micropython that referenced this issue Dec 20, 2021
These removed ones are either unused by MicroPython or provided by osapi.h
in the SDK.  In particular ets_delay_us() has different signatures for
different versions of the SDK, so best to let it provide the declaration.

Fixes issue micropython#8095.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member

See #8101.

@pacmac
Copy link
Author

pacmac commented Dec 20, 2021

Mike, Damien thanks so much.

dpgeorge added a commit to dpgeorge/micropython that referenced this issue Dec 21, 2021
These removed ones are either unused by MicroPython or provided by osapi.h
in the SDK.  In particular ets_delay_us() has different signatures for
different versions of the SDK, so best to let it provide the declaration.

Fixes issue micropython#8095.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member

Fixed by 05bea70

leifbirger pushed a commit to leifbirger/micropython that referenced this issue Jun 14, 2023
These removed ones are either unused by MicroPython or provided by osapi.h
in the SDK.  In particular ets_delay_us() has different signatures for
different versions of the SDK, so best to let it provide the declaration.

Fixes issue micropython#8095.

Signed-off-by: Damien George <damien@micropython.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants