0% found this document useful (0 votes)
69 views

PM0007 AT32 Bootloader Program Manual EN V2.0.2

This document describes the bootloader programs for various AT32 microcontroller models. It explains how to enter bootloader mode, configure peripherals, and select the program mode. The bootloader allows downloading applications to internal memory using interfaces like UART and USB.

Uploaded by

sunniislam2050
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

PM0007 AT32 Bootloader Program Manual EN V2.0.2

This document describes the bootloader programs for various AT32 microcontroller models. It explains how to enter bootloader mode, configure peripherals, and select the program mode. The bootloader allows downloading applications to internal memory using interfaces like UART and USB.

Uploaded by

sunniislam2050
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

AT32 Bootloader Program Manual

PM0007
Program Manual

AT32 Bootloader 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

2022.06.15 1 Rev 2.0.2


AT32 Bootloader Program Manual

Contents

1 Bootloader mode ................................................................................................... 6

1.1 Enter Bootloader mode............................................................................................. 6


1.2 Hardware connection................................................................................................ 7

2 AT32F403xx Bootloader ........................................................................................ 8

2.1 Peripheral configuration ............................................................................................ 8


2.2 Program mode selection ........................................................................................... 8

3 AT32F413xx Bootloader ........................................................................................ 9

3.1 Peripheral configuration ............................................................................................ 9


3.2 Program mode selection ........................................................................................... 9

4 AT32F415xx Bootloader ...................................................................................... 10

4.1 Peripheral configuration.......................................................................................... 10


4.2 Program mode selection ......................................................................................... 10

5 AT32F403Axx Bootloader ....................................................................................11

5.1 Peripheral configuration ...........................................................................................11


5.2 Program mode selection ..........................................................................................11

6 AT32F407xx Bootloader ...................................................................................... 12

6.1 Peripheral configuration .......................................................................................... 12


6.2 Program mode selection ......................................................................................... 12

7 AT32F421xx Bootloader ...................................................................................... 13

7.1 Peripheral configuration .......................................................................................... 13


7.2 Program mode selection ......................................................................................... 13

8 AT32F435xx Bootloader ...................................................................................... 14

8.1 Peripheral configuration .......................................................................................... 14


8.2 Program mode selection ......................................................................................... 15

2022.06.15 2 Rev 2.0.2


AT32 Bootloader Program Manual
9 AT32F437xx Bootloader ...................................................................................... 16

9.1 Peripheral configuration .......................................................................................... 16


9.2 Program mode selection ......................................................................................... 17

10 AT32F425xx Bootloader ...................................................................................... 18

10.1 Peripheral configuration .......................................................................................... 18


10.2 Program mode selection ......................................................................................... 18

11 Revision history ................................................................................................... 19

2022.06.15 3 Rev 2.0.2


AT32 Bootloader Program Manual

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

2022.06.15 4 Rev 2.0.2


AT32 Bootloader Program Manual

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

2022.06.15 5 Rev 2.0.2


AT32 Bootloader Program Manual

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.

2022.06.15 6 Rev 2.0.2


AT32 Bootloader Program Manual
1.2 Hardware connection
To use USART bootloader program mode, the host must be connected to UARTx_RX and
UARTx_TX.

Figure 1 UART hardware connection block diagram

+v

R
RS232
USART host TX AT32

Note: +V typical value is 3.3 V, and R typical value is 100KOhm.


To use USB DFU, the MCU USB interface must be connected to USB host interface.

Figure 2 USB hardware connection block diagram

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.

2022.06.15 7 Rev 2.0.2


AT32 Bootloader Program Manual

2 AT32F403xx Bootloader
AT32F403xx supports UART1, UART2 and USB_DFU.

2.1 Peripheral configuration


Table 2 AT32F403xx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PD5:UART_TX
AT32F403ZG,AT32F403VG
PD6:UART_RX
UART2
PA2:UART_TX
Others
PA3:UART_RX
PA11:USB_DM
USB_DFU All
PA12:USB_DP

2.2 Program mode selection


If HEXT clock is connected, the Bootloader will check whether the current HEXT is able to configure
system clock to 48 MHZ using PLL, if not, it will continue to use HICK as a clock source.

Figure 3 AT32F403xx program mode selection

System Reset

System init

Yes No
Connected HEXT?

Configure hext as clock source Configure hick as clock source


and system clock to 48MHz and system clock to 48MHz

Configure USB

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UART Program mode Enter USB DFU Program mode

2022.06.15 8 Rev 2.0.2


AT32 Bootloader Program Manual

3 AT32F413xx Bootloader
AT32F413xx supports UART1, UART2 and USB_DFU.

3.1 Peripheral configuration


Table 3 AT32F413xx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PA2:UART_TX
UART2 All
PA3:UART_RX
PA11:USB_DM
USB_DFU All
PA12:USB_DP

3.2 Program mode selection


Figure 4 AT32F413xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

Configure USB

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UARTx Program mode Enter USB DFU Program mode

2022.06.15 9 Rev 2.0.2


AT32 Bootloader Program Manual

4 AT32F415xx Bootloader
AT32F415xx supports UART1, UART2 and USB_OTG_DFU.

4.1 Peripheral configuration


Table 4 AT32F415xx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PA2:UART_TX
UART2 All
PA3:UART_RX
PA11:USB_DM
USB_OTG_DFU All PA12:USB_DP
PA9:USB_VBUS

