|
1 | | -# stm32variant |
2 | | - |
3 | | -By default, generates: |
4 | | - - *PeripheralPins.c* |
5 | | - - *PinNamesVar.h* |
6 | | - - *variant_generic.cpp* |
7 | | - - *variant_generic.h* |
8 | | - - *boards_entry.txt* |
9 | | - - *generic_clock.c* |
10 | | - |
11 | | -for all xml files description available in [STM32CubeMX](http://www.st.com/en/development-tools/stm32cubemx.html) database. |
12 | | -By default, the database used is the one from GitHub: |
13 | | - https://github.com/STMicroelectronics/STM32_open_pin_data |
14 | | -The internal database from STM32CubeMX directory can also be used. |
15 | | -The path have to be defined in `update_config.json`. |
16 | | - |
17 | | -After file generation, review them carefully and please report any issue |
| 1 | +# Update scripts |
| 2 | + |
| 3 | +Run scripts from the `Arduino_Core_STM32` repository root unless noted |
| 4 | +otherwise. Most scripts use settings in `CI/update/update_config.json`; they |
| 5 | +create default settings when needed. |
| 6 | + |
| 7 | +## Generate generic variants |
| 8 | + |
| 9 | +`python CI/update/stm32variant.py` generates `PeripheralPins.c`, |
| 10 | +`PinNamesVar.h`, `variant_generic.cpp`, `variant_generic.h`, `boards_entry.txt`, |
| 11 | +and `generic_clock.c` from STM32CubeMX XML pin descriptions. By default, it |
| 12 | +fetches the `STM32_open_pin_data` database from GitHub and processes all |
| 13 | +available descriptions. Use `--list` to list descriptions or |
| 14 | +`--series <pattern>` to generate a selected series. Use `--cube` to use the |
| 15 | +STM32CubeMX database instead; set `CUBEMX_DIRECTORY` in |
| 16 | +`CI/update/update_config.json` for that database. The configuration also uses |
| 17 | +`STM32CUBECLT_PATH` for STM32 target information. |
| 18 | + |
| 19 | +`python CI/update/stm32variantv2.py` generates the same files from JSON pinout |
| 20 | +descriptions in the newer STM32Cube device-pack repositories. Use `--list` to |
| 21 | +list available pinout files or `--series <series>` to limit generation to one |
| 22 | +supported series. The repositories are managed by `stm32cubev2.py`; their |
| 23 | +location is configured with `REPOV2_LOCAL_PATH`. |
| 24 | + |
| 25 | +After generation, review the files carefully and report any issue |
18 | 26 | [here](https://github.com/stm32duino/Arduino_Core_STM32/issues). |
19 | 27 |
|
| 28 | +## Update STM32Cube content |
| 29 | + |
| 30 | +`python CI/update/stm32cube.py` manages the HAL drivers and CMSIS device files |
| 31 | +from the STM32Cube repositories. By default, it updates all supported series. |
| 32 | +Use `--check` to report version differences without updating, `--series |
| 33 | +<series>` to select a series, or `--path <directory>` to use a local STM32Cube |
| 34 | +repository instead of fetching from GitHub. By default, updates are prepared |
| 35 | +in a working copy; use `--local` to update the current core repository. |
| 36 | + |
| 37 | +`python CI/update/stm32cubev2.py` performs the corresponding update for the |
| 38 | +newer STM32Cube repository layout, including HAL, LL, and CMSIS files. It |
| 39 | +supports the same `--check`, `--series`, `--path`, and `--local` options. |
| 40 | + |
| 41 | +## Generate support files |
| 42 | + |
| 43 | +`python CI/update/stm32wrapper.py` regenerates the HAL, LL, CMSIS, and related |
| 44 | +wrapper files using content already present in the core. Optional |
| 45 | +`--core <directory>` and `--cmsis <directory>` arguments select alternate core |
| 46 | +and CMSIS directories. |
| 47 | + |
| 48 | +`python CI/update/stm32svd.py` updates the SVD files in the configured |
| 49 | +STM32duino SVD repository. Set `STM32CUBECLT_PATH` to an STM32CubeCLT |
| 50 | +installation and `STM32_SVD_PATH` to the SVD repository in |
| 51 | +`CI/update/update_config.json`. The script replaces the repository's `svd` |
| 52 | +directory with files selected from that CubeCLT installation. |
| 53 | + |
| 54 | +`python CI/update/fqbn.py` prints the STM32 board FQBNs available in an |
| 55 | +installed Arduino core, including each board's `pnum` choices. Use `--board |
| 56 | +<pattern>` to filter the output with a regular expression and `--path |
| 57 | +<directory>` to specify the directory containing `arduino-cli`. |
| 58 | + |
| 59 | +## Update ArduinoCore-API |
| 60 | + |
| 61 | +`python CI/update/stm32api.py` synchronizes the ArduinoCore-API submodule with |
| 62 | +the latest upstream tag, applies eligible STM32duino pull requests and local |
| 63 | +patches, and reshapes the tree for STM32 use. It requires the submodule to be |
| 64 | +initialized, a clean submodule worktree, and the GitHub CLI (`gh`) to retrieve |
| 65 | +pull-request data. |
| 66 | + |
20 | 67 | ## Update the STM32duino library list |
21 | 68 |
|
22 | | -Run `python CI/update/stm32libraries.py` from the `Arduino_Core_STM32` repository |
23 | | -to fetch public STM32duino repositories that contain a root-level |
| 69 | +Run `python CI/update/stm32libraries.py` from the `Arduino_Core_STM32` |
| 70 | +repository to fetch public STM32duino repositories that contain a root-level |
24 | 71 | `library.properties` and refresh the generated section in |
25 | 72 | `docs/libraries/index.md`. The script groups libraries by their declared |
26 | 73 | category, puts expansion-board libraries in a separate section, includes |
27 | 74 | declared dependencies (linking STM32duino dependencies when available), and |
28 | 75 | sorts entries alphabetically. Review and commit the updated documentation |
29 | 76 | manually; this script is not run by CI. |
30 | 77 |
|
31 | | -`REPO_STM32DUINO` in `update_config.json` selects the local directory where |
32 | | -library repositories are cloned or fetched. Absolute paths are used as |
33 | | -configured; relative paths are resolved from the `Arduino_Core_STM32` repository |
34 | | -root. If the file or setting is missing, the script writes the default |
35 | | -`REPO_STM32DUINO` path (the parent of the core repository root), asks you to check the |
36 | | -configuration, and exits; run it again after reviewing the generated setting. |
| 78 | +`REPO_STM32DUINO` in `CI/update/update_config.json` selects the local directory |
| 79 | +where library repositories are cloned or fetched. Absolute paths are used as |
| 80 | +configured; relative paths are resolved from the `Arduino_Core_STM32` |
| 81 | +repository root. If the file or setting is missing, the script writes the |
| 82 | +default `REPO_STM32DUINO` path (the parent of the core repository root), asks |
| 83 | +you to check the configuration, and exits; run it again after reviewing the |
| 84 | +generated setting. |
0 commit comments