Hide thumbs Also See for AT32F403 Series:
Table of Contents

Advertisement

AT32F403 Application note
AN0020
Get started guide for AT32F403 series
Introduction
This user manual provides information on how to use AT32F403 MCU for project development in a
quickly manner.
Applicable products:
Part number
AT32F403
2020.8.20
1
Rev 1.02
www.arterytek.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AT32F403 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ARTERY AT32F403 Series

  • Page 1 AT32F403 Application note AN0020 Get started guide for AT32F403 series Introduction This user manual provides information on how to use AT32F403 MCU for project development in a quickly manner. Applicable products: Part number AT32F403 2020.8.20 Rev 1.02 www.arterytek.com...
  • Page 2: Table Of Contents

    AT32F403 Application note Contents Development environment ........................... 5 1.1. Set up AT32 development environment ....................... 5 1.1.1.Debug tools ............................5 1.1.2.Programming tools and software ......................5 1.1.3.AT32 KEIL and IAR development environment ................... 5 1.1.4.How to quickly replace SXX ......................10 1.2.
  • Page 3 AT32F403 Application note List of tables Table 1 .Selection of BSP and PACK ......................... 8 Table 2 . Documentation revision history ......................27 2020.8.20 Rev 1.02 www.arterytek.com...
  • Page 4 AT32F403 Application note st of figures Figure 1. AT-Link physical picture ........................5 Figure 2. Install the Keil.AT32F4xx_DFP ......................6 Figure 3. Install the Keil_AT32F4xx_AddOn ...................... 6 Figure 4. Keil Debug option ..........................6 Figure 5. Keil Debug settings ..........................6 Figure 6.
  • Page 5: Development Environment

    1.1. Set up AT32 development environment 1.1.1. Debug tools At present, the debug tools supported by AT32F403 series are AT-Link/J-Link. AT-Link is shown in the figure below. Figure 1. AT-Link physical picture 1.1.2. Programming tools and software  AT programming tools and software:AT-Link/AT-Link-Pro / J-Link, ICP/ISP ...
  • Page 6: Figure 2. Install The Keil.at32F4Xx_Dfp

    AT32F403 Application note Figure 2. Install the Keil.AT32F4xx_DFP Figure 3. Install the Keil_AT32F4xx_AddOn When AT-Link is used in Keil environment, select “CMSIS-DAP debugger “in “Debug”. Figure 4. Keil Debug option Click on “Settings” in the “Debug” to enter “cortex – M Target Driver Setup” dialogue box shown below: 1.
  • Page 7: Figure 6. Keil Utilities Option

    ② For IAR compiling system, it is recommended to use IAR 7.0, IAR 6.1 or above. You need to install the Pack and add the AT32 MCU part numbers in the LAR. The pack is available from Artery website. The IAR_AT32F4xx_AddOn needs to be installed. By default, the LAR installation path can be automatically recognized, if failed or incorrect, you need to manually select LAR installation path.
  • Page 8: Figure 9. Iar Cmsis-Dap Option

    AT32F403 Application note Figure 9. IAR CMSIS-DAP option ③ At present, in IAR compiling environment, the Pack does not support bank 3 operations (external SPI Flash via SPIM interface); If bank3 is needed, please compile it in the Keil environment. ④...
  • Page 9: Figure 10. Sxx Flash Wait Bits

    For detailed information on BSP and Pack, please refer to AT32F4xx BSP & Pack Application note, which is located in the AT32F4xx_StdPeriph_Lib_V1.x.x folder available from Artery website. Note: because AT32F403 has different Flash mechanism from SXX, there is no need to set the following two Flash wait bits for AT products: Figure 10.
  • Page 10: How To Quickly Replace Sxx

    Step 2: Add at least 2ms of delay after reading RCC->CR.HSERDY, and add at least 200us of delay after reading RCC->CR.PLLRDY  Step 3: Download SXX32F103 HEX file or BIN file using Artery ICP, ISP or KEIL/ IAR  Step 4: If necessary, download information other than SXX32F103HEX file or BIN file or perform system calibration ...
  • Page 11: How To Enable Fpu (Hardware Floating Point Unit)

    AT32F403 Application note 1.2.2 How to enable FPU (Hardware Floating Point Unit) There are two situations in Keil environment as follows: ① Use AT32F403 BSP/Pack or the modified SXX BSP/Pack to select “Floating Point Hardware” as shown below: Figure 11. Enable FPU in Keil environment ②...
  • Page 12: Figure 14. Enable Fpu In Iar Environment

    AT32F403 Application note There are also two situations in IAR environment as follows: ① Use AT32F403 BSP/Pack or the modified SXX BSP/Pack to modify the Floating Point Hardware as shown below: Figure 14. Enable FPU in IAR environment ② Because SXX32F10X series does not support FPU function, if users want to enable FPU in the project developed under SXX library, the following procedures are required: ...
  • Page 13: Configuration For At32F403 Zw/Nzw Flash And Embedded Sram Size

    AT32F403 Application note 1.2.3 Configuration for AT32F403 ZW/NZW Flash and embedded SRAM size Except for AT32F403CBT6, other products support the allocation of internal Flash memory and SRAM through Option Bytes configuration. Taking AT32F403RET6 as an example, the internal Flash memory and SRAM can be configured as follows: - ZW: 256 KB, NZW: 768 KB, SRAM: 96 KB (Factory default);...
  • Page 14: Figure 16. Icp Tool Option Bytes Select Sram Size

    AT32F403 Application note ① Using ICP/ISP tool  ICP tool Click “Target”---select” 96 KB/224 KB” in option byte---“Apply to device”. Figure 16. ICP tool option bytes select SRAM size Figure 17. ICP tool option bytes select SRAM size 2020.8.20 Rev 1.02 www.arterytek.com...
  • Page 15: Figure 18. Isp Tool Option Bytes Select Sram Size

    AT32F403 Application note  Artery ISP Programmer tool Enter the final interface, select “96 KB/224 KB”---“Apply to device” Figure 18. ISP tool option bytes select SRAM size  Artery ISP Multi-Port Programmer Click on “Download option byte file”---“Edit”---select “96 KB/224 KB”---“Save to file” (create a new option byte programming file)---“Close”---“Begin”, or click on “Download option byte file”---...
  • Page 16 AT32F403 Application note ② Users can also modify SRAM size in the Bootloader program (IAP), as shown in the example below: void Extend_SRAM(void) // check if RAM has been set to 224K, if not, change EOPB0 if(((UOPTB->EOPB0) & 0xFF) != 0xFE) /* Unlock Option Bytes Program Erase controller */ FLASH_Unlock();...
  • Page 17 AT32F403 Application note ③ Configure the AT32F403 SRAM to 224KB in the startup file SRAM will be loaded when the startup file is running. If the program has no IAP, but the SRAM used by the application is greater than 96 KB, the loading will fail and enter the hardfault, which will cause the application to fail to run.
  • Page 18 AT32F403 Application note Add declaration and define the Extend_SRAM function in the application void Extend_SRAM(void) // check if RAM has been set to 224K, if not, change EOPB0 if(((UOPTB->EOPB0) & 0xFF) != 0xFE) /* Unlock Option Bytes Program Erase controller */ FLASH_Unlock();...
  • Page 19: Encryption (Read Protection And External Flash Encrypted)

     ICP tool Read protection: click on “target”--- “read protection”--- “enable protection” Disable read protection: click on “target”---“read protection”--- “disable read protection”  Artery ISP Programmer Read protection: click on “Enable/Disable protection”--select “Enable---read protection”--“Next”- “Yes”, and the program is encrypted.
  • Page 20: Figure 21. Isp Disable Read Protection

    Disable read protection: click on “enable/disable protection”---select “disable-read protection”--- “Next”—“Yes”, and then the Flash can be unencrypted. Figure 21. ISP disable read protection  Artery ISP Multi-Port Programmer Read protection: click on “enable/disable protection”---select “enable-read protection”---click “Begin”, and then the program is encrypted.
  • Page 21: Figure 23. Isp Multi-Port Programmer Disable Read Protection

    AT32F403 Application note Disable read protection: click on “enable/disable protection”--- select “disable-read protection”— click on “Begin”, then the Flash is unencrypted. The read protection cannot be disabled by the erase operation. Figure 23. ISP Multi-Port Programmer disable read protection 2020.8.20 Rev 1.02 www.arterytek.com...
  • Page 22: Encryption Of External Flash

    Tick “SPIM”---select SPIM type---set “FLASH_DA”---click on “Target”---“Option Bytes”---Modify “SPIM encryption key”---“Apply to device”. Figure 24. SPIM encryption operation using ICP tool  Artery ISP Programmer Click on “Edit Option Bytes”--- Modify “SPIM encryption key”---“Apply to device”. Figure 25. SPIM encryption operation through ISP tool 2020.8.20...
  • Page 23: Figure 26. Spim Encryption Operation By Isp Multi-Port Programmer

    AT32F403 Application note  Artery ISP Multi-Port Programmer “Download option byte file”---“Edit”--- Modify “SPIM encryption key”---“Save to file”---“Begin”. Figure 26. SPIM encryption operation by ISP Multi-Port Programmer 2020.8.20 Rev 1.02 www.arterytek.com...
  • Page 24: 1.2.5 How To Distinguish At And Other Ic In The Program

    AT32F403 Application note 1.2.5 How to distinguish AT and other IC in the program 1.2.5.1 UID/PID identify  Read Cortex-M series CPU ID number to distinguish M0, M3 and M4 core cortex_id = *(uint32_t *)0xE000ED00; //read cortex part number if((cortex_id == 0x410FC241) printf("This chip is Cortex-M4.\r\n");...
  • Page 25: Faqs During Download And Compiling

    AT32F403 Application note FAQs during download and compiling 2.1. The program enters Hard Fault Handler at startup 2.1.1 Abnormal circumstances that cause program to enter Hardfault  The SRAM used exceeds the SRAM size set by the option bytes Please use ICP/ISP tool to program. ...
  • Page 26: Rddi-Dap Error

    AT32F403 Application note 2.2.3 RDDI-DAP Error  Disabled the JTAG/SWD PIN in the program, please refer to “2.2.5 AT32 resume download” 2.2.4 ISP serial interface gets stuck during download When ISP serial interface is used to download, it occasionally gets stuck, causing the PC not to release the serial interface.
  • Page 27: Revision History

    AT32F403 Application note Revision history Table 2. Documentation revision history Date Revi Changes sion 2020.3.16 1.00 Initial release 2020.6.10 1.01 Adjusted the format 2020.8.20 1.02 Added the PACK installation instructions. 2020.8.20 Rev 1.02 www.arterytek.com...
  • Page 28 Purchasers hereby agrees that Artery’s products are not authorized for use as, and purchasers shall not integrate, promote, sell or otherwise transfer any Artery’s product to any customer or end user for use as critical components in (a) any medical, life saving or life...

Table of Contents

Save PDF