Skip to content

Conversation

@cjpeterson
Copy link

This is an update to an old PR #3937 . Since the old PR has not been touched in quite a while, I figured it was worth another shot.

This adds support for the ESP32-S3 chip. Currently, serial output is working through UART. I count 3 people that have gotten text to output successfully with this code. I have also finished setting up GPIO support, so blinky is working.

Some programs compile, but freeze during execution. This seems to happen when the compiler optimizes out dead code (e.g. code after infinite loops). Adding -opt=0 during compilation has fixed all the issues I've seen.

Most of the comments from the previous pull request have been addressed:

  • Built-in svd files have been removed
  • The startup assembly code has been fully merged with esp32.s. The extra bit in PS_OWB_MASK does not appear in the esp-idf source file, so I removed it.
  • The cpu frequency configuration stuff has been implemented
  • "esp32s3" has been added to builder_test

I did not move the .S files out of /src/device/esp. It may be a good idea, but it seems beyond the scope of this PR.

@cjpeterson
Copy link
Author

Updated to pass the checks and to correct a critical bug in the linker script. This eliminated the need for -opt=0 in the two test cases I had.

@deadprogram
Copy link
Member

I have a Xiao ESP32S3 board I can test with. Will take a look soon.

@deadprogram
Copy link
Member

I added a board target locally, and was able to get my Xiao blinking!

$ tinygo flash -size short -target xiao-esp32s3 examples/blinky1
   code    data     bss |   flash     ram
   3710       0    4184 |    3710    4184
esptool.py v4.8.1
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: e8:06:90:9d:b5:c4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00000fff...
Flash params set to 0x031f
SHA digest in image updated
Compressed 3808 bytes to 2958...
Wrote 3808 bytes (2958 compressed) at 0x00000000 in 0.1 seconds (effective 488.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

I am thinking to squash/merge this, and then in a separate PR I will add my new target.

Copy link
Contributor

@ysoldak ysoldak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ysoldak
Copy link
Contributor

ysoldak commented Nov 24, 2025

Ship it, @deadprogram

@deadprogram
Copy link
Member

Thank you very much to everyone who has worked on this so far, @denysvitali @ofauchon @cjpeterson and a cast oof thousands! :)

Now squash/merging.

@deadprogram deadprogram merged commit fbbaa5e into tinygo-org:dev Nov 24, 2025
19 checks passed
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

Successfully merging this pull request may close these issues.

5 participants