[活动专区] 【AT-START-F425测评】Added support for PlatformIO!

[复制链接]
 楼主| 发表于 2022-3-25 20:57 | 显示全部楼层 |阅读模式
本帖最后由 martinloren 于 2022-3-25 21:08 编辑

#VisualStudioCode #Artery #AT32F425 #PlatformIO

Introduction
This project aim to support the development of the new Artery AT32F425 in Visual Studio Code - PlatformIO IDE. PlatformIO IDE is a free open source IDE that support several MCU. By supporting also the AT32F425 the developers have a fantastic development environment available for free!
Thanks to Artery to have provided the F425 development board for making PlatformIO support for this MCU!

What you can do with this tutorial
- You will be able to compile code for AT32F425 and flash directly from Visual Studio Code.  
- Available flashing methods: serial bootloader or JLINK (with J-OB V2 adapter)

First Installation
Requirements:
  • Visual Studio Code
  • PlatformIO Extension installed (for this tutorial it is used v.3.4.1)
  • AT32 Platform files (download package below)

Artery-AT32-PlatformIO-main.zip (1.8 MB, 下载次数: 2)

  • Inside the .zip file you can find the .platformio folder. You should copy all the content of this folder in the .platformio folder inside your system. It is usually in C:\Users\(username)\.platformio
  • Add JLINK support for AT32 MCU by editing the configuration file:
  1. C:\Users\(username)\.platformio\packages\tool-jlink\JLinkDevices.xml

    Add the following lines in the .xml:

  1. <!--    -->
  2.   <!-- AT32 -->
  3.   <!--    -->
  4.   <!-- AT32F403 -->
  5.   <Device>
  6.    <ChipInfo Vendor="AT" Name="AT32F403AxCx" WorkRAMAddr="0x20000000" WorkRAMSize="0x38000" Core="JLINK_CORE_CORTEX_M4" />
  7.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x040000" Loader="Devices/AT/AT32F4xx/AT32F403A_256.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  8.   </Device>  
  9.   <Device>
  10.    <ChipInfo Vendor="AT" Name="AT32F403AxEx" WorkRAMAddr="0x20000000" WorkRAMSize="0x38000" Core="JLINK_CORE_CORTEX_M4" />
  11.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x080000" Loader="Devices/AT/AT32F4xx/AT32F403A_512.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  12.   </Device>  
  13.   <Device>
  14.    <ChipInfo Vendor="AT" Name="AT32F403AxGx" WorkRAMAddr="0x20000000" WorkRAMSize="0x38000" Core="JLINK_CORE_CORTEX_M4" />
  15.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x100000" Loader="Devices/AT/AT32F4xx/AT32F403A_1024.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  16.   </Device>  
  17.   <!-- AT32F435 -->
  18.   <Device>
  19.    <ChipInfo Vendor="AT" Name="AT32F435xCx" WorkRAMAddr="0x20000000" WorkRAMSize="0x80000" Core="JLINK_CORE_CORTEX_M4" />
  20.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x040000" Loader="Devices/AT/AT32F4xx/AT32F435_256.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  21.   </Device>  
  22.   <Device>
  23.    <ChipInfo Vendor="AT" Name="AT32F435xGx" WorkRAMAddr="0x20000000" WorkRAMSize="0x80000" Core="JLINK_CORE_CORTEX_M4" />
  24.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x100000" Loader="Devices/AT/AT32F4xx/AT32F435_1024.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  25.   </Device>  
  26.   <Device>
  27.    <ChipInfo Vendor="AT" Name="AT32F435xMx" WorkRAMAddr="0x20000000" WorkRAMSize="0x80000" Core="JLINK_CORE_CORTEX_M4" />
  28.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x400000" Loader="Devices/AT/AT32F4xx/AT32F435_4032.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  29.   </Device>
  30.   <!-- AT32F425 -->
  31.   <Device>
  32.    <ChipInfo Vendor="AT" Name="AT32F425x6x" WorkRAMAddr="0x20000000" WorkRAMSize="0x05000" Core="JLINK_CORE_CORTEX_M4" />
  33.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x008000" Loader="Devices/AT/AT32F4xx/AT32F425_32.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  34.   </Device>     
  35.   <Device>
  36.    <ChipInfo Vendor="AT" Name="AT32F425x8x" WorkRAMAddr="0x20000000" WorkRAMSize="0x05000" Core="JLINK_CORE_CORTEX_M4" />
  37.    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x010000" Loader="Devices/AT/AT32F4xx/AT32F425_64.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
  38.   </Device>  
     3. Start Visual Studio Code and check that PlatformIO see the new Platform.


platformIO check

platformIO check


    4. Done!

Example Test
Now let's test the available example. Open the following Project folder in Visual Studio Code:
  1. C:\Users\(username)\.platformio\platforms\at32\examples\AT32F425\led_toggle

example

example

In platformio.ini file you can set the flashing method. Just keep selected the stlink.

Press the Build button on the bottom blue bar (near the little house). Result as following:

Build

Build


Now connect the J-OB V2 adapter to the AT-START-F425 development board. Connections as following:

J-OB V2 adapter PIN AT-START-F425 PIN
GND GND
5V 5V
CLK A14
SWD A13

AT32F425_photo.jpg
Now click on the Upload button (near the Build button) and enjoy the result!

flashing

flashing


Final Considerations
Hope you could make this tutorial work and if you enjoied it feel free to donate!

[payamount]80.00[/payamount]
[pay]Say thanks to the developer [/pay]
This project is manteined in Github here: https://github.com/martinloren/Artery-AT32-PlatformIO
For any bug or request post on Github, thanks!



发表于 2025-6-17 21:40 | 显示全部楼层
高级
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

15

帖子

1

粉丝
快速回复 返回顶部 返回列表