How do I get CubeMX pin names into my KiCad schematic without typing them all by hand?

Oct 26, 2026 Last reply: 20 hours ago 3 Replies

First reply

chisel_lynx

I set this up on a board last year with about 90 pins to label, so I can walk you through how it actually works day to day. It's a command line script, not a plugin. You don't install anything inside KiCad. The flow is: finish your pin config in CubeMX, export the pinout CSV…

Read the full reply

Working on an STM32 board right now, maybe 60 or 70 pins I care about, and hand-typing every net name into KiCad is slowly killing me. I saw a while back that someone posted a plugin or command line tool that takes the pinout CSV you export from CubeMX and slaps the labels onto the schematic pins automatically. I found a GitHub repo for something like that but I'm honestly not sure how people are actually using it day to day.



Like, do you export the CSV first, run the script, then import the result into KiCad? Or does it work as a plugin inside KiCad itself? I'm on KiCad 8 and I can't tell from the readme wether that's supported or if it expects an older version. My Python is shaky at best so if there's a setup step I'm missing, that's prolly my problem.



Also curious how you all handle pins you left unconfigured in CubeMX. If I only enable what I need, does the tool just skip the rest or does it choke on the unused ones? Seems like it should be a common workflow by now, MCU pinout to schematic labels, so I figure someone here has it figured out. Would love to hear how you set it up.


I set this up on a board last year with about 90 pins to label, so I can walk you through how it actually works day to day. It's a command line script, not a plugin. You don't install anything inside KiCad. The flow is: finish your pin config in CubeMX, export the pinout CSV, run the script from a terminal pointing it at that CSV and your schematic file, and it writes the net labels directly onto the MCU symbol pins. Then you just open KiCad and they're sitting there. No import step, no seperate intermediate file you have to wrangle. For KiCad 8 you're fine. The script writes to the newer schematic file format that KiCad has used since version 6, so as long as your project saves as a .kicad_sch file it shold apply cleanly. I ran it on 8 with no issues. The Python setup is minimal too. You need Python 3 on your PATH, and depending on the repo either nothing else or one small dependency installed with pip. Even with shaky Python you never touch the code, you just run it with a couple of arguments, and the readme examples usually show the exact command to copy.

Unused pins are a non issue. CubeMX only puts pins you've actually assigned a mode to into the CSV export, so anything you left unconfigured never shows up in the file and the script never sees it. Power and reset pins usually come through too since CubeMX tracks those automatically.

Two habits that made this painless for me. First, name your signals in CubeMX exactly what you want the labels to say before you export, because that's the text that lands on the schematic. Renaming later means re-exporting and re-running. Second, run the script after you've placed the MCU symbol but before you start routing, and if you go back and change the CubeMX config, just re-export and re-run it. It handles the update fine as long as you haven't manually renamed those same nets in the meantime.

I totally agree with the advice on naming the signals in CubeMX before I run the script. I ran into trouble once with a board and I ended up having to export the CSV twice because I had a few pins labeled 'unused' that were actually just not properly configured in the peripheral setup. If you forget that step, the tool just ignores them completly. My workflow is always to double-check that every pin I want labeled has a defined function before I hit export. If it's not in the CSV, it's not in the schematic until I manually add it later. It keeps things clean and prevents unexpected gaps in the pinout.

I am working on a much smaller design, only about 30 pins, so I feel like I might be overthinking this whole automation thing. The command line approach makes sense, but I am getting a bit nervous about the Python dependencies you mentioned. I only have a basic version of the language installed right now. If I run into a dependency issue where I need to use pip, I worry I will break the whole thing before I even get it running. Is there any way to run this script with minimal prerequisites? I do not want to spend the whole weekend troubleshooting enviornment variables instead of actualy doing the schematic layout. The minimal setup seems like the biggest hurdle for me.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required