In this video, I've decided to dive deep into the ESP32-S3, a module ruling my lab recently due to its plug-in-and-play functionality, and the flexibility offered by its GPIO matrix. However, working with it requires vigilance, especially with regard to the strapping pins and USB data pins, among others. Discovering such quirks, I've encountered unexpected values, short glitches and the occasional code crash. To help you avoid these bumps, I've documented everything I've learned on my GitHub repo, where I'm inviting you, my fellow makers and engineers, to contribute your valuable experiences and findings. After a minor hiccup with my ESP32-TV, expect an updated PCB design, courtesy of PCBWay. Explore the ESP32-S3 with me, and let's unravel its secrets together, one pull request at a time.
[0:00] Recently, I’ve been messing around a lot of recently with the ESP32-S3 - it’s a great module to
[0:05] work with as there’s no need for a USB-UART chip.
[0:09] This means that we can get away with really simple PCBs - all you need is a Low Drop Out
[0:13] regulator and some decoupling capacitors.
[0:15] There are a lot of things to like with the S3 - it’s really flexible as it has a GPIO
[0:21] matrix for connecting pins to its peripherals.
[0:23] This means that, in general, you don’t need to worry too much about which pins you use
[0:27] for things like I2C or SPI.
[0:30] But, as always, there are some gotchas that can really trip you up.
[0:34] There are some really great guides out there for the original ESP32 - one of go to ones
[0:39] for me is the Random Nerd Tutorial page.
[0:41] But I haven’t really found a good one for the S3.
[0:44] So I thought I’d make one.
[0:47] I’ve put mine up on GitHub and I’m hoping we can have a bit of a community effort to
[0:51] gather everyone’s knowledge into one place.
[0:54] So, let’s run through what we know so far.
[0:56] I’ve gleaned a lot of this from the various data sheets, personal experience, and of course
[1:00] great input from all of you.
[1:03] There are some pins that you definitely need to be careful with.
[1:06] The most important of these are the strapping pins.
[1:09] GPIO0, 45 and 46 are the three most critical ones.
[1:14] Mess these up and you’ll probably have a dead board.
[1:17] GPIO0 is probably the one that you are most familiar with - it’s the pin that almost all
[1:22] dev boards will connect a push button to labeled “boot”.
[1:26] Holding this pin low when the board is powered on or reset will put the ESP32 in to firmware
[1:31] download mode.
[1:33] In previous ESP32 dev boards a clever arrangement of transistors could be used to replace this
[1:38] button dance.
[1:39] With the S3, in theory, pushing the buttons should not be needed.
[1:43] You can program the board directly through the USB pins.
[1:47] However, my experience, and anecdotal information from other people, indicates that this can’t
[1:52] be relied on.
[1:53] So you may sometimes find that you do need to force the ESP32-S3 into download mode.
[1:59] The value of GPIO46 can have an impact on the boot mode.
[2:04] This handy table gives you combinations of values - an important thing to note is that
[2:08] having GPIO46 high is not a valid if you want to go into firmware download mode.
[2:15] GPIO45 controls the voltage that is used for the internal flash - unless you really know
[2:20] what you are doing then messing with this pin can cause all sorts of interesting issues.
[2:25] GPIO3 is the last strapping pin, and arguably, less important, it only has an impact if you
[2:32] have burned some eFuses.
[2:34] If you have burned the appropriate fuses then GPIO3 can be used to switch the default JTAG
[2:40] debugging pins off.
[2:42] An important thing to remember about these pins is that apart from GPIO3 they all have
[2:46] either pull-up or pull-down resistors on them.
[2:49] GPIO0 has a pull up resistor and GPIO45 and GPIO46 both have pull down resistors.
[2:57] So that’s the strapping pins - my advice is to just not use GPIO45 or GPIO46 - leave them
[3:05] disconnected.
[3:06] But, there are some more pins that you need to be careful with.
[3:10] Two very obvious ones are the USB data pins, GPIO19 and GPIO20 - On most dev boards these
[3:18] won’t be broken out at all, but if you are designing your own PCB then it’s worth being
[3:23] aware of them.
[3:24] And if you use them in your code you will interfere with any USB communication.
[3:29] When I was playing with the Voltera and printing an S3 PCB at home I discovered some more pins
[3:33] to be careful of.
[3:35] GPIO pins 39 to 42 are used for JTAG debugging.
[3:40] Until you start using them, these pins can have unexpected values on them.
[3:43] There are also a couple of default UART pins - these will be used for UART0 unless you
[3:48] use them for something else.
[3:50] The final thing to watch out for, as I found to my cost, is only relevant if you are using
[3:55] an S3 module with octal PSRAM - these are the modules that have 8 megabytes of extra
[4:01] RAM.
[4:02] With these modules you cannot use GPIO35, 36 or 37 at the same time as PSRAM.
[4:09] If you do try and use them then your code will crash.
[4:13] I used these pins on my ESP32-TV and it was only after I got the boards manufactured by
[4:18] PCBWay and tried to enable PSRAM and then access the SD Card that I realised my error.
[4:24] Fortunately the TV firmware doesn’t require PSRAM so it wasn’t a complete disaster, but
[4:29] I am still going to redo the PCBs to avoid these pins.
[4:33] So we’ll have another board coming from PCBWay in the near future.
[4:37] And if you want a PCB for yourself, then check out the PCBWay link in the video description.
[4:43] That’s really it for pins that you need to be careful about.
[4:46] During boot time there are a surprising number of pins that have very short glitches on them
[4:50] - GPIO1 through to GPIO20 all have some kind of glitch, either a very brief low level or
[4:57] brief high level glitch of around 60 micro seconds.
[5:00] For most use cases, this probably won’t have any effect, but it could potentially cause
[5:05] any hardware connected to them to get into a funny state.
[5:09] I’ve documented all of this on the GitHub repo.
[5:12] One of the nice things with the S3 is that there are far fewer restrictions on the pins
[5:16] that you can use.
[5:18] There are some interesting things in the data sheet that need further investigation.
[5:22] I mentioned earlier that there is a GPIO matrix that means you can use any of the pins for
[5:27] the S3’s peripherals.
[5:29] I’ve made a lot of use of this on the ESP32-TV and everything has worked really well, however,
[5:34] there is also an IO mux.
[5:36] This is much less flexible than the GPIO matrix, but may offer improved high speed digital
[5:42] performance - though I have seen some messages on the forums that it may not make that much
[5:46] difference.
[5:47] Let me know in the comments if you’ve had any experience of this.
[5:50] And please take a look at the GitHub repo and open an issue or even better a pull request
[5:55] if you can see something that can be improved.