PM0007 AT32 Bootloader Program Manual EN V2.0.2
PM0007 AT32 Bootloader Program Manual EN V2.0.2
PM0007
Program Manual
Introduction
Bootloader program is stored in the bootloader code area of the microcontroller. It has been
programmed before leaving factory. It is used to download applications to internal memory using
peripheral interfaces (UART, USB, etc.). These peripherals each have their respective protocols,
which is available from the corresponding peripheral protocol.
Applicable products:
AT32F403xx
AT32F413xx
AT32F415xx
AT32F403Axx
MCUs AT32F407xx
AT32F421xx
AT32F435xx
AT32F437xx
AT32F425xx
Contents
List of tables
Table 1 Bootloader mode ..................................................................................................................... 6
Table 2 AT32F403xx peripheral configuration ..................................................................................... 8
Table 3 AT32F413xx peripheral configuration ..................................................................................... 9
Table 4 AT32F415xx peripheral configuration ................................................................................... 10
Table 5 AT32F403Axx peripheral configuration ................................................................................. 11
Table 6 AT32F407xx peripheral configuration ................................................................................... 12
Table 7 AT32F421xx peripheral configuration ................................................................................... 13
Table 8 AT32F435xx peripheral configuration ................................................................................... 14
Table 9 AT32F437xx peripheral configuration ................................................................................... 16
Table 10 AT32F425xx peripheral configuration ................................................................................. 18
Table 11 Document revision history ................................................................................................... 19
List of figures
Figure 1 UART hardware connection block diagram........................................................................... 7
Figure 2 USB hardware connection block diagram ............................................................................. 7
Figure 3 AT32F403xx program mode selection................................................................................... 8
Figure 4 AT32F413xx program mode selection................................................................................... 9
Figure 5 AT32F415xx program mode selection................................................................................. 10
Figure 6 AT32F403Axx program mode selection .............................................................................. 11
Figure 7 AT32F407xx program mode selection................................................................................. 12
Figure 8 AT32F421xx program mode selection................................................................................. 13
Figure 9 AT32F435xx program mode selection................................................................................. 15
Figure 10 AT32F437xx program mode selection............................................................................... 17
Figure 11 AT32F425xx program mode selection ............................................................................... 18
1 Bootloader mode
1.1 Enter Bootloader mode
Table 1 Bootloader mode
Part number Conditions
AT32F403xx BOOT0=1, BOOT1=0
AT32F413xx BOOT0=1, BOOT1=0
AT32F415xx BOOT0=1, BOOT1=0
AT32F403Axx BOOT0=1, BOOT1=0, BTOPT=1
AT32F407xx BOOT0=1, BOOT1=0, BTOPT=1
AT32F421xx BOOT0=1, nBOOT1=1
AT32F435xx BOOT0=1, BOOT1=0, BTOPT=1
AT32F437xx BOOT0=1, BOOT1=0, BTOPT=1
AT32F425xx BOOT0=1, nBOOT1=1
Note:
Refer to the particular datasheet for details on BOOT0 and BOOT1 pins.
nBOOT1 in the user system area can be modified by software. Refer to the particular reference
manual for more information.
BTOPT in the user system area corresponds to the device with Bank2. When BTOPT=0, it indicates
booting from Bank2.
In addition, by means of user code, it is also possible to jump to bootloader code area to perform
bootloader. But all peripherals must be reset prior to jumping, and all peripheral clocks, PLL,
interrupts must be disabled, and pending interrupts must be cleared.
After entering a programming mode, the bootloader will no longer detect other programming
modes. For example, if the bootloader supports UART1, UART2 and USB_DFU, when 0x7F on
UART1 is detected, the bootloader enters UART1 programming mode, and discards UART2,
USB_DFU at the same time.
It should be noted that in UARTx program mode, if there is data transfer on UARTx_RX during
baud rate detection, the UARTx program mode is entered. If the data is different from 0x7F, the
UARTx configures a wrong baud rate, causing communication failure. Therefore, it is a good advice
to keep unused peripheral RX interfaces (UART_RX) at a fixed level (high or low) when bootloader
is started. If these pins remain floating or have data transfer, it may cause an unused interface to be
entered.
Note: It is recommended to start bootloader command 200ms after power on.
+v
R
RS232
USART host TX AT32
VBUS
DP
USB host DM
AT32
Note:
It is a good advice to keep unused peripheral RX interfaces (UART_RX) in a fixed level (high or low)
when bootloader is started. If these pins remain floating or have data transfer, it may cause an
unused interface to be entered.
2 AT32F403xx Bootloader
AT32F403xx supports UART1, UART2 and USB_DFU.
System Reset
System init
Yes No
Connected HEXT?
Configure USB
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
3 AT32F413xx Bootloader
AT32F413xx supports UART1, UART2 and USB_DFU.
System Reset
System init
Configure USB
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
4 AT32F415xx Bootloader
AT32F415xx supports UART1, UART2 and USB_OTG_DFU.
System Reset
System init
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
5 AT32F403Axx Bootloader
AT32F403Axx supports UART1, UART2 and USB_DFU.
System Reset
System init
Configure USB
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
6 AT32F407xx Bootloader
AT32F407xx supports UART1, UART2 and USB_DFU.
System Reset
System init
Configure USB
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
7 AT32F421xx Bootloader
AT32F421xx supports UART1 and UART2.
System Reset
System init
No
UARTx received 0x7F ?
Yes
8 AT32F435xx Bootloader
AT32F435xx supports UART1, UART2, UART3, USB_OTG1_DFU, and USB_OTG2_DFU.
System Reset
System init
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
9 AT32F437xx Bootloader
AT32F437xx supports UART1, UART2, UART3, USB_OTG1_DFU, and USB_OTG2_DFU.
System Reset
System init
Yes
USB connected?
No
No
UARTx received 0x7F ?
Yes
10 AT32F425xx Bootloader
AT32F425xx supports UART1 and UART2.
System Reset
System init
No
UARTx received 0x7F ?
Yes
11 Revision history
Table 11 Document revision history
Date Revision Changes
2021.12.07 2.0.0 Initial release
2022.06.02 2.0.1 Updated the application products corresponding to UART2 and UART3 in Table 9.
Updated the bootloader conditions corresponding to AT32F421xx and AT32F425xx
2022.06.15 2.0.2
in Table 1.
Purchasers understand and agree that purchasers are solely responsible for the selection and use of Artery’s products and services.
Artery’s products and services are provided “AS IS” and Artery provides no warranties express, implied or statutory, including, without
limitation, any implied warranties of merchantability, satisfactory quality, non-infringement, or fitness for a particular purpose with respect to
the Artery’s products and services.
Notwithstanding anything to the contrary, purchasers acquires no right, title or interest in any Artery’s products and services or any intellectual
property rights embodied therein. In no event shall Artery’s products and services provided be construed as (a) granting purchasers, expressly
or by implication, estoppel or otherwise, a license to use third party’s products and services; or (b) licensing the third parties’ intellectual
property rights; or (c) warranting the third party’s products and services and its intellectual property rights.
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 support device
or system, or (b) any safety device or system in any automotive application and mechanism (including but not limited to automotive brake or
airbag systems), or (c) any nuclear facilities, or (d) any air traffic control device, application or system, or (e) any weapons device, application
or system, or (f) any other device, application or system where it is reasonably foreseeable that failure of the Artery’s products as used in
such device, application or system would lead to death, bodily injury or catastrophic property damage.