Skip to content

Commit 0b14eec

Browse files
committed
stm32lib: Add workflow documentation for updating vendor versions.
This adds a step-by-step guide for updating MCU series to new vendor versions, making the vendor/work branch workflow more accessible. The new section covers: - Cloning/fetching upstream STM32Cube repositories - Using fetch_from_upstream.sh to import vendor code - Proper commit message format (tags are created by maintainers) - Creating work branches and rebasing MicroPython patches - Pushing and creating pull requests
1 parent dc9fb19 commit 0b14eec

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,77 @@ And similar for the other microcontroller classes.
4646

4747
The included `fetch_from_upstream.sh` script can automatically copy and process
4848
new source code from an STM git repository.
49+
50+
Updating to a new vendor version
51+
=================================
52+
53+
To update a specific MCU series (e.g. STM32WB) to a new vendor version, follow
54+
these steps:
55+
56+
1. **Clone or fetch the upstream STM32Cube repository**
57+
58+
For example, to update STM32WB:
59+
```bash
60+
cd /tmp
61+
git clone https://github.com/STMicroelectronics/STM32CubeWB.git
62+
cd STM32CubeWB
63+
git checkout v1.23.0 # or desired version
64+
```
65+
66+
2. **Identify the current work branch before updating vendor**
67+
68+
In stm32lib folder identify the current released tag:
69+
```bash
70+
cd path/to/stm32lib
71+
git describe --tags --exact-match origin/vendor
72+
```
73+
74+
This shows the current version tag, for example:
75+
```
76+
F0-1.9.0+F4-1.16.0+F7-1.7.0+G0-1.5.1+G4-1.3.0+H5-1.0.0+H7-1.11.0+L0-1.11.2+L1-1.10.3+L4-1.17.0+N6-1.1.0+WB-1.10.0+WL-1.1.0
77+
```
78+
The convention is to use a similar tag name prepended with `work-` as the working branch when submitting an update.
79+
80+
Now checkout vendor to begin the update:
81+
```bash
82+
git checkout vendor
83+
```
84+
85+
3. **Import and commit the vendor update**
86+
87+
```bash
88+
./fetch_from_upstream.sh STM32WB /tmp/STM32CubeWB
89+
git add -A
90+
git commit -m "Import STM32CubeWB v1.23.0 on DD-Mon-YYYY."
91+
```
92+
93+
The `fetch_from_upstream.sh` script will copy and process the new CMSIS and HAL
94+
source files. The maintainer will create the version tag after merging.
95+
96+
4. **Create new work branch and rebase patches**
97+
98+
Create a new work branch name by updating only the MCU series you're upgrading.
99+
For example, updating WB from 1.10.0 to 1.23.0:
100+
```bash
101+
# Old: origin/work-...-WB-1.10.0-...
102+
# New: work-...-WB-1.23.0-...
103+
git checkout -b work-F0-1.9.0+F4-1.16.0+F7-1.7.0+G0-1.5.1+G4-1.3.0+H5-1.0.0+H7-1.11.0+L0-1.11.2+L1-1.10.3+L4-1.17.0+N6-1.1.0+WB-1.23.0+WL-1.1.0 \
104+
origin/work-F0-1.9.0+F4-1.16.0+F7-1.7.0+G0-1.5.1+G4-1.3.0+H5-1.0.0+H7-1.11.0+L0-1.11.2+L1-1.10.3+L4-1.17.0+N6-1.1.0+WB-1.10.0+WL-1.1.0
105+
```
106+
107+
Rebase all patches onto the updated vendor branch:
108+
```bash
109+
git rebase vendor
110+
```
111+
112+
Resolve any conflicts if they arise. The rebase applies all MicroPython-specific
113+
patches from the previous work branch onto the new vendor code.
114+
115+
5. **Push and create pull request**
116+
117+
Push only the work branch (not vendor - the vendor commit will be included in the PR):
118+
```bash
119+
git push -u fork work-F0-1.9.0+...+WB-1.23.0+...
120+
gh pr create --repo micropython/stm32lib --base vendor \
121+
--title "stm32lib: Update STM32WB from v1.10.0 to v1.23.0."
122+
```

0 commit comments

Comments
 (0)