device/esp register names change in TinyGo 0.46 #6818
davecheney
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
TinyGo 0.46-dev now generates device/esp from tinygo-org/esp32-svd instead of cmsis-svd (#6770). If your code uses device/esp for the ESP32, ESP32-C3, ESP32-C6, ESP32-H2, ESP32-P4 or ESP32-S3, you will need to update any references to those symbols.
To change your code, run tools/esp-svd-migrate in the directory of your module, once for each chip that your code supports:
The first command lists the files that the tool would change. The second command writes the changes. The chip names are esp32, esp32c3, esp32c6, esp32h2, esp32p4 and esp32s3.
For example, tinygo-org/espradio supports the ESP32, ESP32-C3, ESP32-C6 and ESP32-S3. In the espradio directory:
$ cd devel/espradio $ go run github.com/tinygo-org/tinygo/tools/esp-svd-migrate@dev -chip=esp32 ./... esp32/esp32.go $ go run github.com/tinygo-org/tinygo/tools/esp-svd-migrate@dev -chip=esp32 -w ./... $ go run github.com/tinygo-org/tinygo/tools/esp-svd-migrate@dev -chip=esp32c3 -w ./... $ go run github.com/tinygo-org/tinygo/tools/esp-svd-migrate@dev -chip=esp32c6 -w ./... $ go run github.com/tinygo-org/tinygo/tools/esp-svd-migrate@dev -chip=esp32s3 -w ./...The tool changed 11 references in esp32/esp32.go, esp32c3/esp32c3.go and esp32s3/esp32s3.go. Each change replaces a Set or Get method of the peripheral with the Set or Get method of the WIFI_CLK_EN register:
The tool changes a file only if its build constraint allows the chip. If a file builds for two chips that rename an identifier differently, the tool reports a conflict and does not change it. The tool also reports each identifier that has no equivalent in esp32-svd. Change these by hand, and please report them here so that we can add them to the tool.
To see the renames for one chip, run the tool with -rules. It prints them in gofmt -r syntax.
All reactions