Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By Skeen
#15546 Nodemcu does NOT seem to call 'gpio_init()' at all?
- The only call to it, seems to be a shadowed call from some testing code in their spi module.

The 'user_init()' in nodemcu just seems to be bootstrapping the lua vm, and as no modules seem to be invoking 'gpio_init()', it seems it's not called at all.

I may just be tired, it's 2am at my place, but I'll do some further testing of this hypothesis tomorrow-ish.
User avatar
By Skeen
#15549 It may be worth noting, that the 'gpio_init()' function is not called in any of the sdk examples.
- Also it's not documented in any of the sdk documentation.

I'm starting to feel that maybe it is invoked, from within the esp bootup code in the sdk.
- I.e. before actually calling 'user_init()', I guess I'll have to try and decompile the sdk binaries to figure.
User avatar
By Skeen
#15553 Been poking around a bit, in the binaries, found what seems to be the 'gpio_init()' call;

It's residing at absolute position '0x40004c50', by the linker script 'eagle.rom.addr.v6.ld';
Code: Select all40004c50 g       *ABS*   00000000 gpio_init

^^ Pulled using object dump from my elf output file.

Looking up the address in output binary yields this function;
Code: Select all40004c50 <.data>:
40004c50:   f0c112           addi   a1, a1, -16
40004c53:   3109         s32i.n   a0, a1, 12
40004c55:   004e85           call0   0x40005140
40004c58:   3108         l32i.n   a0, a1, 12
40004c5a:   10c112           addi   a1, a1, 16
40004c5d:   f00d         ret.n

EDIT: Above dump is incorrect, I was tired.

I've got a dump with all the jumps of the binary, and I'll check all the static ones tomorrow.
- To check if 'gpio_init()' is indeed called anywhere internally.