nodemcu/nodemcu-firmware

Unable to use some GPIO pins

signed-log opened this issue · 1 comments

Expected behavior

Being able to choose all the pins available from the board for all purposes

Actual behavior

Unable to choose pins >= 13 for softuart RX pin

Test code

-- Setup the softuart
softuart.setup(9600, 12, 13)

NodeMCU startup banner

NodeMCU 3.0.0.0 built on nodemcu-build.com provided by frightanic.com
	branch: release
	commit: f25dc56d3c6213b8ac7ce46d1293466137746eae
	release: 
	release DTS: 202112300746
	SSL: false
	build type: float
	LFS: 0x0 bytes total capacity
	modules: bit,encoder,file,gpio,net,node,softuart,tmr,uart,wifi
 build 2023-04-28 08:10 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e)

Hardware

Official Espressif ESP8266-DevKit C

As you can see (official image from the board's doc) :

image

  • 13;
  • 14;
  • 16

The above pins are made available in the headers. And due to the low number of GPIO on that board, I'd love to make use of those extra pins

I'd suspect the culprit is the GPIO_PIN_NUM :

#define GPIO_PIN_NUM 13

And the check function :

static inline int platform_gpio_exists( unsigned pin ) { return pin < NUM_GPIO; }

After reading the GPIO Docs, I figured out that I just needed to RTFM