Skip to content

Add support for the cores scheduler for esp32s3#5358

Draft
hamstah wants to merge 1 commit into
tinygo-org:devfrom
hamstah:esp32s3-cores
Draft

Add support for the cores scheduler for esp32s3#5358
hamstah wants to merge 1 commit into
tinygo-org:devfrom
hamstah:esp32s3-cores

Conversation

@hamstah
Copy link
Copy Markdown

@hamstah hamstah commented Apr 29, 2026

Hi,

This is an attempt to support the cores scheduler for the esp32s3.

Disclaimer:

  • I've tested the code manually on hardware and had a cursory review of the code but I'm not familiar with tinygo and that much low level code, it was generated with AI assistance, It's more of a draft for someone with expertise to guide or pick up.
  • There is potentially an issue with early timer.Sleep(), see the issue.

See the longer context for the PR in #5353

Thanks

// https://0x04.net/~mwk/doc/xtensa.pdf

import (
_ "unsafe"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding "unsafe" again is not correct.

sleepingCore = 0xff
}

func interruptSleepTicksMulticore(wakeup timeUnit) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function is supposed to interrupt sleepTicks but does not, so time.Sleep() would probably hang.

schedulerWake()
}

func schedulerUnlockAndWait() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this would introduce some unwanted latency.

}
}

func gcInterruptHandler(hartID uint32) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps use GC core signaling here to improve efficiency.

Comment thread targets/esp32s3.ld
memcpy = 0x400011f4;
memmove = 0x40001200;
memcmp = 0x4000120c;
ets_set_appcpu_boot_addr = 0x40000720;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are some other ets_ addresses in this file, this probably should be next to one of them?

@deadprogram
Copy link
Copy Markdown
Member

Hello @hamstah thanks for working this and sorry for the delay in reviewing. I have made a few comments. Also you should rebase this PR against the latest dev branch, please.

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.

2 participants