Skip to content

Commit 29033f6

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 29033f6

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,83 @@ minor patches to the vendor code, for example work-F4-1.5.0+F7-1.1.0+L4-1.3.0.
2121
The patches/commits that form a given working branch are reapplied (with
2222
conflict resolution) to newer vendor tags to create the next working branch.
2323

24+
Updating to a new vendor version
25+
=================================
26+
27+
To update a specific MCU series (e.g. STM32WB) to a new vendor version, follow
28+
these steps:
29+
30+
1. **Clone or fetch the upstream STM32Cube repository**
31+
32+
For example, to update STM32WB:
33+
```bash
34+
git clone https://github.com/STMicroelectronics/STM32CubeWB.git
35+
cd STM32CubeWB
36+
git checkout v1.23.0 # or desired version
37+
```
38+
39+
2. **Identify the current work branch before updating vendor**
40+
41+
Check the current vendor tag to identify which work branch corresponds to it:
42+
```bash
43+
git describe --tags --exact-match origin/vendor
44+
```
45+
46+
This shows the current version tag, for example:
47+
```
48+
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
49+
```
50+
51+
Find the work branch that matches this tag:
52+
```bash
53+
git branch -r | grep "origin/work-" | grep "WB-1.10.0"
54+
```
55+
56+
Now checkout vendor to begin the update:
57+
```bash
58+
cd path/to/stm32lib
59+
git checkout vendor
60+
```
61+
62+
3. **Import and commit the vendor update**
63+
64+
```bash
65+
./fetch_from_upstream.sh STM32WB path/to/STM32CubeWB
66+
git add -A
67+
git commit -m "Import STM32CubeWB v1.23.0 on DD-Mon-YYYY."
68+
```
69+
70+
The `fetch_from_upstream.sh` script will copy and process the new CMSIS and HAL
71+
source files. The maintainer will create the version tag after merging.
72+
73+
4. **Create new work branch and rebase patches**
74+
75+
Create a new work branch name by updating only the MCU series you're upgrading.
76+
For example, updating WB from 1.10.0 to 1.23.0:
77+
```bash
78+
# Old: origin/work-...-WB-1.10.0-...
79+
# New: work-...-WB-1.23.0-...
80+
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 \
81+
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
82+
```
83+
84+
Rebase all patches onto the updated vendor branch:
85+
```bash
86+
git rebase vendor
87+
```
88+
89+
Resolve any conflicts if they arise. The rebase applies all MicroPython-specific
90+
patches from the previous work branch onto the new vendor code.
91+
92+
5. **Push and create pull request**
93+
94+
Push only the work branch (not vendor - the vendor commit will be included in the PR):
95+
```bash
96+
git push -u fork work-F0-1.9.0+...+WB-1.23.0+...
97+
gh pr create --repo micropython/stm32lib --base vendor \
98+
--title "stm32lib: Update STM32WB from v1.10.0 to v1.23.0."
99+
```
100+
24101
Original sources
25102
================
26103

0 commit comments

Comments
 (0)