4.2 Program mode selection


Figure 5 AT32F415xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

Configure USB OTG

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UARTx Program mode Enter USB DFU Program mode

2022.06.15 10 Rev 2.0.2


AT32 Bootloader Program Manual

5 AT32F403Axx Bootloader
AT32F403Axx supports UART1, UART2 and USB_DFU.

5.1 Peripheral configuration


Table 5 AT32F403Axx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PD5:UART_TX
AT32F403AZG,AT32F403AVG
PD6:UART_RX
UART2
PA2:UART_TX
Others
PA3:UART_RX
PA11:USB_DM
USB_DFU All
PA12:USB_DP

5.2 Program mode selection


Figure 6 AT32F403Axx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

Configure USB

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UARTx Program mode Enter USB DFU Program mode

2022.06.15 11 Rev 2.0.2


AT32 Bootloader Program Manual

6 AT32F407xx Bootloader
AT32F407xx supports UART1, UART2 and USB_DFU.

6.1 Peripheral configuration


Table 6 AT32F407xx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PD5:UART_TX
AT32F407ZG,AT32F407VG
PD6:UART_RX
UART2
PA2:UART_TX
Others
PA3:UART_RX
PA11:USB_DM
USB_DFU All
PA12:USB_DP

6.2 Program mode selection


Figure 7 AT32F407xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

Configure USB

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UARTx Program mode Enter USB DFU Program mode

2022.06.15 12 Rev 2.0.2


AT32 Bootloader Program Manual

7 AT32F421xx Bootloader
AT32F421xx supports UART1 and UART2.

7.1 Peripheral configuration


Table 7 AT32F421xx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PA2:UART_TX
UART2 All
PA3:UART_RX

7.2 Program mode selection


Figure 8 AT32F421xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

No
UARTx received 0x7F ?

Yes

Enter UARTx Program mode

2022.06.15 13 Rev 2.0.2


AT32 Bootloader Program Manual

8 AT32F435xx Bootloader
AT32F435xx supports UART1, UART2, UART3, USB_OTG1_DFU, and USB_OTG2_DFU.

8.1 Peripheral configuration


Table 8 AT32F435xx peripheral configuration
Peripherals Application products Pins
PA9:UART1_TX
UART1 All
PA10:UART1_RX
PD5:UART2_TX
AT32F435ZxT7,AT32F435VxT7
PD6:UART2_RX
UART2
PA2:UART2_TX
Others
PA3:UART2_RX
PC10: UART3_TX
AT32F435ZxT7,AT32F435VxT7, AT32F435RxT7
PC11: UART3_RX
UART3
PB10: UART3_TX
Others
PB11: UART3_RX
PA11:USB_DM
USB_OTG1_DFU All
PA12:USB_DP
PB14:USB_DM
USB_OTG2_DFU ALL
PB15:USB_DP

2022.06.15 14 Rev 2.0.2


AT32 Bootloader Program Manual
8.2 Program mode selection
Figure 9 AT32F435xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

Configure USB OTG

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UARTx Program mode Enter USB DFU Program mode

2022.06.15 15 Rev 2.0.2


AT32 Bootloader Program Manual

9 AT32F437xx Bootloader
AT32F437xx supports UART1, UART2, UART3, USB_OTG1_DFU, and USB_OTG2_DFU.

9.1 Peripheral configuration


Table 9 AT32F437xx peripheral configuration
Peripherals Application products Pins
PA9:UART1_TX
UART1 All
PA10:UART1_RX
PD5:UART2_TX
AT32F437ZxT7,AT32F437VxT7
PD6:UART2_RX
UART2
PA2:UART2_TX
Others
PA3:UART2_RX
PC10: UART3_TX
AT32F437ZxT7,AT32F437VxT7, AT32F437RxT7
PC11: UART3_RX
UART3
PB10: UART3_TX
Others
PB11: UART3_RX
PA11:USB_DM
USB_OTG1_DFU All
PA12:USB_DP
PB14:USB_DM
USB_OTG2_DFU All
PB15:USB_DP

2022.06.15 16 Rev 2.0.2


AT32 Bootloader Program Manual
9.2 Program mode selection
Figure 10 AT32F437xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

Configure USB OTG

Yes
USB connected?

No
No
UARTx received 0x7F ?

Yes

Disable USB_DFU Disable UARTx

Enter UARTx Program mode Enter USB DFU Program mode

2022.06.15 17 Rev 2.0.2


AT32 Bootloader Program Manual

10 AT32F425xx Bootloader
AT32F425xx supports UART1 and UART2.

10.1 Peripheral configuration


Table 10 AT32F425xx peripheral configuration
Peripherals Application products Pins
PA9:UART_TX
UART1 All
PA10:UART_RX
PA2:UART_TX
UART2 All
PA3:UART_RX

10.2 Program mode selection


Figure 11 AT32F425xx program mode selection

System Reset

System init

Configure hick as clock source


and system clock to 48MHz

No
UARTx received 0x7F ?

Yes

Enter UARTx Program mode

2022.06.15 18 Rev 2.0.2


AT32 Bootloader Program Manual

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.

2022.06.15 19 Rev 2.0.2


AT32 Bootloader Program Manual

IMPORTANT NOTICE – PLEASE READ CAREFULLY

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.

© 2022 Artery Technology -All rights reserved

2022.06.15 20 Rev 2.0.2

You might also like