Many teams first met the Cortex-M world through STM32CubeMX: pick a part, tick peripherals, generate initialisation code. When supply or price pushes you toward an AT32, the good news is that your application logic - the control loops, the communication protocols, the state machines - travels with you. The part that changes is the low-level initialisation.
A practical porting sequence
- Set up the toolchain. Install Artery's Work Bench or configure Keil/IAR/GCC with the AT32 device pack and headers.
- Replace device headers and SPL/HAL. Swap the original vendor library for Artery's peripheral library or template, keeping your own application files.
- Rebuild the clock tree. Recreate PLL, prescalers and Flash wait states in Artery's configuration tool for the target clock.
- Re-map pins. Walk every peripheral pin against the AT32 datasheet; alternate-function assignments differ.
- Re-point middleware. USB, motor-control and similar libraries are vendor-provided; retest enumeration and timing.
- Validate on hardware. Run against a sample before committing volume.
What stays the same
Your algorithms, your RTOS tasks, your register-level logic and your overall architecture do not change. The work is in the driver layer, and it is finite. Treat it as a focused bring-up, not a rewrite.
Target devices
The AT32F403A, AT32F415, AT32F407 and AT32F435 are the most common ports because their peripheral sets map cleanly onto mainstream designs. Send us the part you are replacing and we will quote the AT32 target with date codes so engineering can start the port on real silicon. Browse the microcontroller range.
Frequently asked questions
Can I keep my CubeMX-generated code when moving to AT32?
You can keep much of the application logic, but you should replace the vendor device headers and peripheral library. The cleaner path is to rebuild the clock configuration and peripheral initialisation against Artery's SPL or template, then port your own application code on top. Plan validation time rather than assuming a direct paste.
What changes in the clock and pin configuration?
Clock-tree registers and alternate-function muxing are vendor-specific. Recreate the clock tree in Artery's configuration tool, re-map every peripheral pin against the AT32 datasheet, and double-check remapped or rerouted functions that looked identical on the original part.
How do I handle middleware such as USB or motor libraries?
USB stacks and motor-control libraries are usually provided per vendor. Re-point them to the AT32 equivalents, re-test enumeration and timing, and keep the higher-level application (your control loop, your protocol) intact. The algorithm rarely changes; the driver layer does.
Which AT32 parts are most common for this kind of port?
The F4 family is the usual target because it mirrors the peripheral richness of the devices people are moving away from. Representative choices include the AT32F403A and similar mainstream devices.
About us & trademarks: JTDZ Tech (Shenzhen Jingteng Electronics Technology Co., Ltd.) is an independent distributor of electronic components. We are not an authorised distributor or representative of the manufacturers named in this article. Manufacturer and part names are used for indicative purposes only, to help identify the components discussed; all trademarks remain the property of their respective owners. Always verify specifications against the manufacturer's datasheet before design-in or purchase.
Recommended next steps
If you are sourcing any of the parts mentioned in this guide, we can help you confirm stock, pricing, and lead times quickly.
- Upload your BOM — send your full parts list and receive a consolidated quote within 2 business hours.
- Browse related in-stock lines: Microcontrollers / MCUs.
- Contact our team for hard-to-find or end-of-life components.