The ESP32-S2 does have some docs on the GPIO_STRAPPING in the TRM, but bit 1:0 are undefined there. From what I can find if I dig in the archives (it's been 3 years since we worked on that chips design), those bits *may* be defined by the state of U0TX and U0RX (GPIO1/2), but the doc I have isn't that clear on it. What I can tell you is that those bits shouldn't matter at all if you keep to the states in the datasheet: either with IO0=1 to boot into 'normal' mode or with IO0=0&IO46=0 to boot into download mode, the lower bits are ignored in ROM code. Given that, 0xA should give you a normal boot; I think the differences in boot mode between PCBs are a red herring.
I cannot hardset the state of IO46 due to how small the pin is, but if it is pulled down by default. Also i am able to put my diy board into download mode, so i think this pin is pulled down correctly.
Re the 32KHz crystal: it has use in deep sleep modes, but it's not necessary for basic operation of the chip at all.
Good to know that i didn't miss an crystal.
Two more (somewhat related) things you can try. First of all, maybe there's some madness going on with the internal flash. If you can compile a project in ESP-IDF, can you try lowering the flash speed? Should be in menuconfig, under 'serial flasher config'. I think you have it set to 80MHz, you can try lowering it to see if that changes anything.
The other one is that you don't have any external capacitors on VDD_SPI. Looking at the
datasheet of one of our modules that use the same chip, there's an 1uF plus a 0.1uF capacitor on the VDD_SPI pin. Perhaps adding those fixes your problem?
I am using the arduino ide v2 where i program with the esptool v3.3. I tried setting the speed to 40MHz, but nothing different happend.
The vdd_spi pin capacitors would be a good last option, sadly i need this out tomorrow. I only have 2 diy boards with me and ruined both since the pins are so small.
Alternative route:
We are thinking about switching to the module instead of the chip due to time and deadlines. This way we know for certain that all pins for the chip are connected and easier to solder to while trouble shooting with the bigger pads. The module we order to test out is the:
ESP32-S2-WROVER.
(Btw: you do know that there's no need to connect that RS485 chip specifically to U0RxD and U0TxD? All our ESP chips have multiple UARTS, and you can route those UARTS to any IO pin, and by using an uart different from UART0, you don't get the issue that the chip will try to emit boot messages there.)
Good suggestion, did not thought about the boot message on UART0. I will connect the RS485 chip to UART1 (IO 17 and 18). On the initial diy pcb i designed the board to be programmed via usb in boot download mode, but switched to serial when i could not connect to it via usb.