Skip to content
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

ESP32-S2-Saola-1 Support #32

Open
masterX244 opened this issue Jun 15, 2023 · 6 comments
Open

ESP32-S2-Saola-1 Support #32

masterX244 opened this issue Jun 15, 2023 · 6 comments

Comments

@masterX244
Copy link

What pinout and changes are needed to use that board for flashing? Somehow the PlatformIO docs don't give a hint on how the Pin numbers map to the physical pins

@coelner
Copy link

coelner commented Jun 20, 2023

https://github.com/atc1441/ZBS_Flasher/blob/main/ESP32_Flasher/platformio.ini

[env:lolin32_lite]
platform = [email protected]
board = lolin32_lite
framework = arduino
#upload_port = COM17
upload_speed = 921600
#monitor_port = COM17
monitor_speed = 115200
build_flags = 
    -D LED=22
    -D ZBS_SS=23
	-D ZBS_CLK=18
	-D ZBS_MoSi=5
	-D ZBS_MiSo=17
	-D ZBS_Reset=19
    # do not connect directly to a GPIO only trough some kind of Mosfet or switch!
  	-D ZBS_POWER=16 
    # Used to read UART data from the firmware running on the ZBS, not needed at all
    -D ZBS_RXD=4
  	-D ZBS_TXD=2
    -D ZBS_SPI_BUS=VSPI

However it is a little bit confusing in the README, that it is named ESP32. As you can see here: https://mischianti.org/wp-content/uploads/2021/07/ESP32-WeMos-LOLIN32-Lite-pinout-mischianti.png or https://1.bp.blogspot.com/-mG0x8f0BKTA/WmiYamp9XdI/AAAAAAAAg5Y/N_P7plcbtmU-15JKqURYqE_yjt98AUdxwCLcBGAs/s1600/Lolin32_pinout03.png
the pins are labeled after the GPIO number. Now it depends (AFAIK), which SAOLA pcb version you have. the versin 1.2 atleast do have the labeled pcb pins likewise to the GPIO numbers.
However GPIO23 is not available, GPIO 18 is connected to the onboard RGB LED. Those need to be changed.

//Edit: https://docs.espressif.com/projects/arduino-esp32/en/latest/api/spi.html

  //initialise vspi with default pins
  //SCLK = 18, MISO = 19, MOSI = 23, SS = 5

completely unverified:

[env:esp32-s2-saola-1]
platform = espressif32
board = esp32-s2-saola-1
framework = arduino
#upload_port = COM17
upload_speed = 921600
#monitor_port = COM17
monitor_speed = 115200
build_flags = 
    -D LED=18
    -D ZBS_SS=34
    -D ZBS_CLK=36
    -D ZBS_MoSi=35
    -D ZBS_MiSo=37
    -D ZBS_Reset=19
    # do not connect directly to a GPIO only trough some kind of Mosfet or switch!
  	-D ZBS_POWER=16 
    # Used to read UART data from the firmware running on the ZBS, not needed at all
    -D ZBS_RXD=4
    -D ZBS_TXD=2
    -D ZBS_SPI_BUS=HSPI

@masterX244
Copy link
Author

Required HSPI instead of VSPI to compile, datasheet tells that, too.

@masterX244
Copy link
Author

Verified, with HSPI instead of VSPI i was able to flash the tag.

@coelner
Copy link

coelner commented Jul 5, 2023

I saw your pull request against the openepapertest repo, did you successful flash an AP firmware on the saola board? I tried that but I can't get the connection to the zbs243 working.

@masterX244
Copy link
Author

I got it to work, maybe try crossing the UART RX/TX wires, that stuff is not 100% clear. YOu used the pinconfig from my PR?

@coelner
Copy link

coelner commented Jul 5, 2023

It seems that two boards are broken. I tried it with an other one, which works.
//Edit: AFAIK the esp32-s2 has got two UARTs, but they can be multiplexed to every gpio, which makes it possible to use the rgb led on pin 18 and shift the RXD to 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants