Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By h4rm0n1c
#23589 I wanted to put this one to bed, there's too many people asking about this to answer in each thread.

Fiddling with the pins at the "bottom" of the ESP-12E module will result in crashes and/or freezing, as all of those pins are currently used for the on-board flash chip that all ESP8266 based modules have. There is an exception for GPIO9 and 10, the hardware modification required to allow the use of these pins is linked further down this post.

This is actually implied by the greyed out pin functions table in README.md on the GitHub repo:

https://github.com/esp8266/Arduino/blob ... /README.md

Or explicitly stated in the work in progress rewrite:

https://github.com/esp8266/Arduino/blob ... /README.md

The flash itself is memory mapped during run time, this is how procedures prefixed with ICACHE_FLASH_ATTR are accessed and executed, meaning that we can't really mess with those pins without the aforementioned consequences at the moment, the ESP8266 needs to be in practically constant contact with the built in flash.

This is an advanced level topic, it actually goes slightly over my head too, people who are working with the Espressif SDK side of things may know more of the specifics, there may even be some further exceptions, but what I've written above appears to be the general consensus that I have seen in my research into this issue, at this point in time.

So, what to do to get more GPIO pins?

I'm no expert, but if you want more GPIO pins for now you are probably going to have to compromise and just use a GPIO port expander, either I2C or SPI based, if you use SPI, you can share the bus with other SPI peripherals such as SD cards, etc... toggling the appropriate chip select line on the ESP8266, much the same as people do on the AVR Arduino when using multiple SPI devices.

The HSPI bus on GPIO12 to 15 can run up to 40Mhz or so, there's a dedicated UART for it, so there's no issues with slow transmission speeds or an SPI transfer blocking program execution for long periods of time if you were to use an expander, the GPIO lines on a port expander will be blazingly fast.

All that being said, it IS possible to free up GPIO9 and 10!

http://smarpl.com/content/esp8266-esp-2 ... and-gpio10

But it's not easy or for the faint of heart: you'll need a hot air gun to remove the metal shield if your ESP module has one (the flash chip is hidden under it), a steady hand to cut some very small PCB traces and solder a jumper, and you'll need to make sure you set your IDE to use DIO for the Flash Mode, as QIO will no longer work after this hardware modification.

That's about it. I hope people find this to be comprehensive and accurate primer, or caveat, on the current status of the bottom pins on the ESP12-E.

Please feel free to post corrections and I'll edit this post.