本帖最后由 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)
- 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:
C:\Users\(username)\.platformio\packages\tool-jlink\JLinkDevices.xml
Add the following lines in the .xml:
<!-- -->
<!-- AT32 -->
<!-- -->
<!-- AT32F403 -->
<Device>
<ChipInfo Vendor="AT" Name="AT32F403AxCx" WorkRAMAddr="0x20000000" WorkRAMSize="0x38000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x040000" Loader="Devices/AT/AT32F4xx/AT32F403A_256.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="AT" Name="AT32F403AxEx" WorkRAMAddr="0x20000000" WorkRAMSize="0x38000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x080000" Loader="Devices/AT/AT32F4xx/AT32F403A_512.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="AT" Name="AT32F403AxGx" WorkRAMAddr="0x20000000" WorkRAMSize="0x38000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x100000" Loader="Devices/AT/AT32F4xx/AT32F403A_1024.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<!-- AT32F435 -->
<Device>
<ChipInfo Vendor="AT" Name="AT32F435xCx" WorkRAMAddr="0x20000000" WorkRAMSize="0x80000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x040000" Loader="Devices/AT/AT32F4xx/AT32F435_256.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="AT" Name="AT32F435xGx" WorkRAMAddr="0x20000000" WorkRAMSize="0x80000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x100000" Loader="Devices/AT/AT32F4xx/AT32F435_1024.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="AT" Name="AT32F435xMx" WorkRAMAddr="0x20000000" WorkRAMSize="0x80000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x400000" Loader="Devices/AT/AT32F4xx/AT32F435_4032.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<!-- AT32F425 -->
<Device>
<ChipInfo Vendor="AT" Name="AT32F425x6x" WorkRAMAddr="0x20000000" WorkRAMSize="0x05000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x008000" Loader="Devices/AT/AT32F4xx/AT32F425_32.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="AT" Name="AT32F425x8x" WorkRAMAddr="0x20000000" WorkRAMSize="0x05000" Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x010000" Loader="Devices/AT/AT32F4xx/AT32F425_64.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
3. Start Visual Studio Code and check that PlatformIO see the new Platform.
4. Done!
Example Test
Now let's test the available example. Open the following Project folder in Visual Studio Code:
C:\Users\(username)\.platformio\platforms\at32\examples\AT32F425\led_toggle
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:
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 |
Now click on the Upload button (near the Build button) and enjoy the result!
Final Considerations
Hope you could make this tutorial work and if you enjoied it feel free to donate!
此部分内容已被设置为付费内容,您可以在支付 80 元 人民币后浏览本楼层全部付费内容。点击购买
This project is manteined in Github here: https://github.com/martinloren/Artery-AT32-PlatformIO
For any bug or request post on Github, thanks!
|