Skip to content

STM32WLE5JC: Add board configuration#129

Open
tyler-potyondy wants to merge 1 commit intotock:masterfrom
tyler-potyondy:ents-board-config
Open

STM32WLE5JC: Add board configuration#129
tyler-potyondy wants to merge 1 commit intotock:masterfrom
tyler-potyondy:ents-board-config

Conversation

@tyler-potyondy
Copy link
Contributor

Overview

This PR adds support for the STM32WLE5JC SoC (found on the Seeed Studio LoRa E5 dev board) via an STLink. This accompanies tock/tock#4695.

OpenOCD Changes

When initially adding this board, tockloader caused a number of bus faults that arose from attempting to read/write past the end of flash. I am not entirely sure why this has not come up before. My guess is that this has something to do with the lack of an OpenOCD board specific configuration for the stm32wle5jc. OpenOCD only has a target config (different than board config) for the stm32wle5xx (which can be a few different lengths for flash).

Quickly looking, it appears the other boards using OpenOCD have an OpenOCD board specific config (not just a target). Long story short, I bubbled up errors when attempting to r/w past the end of flash and added some exception handling to gracefully handle when this happens. Someone with a better understanding of OpenOCD/tockloader should sanity check this to make sure these changes are in fact necessary as this impacts all OpenOCD functionality, albeit minor.

@bradjc
Copy link
Contributor

bradjc commented Jan 29, 2026

I'm guessing it's a combination of we never actually try to read/write past the end of flash and openocd generally handles the issue rather than causing errors.

I think it is valid for tockloader to not try to write apps beyond the end of flash.

I'm less sure about what should happen to writes and reads beyond flash; I think it's probably fine to handle those the same we do today and make it a board/openocd/user problem.

Can we make this PR just the second commit, and work on the end of flash issue separately? I think if tockloader is to check that apps are going to far it needs to know where the end should be, and that should be set in tockloader.py. I'm happy to work on this.

This adds the stm32wle5jc chip used in the seeed_studio_lora-E5-HF dev
board to tockloader's known board list. Communication intended to occur
using stlink over openocd.
@tyler-potyondy
Copy link
Contributor Author

Sounds good, I just dropped the other commit.

Looks like black is failing for some reason. I couldn't recreate this locally until updating black to 26.1.0. The failure is in tab.py which I'm not modifying.

It looks like Leon's PR also picked up this formatting issue but he checked in the tab.py formatting fix. Let me know if I should open a separate PR for that fix.

@lschuermann
Copy link
Member

lschuermann commented Jan 31, 2026

It looks like Leon's PR also picked up this formatting issue but he checked in the tab.py formatting fix. Let me know if I should open a separate PR for that fix.

So, I just squashed the formatting fixes into my commit, and I didn't realize those were also touching code that I didn't change. I'll merge this in with another PR and then we can both rebase. :)

Edit: @tyler-potyondy if you rebase on master, the CI should turn green now!

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.

3 participants