• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

imx/18-Mar-2025-1,4571,212

kinetis/18-Mar-2025-745617

lpc/18-Mar-2025-884710

shared/18-Mar-2025-9986

README.mdD18-Mar-20254.4 KiB12490

gen_board_pinctrl.pyD18-Mar-20256 KiB179131

gen_soc_headers.pyD18-Mar-20256.4 KiB181137

README.md

1# MCUXpresso Pin Control Generation Scripts
2
3These scripts aid in the generation of pin control data NXP platforms. The
4scripts currently support most i.MX RT processors, and some LPC and Kinetis
5processors
6
7| Script                     | Functionality                               |
8| -------------------------- | ------------------------------------------- |
9| `gen_board_pinctrl.py`     | Generates pin control dtsi files for boards |
10| `gen_soc_headers.py`       | Generates pin control dtsi files defining SOC pinmux settings |
11
12## Requirements
13
14All scripts here utilize files generated by with [MCUXpresso Config
15tools v14](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-config-tools-pins-clocks-peripherals:MCUXpresso-Config-Tools),
16and version 14 data packs downloaded from
17[MCUXpresso SDK builder](https://mcuxpresso.nxp.com/en/select_config_tools_data)
18No other version of MCUXpresso Config tools is supported.
19MCUXpresso config tools data sources must be provided to this tool, see below
20for documentation on how to download data sources.
21
22
23## Supported SOCs
24
25The following SOC lines are supported:
26- i.MX RT10xx series
27- i.MX RT11xx series
28- i.MX RT7xx series
29- i.MX RT6xx series
30- i.MX RT5xx series
31- Kinetis K8x, K6x, K2x series
32- LPC55(S)xx series
33- MCXN9xx series
34
35Other SOCs may function with this tooling, but are not explicitly supported.
36See [unsupported SOCs](#unsupported-socs) for more information.
37
38## Data Packs
39Data packs for processors can be downloaded from
40[NXP's MCUXpresso SDK builder](https://mcuxpresso.nxp.com/en/select-config-tools-data).
41Select the "offline data"
42section under "MCUXpresso Config Tools" in the sidebar, and locate your
43processor to download the relevant data pack. Make sure you select version 13.
44The scripts will use this archive directly, and it does not need to be extracted.
45
46## Board Pin Control Generation
47
48To generate pin control files for a board, first generate a board settings file,
49(also known as a MEX file) for the specific board. Populate board level
50functional groups with pin control groups. Then, run the following command:
51
52```
53python gen_board_pinctrl.py ${path_to_mex_file} ${path_to_data_pack}
54```
55
56Replacing `${path_to_data_pack}` and `${path_to_mex_file}` with the paths to
57your MCUXpresso config tools data source, and board settings file respectively.
58
59### Examples
60
61The following command will generate board pin control data for the
62RT1060 EVK, based on an RT1060 EVK mex file created with MCUXpresso config
63tools:
64
65```
66python gen_board_pinctrl.py mimxrt1060_evk.mex MIMXRT1062xxxxA_ConfigTools_data.zip
67```
68
69The user can also output the pin control files to a custom path:
70```
71python gen_board_pinctrl.py mimxrt1060_evk.mex MIMXRT1062xxxxA_ConfigTools_data-v13.zip \
72        --board-output ~/zephyrproject/zephyr/boards/arm/mimxrt1060_evk/mimxrt1060_evk-pinctrl.dtsi
73```
74
75## SOC Pin Control Definition Generation
76
77To generate pin control definitions for a new SOC not presently supported by
78Zephyr, download the relevant data pack for your SOC, and run the following
79script:
80
81```
82python gen_soc_headers.py ${path_to_data_pack}
83```
84
85Replacing `${path_to_data_pack}` with the path to your MCUXpresso config tools
86data pack.
87
88
89### Examples
90
91The following command will generate SOC pin control data for the RT1062xxxxA:
92
93```
94python gen_soc_headers.py MIMXRT1062xxxxA_ConfigTools_data.zip
95```
96
97The user can also specify a directory to output all SOC pin control data
98files into:
99
100```
101python gen_soc_headers.py MIMXRT1062xxxxA_ConfigTools_data-v13.zip \
102        --soc-output ~/zephyrproject/modules/hal/nxp/dts/nxp/nxp_imx/rt/
103```
104
105## Unsupported SOCs
106
107This tooling may support more NXP SOCs than those explicitly supported
108above. The tooling is aware of three families of pin controllers:
109
110| Family    | Description                                                     |
111| --------- | --------------------------------------------------------------- |
112| IOMUX     | i.MX heritage, present on some i.MX SOCs as well as i.MX RT1xxx |
113| IOCON     | LPC heritage, present on LPC SOCs and some i.MX RT              |
114| PORT      | Kinetis heritage, present on most Kinetis SOCs                  |
115
116
117If your SOC is not explicitly supported, you can run the tooling with
118the `--controller` option in order to attempt to generate pin control data:
119
120```
121python gen_board_pinctrl.py LPCXpresso54114.mex LPC54114J256_ConfigTools_data.zip \
122        --controller IOCON
123```
124