-
Notifications
You must be signed in to change notification settings - Fork 13.3k
gpio 10 doesn't work with new board 2.4.2 on Arduino IDE #5432
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
Comments
Pins 9 and 10 aren't available on 8266 devices, unless you modify the board to cut the pcb lines and, then change the flash mode to not use those lines. Is that what you're doing? |
as i said with board 2.4.1 worked like charm |
It did used to work: #2124 (comment). I haven't tried it recently though. |
And on most 8266 boards using those GPIO with releases prior to 2.4.2 could potentially fry the pins. Or the flash. I seem to remember you can still have access to them, but you are now required to change your board settings to one of the generic boards, I don't remember which (generic 8285 maybe?). Alternatively, you have to manually init those pins yourself in the same way the other pins are inited on bootup. |
The NodeMCU 1.0 is defined to use DIO mode - https://github.com/esp8266/Arduino/blob/master/boards.txt#L2354 - so you can (at least used to) just be able to use GPIO10 without and mod's anywhere. |
as i told you |
You can try to check SPI flash mode - probably you have DIO in previous version of IDE and QIO in 2.4.2... |
@claudiofrancesconi I understand that you didn't change anything on your end. I'm telling you that some things related to the init of pins 9 and 10 changed in the core with release 2.4.2, because it was deemed dangerous or nonsensical to leave them as they were for the general use case of the specific boards involved. Example of nonsensical: init pin as output, write LOW, try to read flash => crash. That's why I asked whether you modified your ESP12e-based Nodemcu when you started using it with 2.4.1 to allow generic use of GPIO 9/10. If you didn't modify your board, then maybe you were lucky (some flash chips have short protection) or there is some special board case that needs to be tested and allow the pins for the variants involved. |
gpio 9 and 10 have been recently set to usable only in DOUT mode with esp8285 (by @earlephilhower after he rewrote the whole PWM/Tone code).
In those case, could you try with latest git version ? |
@devyte do you happen to have the PR to hand that did that change? Doesn't an ESP8266 using DIO mean GPIO 9 and 10 are available and so should be useable with ESP8266/Arduino? |
@torntrousers I'm digging looking for it right now |
It's #5055. Gpio9&10 are now allowed only with esp8285 (previously always disabled) (that's after 2.4.2). |
It changed because @earlephilhower rewrote the whole PWM/tone thing (it was buggy at some point), and ommitted gpio9&10 in the first place, because they are flash pins, not commonly available. Then someone asked why gpio9&10 were gone. The rest of the story is #5055. |
I think its a regression. There aren't a lot of GPIO's on an ESP8266 so to unnecessarily prevent GPIO10 from being useable seems a shame. |
Calling it a shame is a little harsh but I'm not native english speaker so I might misunderstand :) |
Guys, you're missing the point. The point is that GPIO 9 & 10 weren't inited one way or the other in any board before. Then it was found that with a hw hack they could be used in some cases. Then some users would go and try to use them in their code without taking into account their board variant, and so in some cases there would be crashes, in other cases there would be damage, and in other cases it would happily work. @torntrousers said:
No, it doesn't. Their being usable requires two things:
If you only set to DIO and don't cut the lines, the flash pin could contend with the ESP setting of the GPIO level. |
@d-a-v see examples 6 and 7 here. I'm really sceptical that using GPIO10 can fry or damage the flash chip or ESP pin - electronically, how could that happen? Both the ESP and flash pins are I/O and work at 3.3v, and in QIO mode they are connected to something going high and low so they are designed to work for that, and in DIO mode its not like this could put an unexpected un-tolerated voltage on the pin, and the flash chip datasheets don't have any warnings about dangers to the pin in DIO mode. And I and others have tried it on lots of ESPs and I've never heard before of it not working. What sort of module were you using when you thought it broke it and how was it wired up and were you doing anything else at the time that could have been the cause? |
You say: If there are 8266 board variants where their use is available by design, they can be enabled for that variant. If there are variants where it's unknown, and testing works, it must be analyzed case by case as to why, and if ok they can be enabled for those variants. so how about another menu option thats available when using the 'Generic ESP8266 Module' board type that optionally enables the use of GPIO10 if you know what you're doing? |
Sorry, I missed this bit The current state is that you can still use them, but you have to init them yourself - if thats the case could you just show a code example of how to do that? And I'd be happy just doing that. |
You may also want to check wat this pin does at boot, or power-up. |
Nodemcu 0.9 is set to qio. If you want to use the pins, I think you have to set the correct flash mode and then init the pin on startup in the same way that the ESP8285 does. See the following references: |
To be clear:
Do this at your own risk, be aware you might damage your board if you make a mistake, and be aware you're responsible for whatever happens. I'm closing, because this is really unsupported usage. |
I've just tried with the 2.5.0-beta1 release and using GPIO-10 seems to be working fine when using DIO, eg with a NodeMCU 1.0. No other changes needed. Try it with the Blink example and just change LED_BUILTIN to 10. |
hello i am trying to use gpio 10 as an output on a nodemcu esp8266-12e with Arduino IDE
it used to work like charm when i used the board 2.4.1, after i upgraded to 2.4.2 it's not working anymore.
Any tips?
The text was updated successfully, but these errors were encountered: