Table of Contents

Advertisement

Quick Links

A31G32x
USB Bootloader Quick Guide
Application Note
Version 1.00
Global Top Smart MCU Innovator
www.abovsemi.com

Advertisement

Table of Contents
loading

Summary of Contents for Abov A31G32x

  • Page 1 A31G32x USB Bootloader Quick Guide Application Note Version 1.00 Global Top Smart MCU Innovator www.abovsemi.com...
  • Page 2: Table Of Contents

    Contents A31G32x USB Bootloader quick guide Contents Introduction ............................ 5 User requirements .......................... 6 Hardware ..........................6 2.1.1 Starter Kit ........................ 6 2.1.2 Shield Board ......................6 Software ..........................7 Reference documents ......................7 System requirements ......................8 ABOV website ........................8 User Bootloader environment &...
  • Page 3 Figure 17. Add bootcode.c in Application Project – A31G32x ............... 19 Figure 18. Example of Setting Options for Target in Application Project – A31G32x ......20 Figure 19. Example of bootcode.c File Option in Application Project – A31G32x ........ 21 Figure 20.
  • Page 4 List of tables A31G32x USB Bootloader quick guide List of tables Table 1. Command Packet Description ....................11 Table 2. Data Packet Description ......................11 Table 3. Operation Command Packet Description ................12...
  • Page 5: Introduction

    This document introduces a method to use USB User Bootloader, and offers an easy way to develop the ABOV 32-bit Cortex-M0x MCUs. By reading through this document, you will learn how to operate A31G32x USB User Bootloader with examples, step by step.
  • Page 6: User Requirements

    2. User requirements A31G32x USB Bootloader quick guide User requirements Hardware 2.1.1 Starter Kit Figure 1. A31G32x Starter Kit Board (Hardware) 2.1.2 Shield Board Figure 2. A31G32x Shield Board (Hardware)
  • Page 7: Software

    A31G32x USB Bootloader quick guide 2. User requirements Software Keil complier (uVision5) Keil MDK5 software pack (including Starter Kit sample code) or EVK software Figure 3. Compiler (Software) Reference documents Starter Kit Quick Guide Starter Kit HW Manual Starter Kit Schematic Product User’s Manual...
  • Page 8: System Requirements

    2. User requirements A31G32x USB Bootloader quick guide System requirements Windows PC (7, 8, 10) USB mini-B type cable Figure 5. Window PC & Mini-B Cable ABOV website For detailed information about corresponding software and documents, you can visit our website at https://www.abovsemi.com.
  • Page 9: User Bootloader Environment & Concept

    A31G32x USB Bootloader quick guide 3. User Bootloader environment & concept User Bootloader environment & concept Figure 7. User Bootloader Environment and Concept ① Bootloader Project makes Boot code file in Keil environment. ② The application project has user code and boot code generated from the boot project.
  • Page 10: Memory Map

    Flash Memory area Division BOOT ZONE ① Boot code storage area to rewrite APPLICATION ZONE ② Re-write Impossible ③ BOOT ZONE size : 4KB APPLICATION ZONE ① User code area ② Re-write possible through Boot code Figure 8. A31G32x Flash Memory Map...
  • Page 11: Usb User Bootloader Protocol

    A31G32x USB Bootloader quick guide 5. USB User Bootloader protocol USB User Bootloader protocol Outgoing packet definition Inline programmers take commands from the host to upgrade, inspect, and execute the program. Instructions of inline programmers have a defined data frame format, and the code used here is as follows: Table 1.
  • Page 12: Host Command List

    5. USB User Bootloader protocol A31G32x USB Bootloader quick guide Host command list In-line programmers have the following instructions for handling each action. Table 3. Operation Command Packet Description Description Remark RESET 0xA5 Reset MCU ERS_SN 0xE1 Erase internal flash sector...
  • Page 13: Pgm_Db (Program Data Block)

    A31G32x USB Bootloader quick guide 5. USB User Bootloader protocol 5.3.4 PGM_DB (Program Data Block) Description: Write the value written to the data buffer block to the designated flash address. Arguments: 32-bit (4 bytes) address + 32-bit (4 bytes) size (MSB First)
  • Page 14: Bootloader Programming Procedure

    6. Bootloader programming procedure A31G32x USB Bootloader quick guide Bootloader programming procedure Figure 9. Bootloader Programming Procedure...
  • Page 15: User Bootloader Project

    A31G32x USB Bootloader quick guide 7. User Bootloader project User Bootloader project Refer to “A31G32x_USB_user_bootloader” project. This project supports example source with a PC GUI tool and the USB User Bootloader. This section describes the detailed guide of the USB User Bootloader.
  • Page 16: Figure 12. Example Of A31G32X Keil Option For Target

    ③ The bootcode hex file is converted into an array and made into one C file, where the C file name is the same as the hex file name. ④ Because we include bootcode.c in Project, use the same name for convenience. Figure 12. Example of A31G32x Keil Option for Target...
  • Page 17: Bootloader Project - Hex To Array

    A31G32x USB Bootloader quick guide 7. User Bootloader project Bootloader project – hex to array How to convert compiled hex file to array Convert using OutputArray.exe File Location : DeviceName_keil_bootcode\Boot_Examples\Hex2Array\OutputArray.exe Figure 13. Bootloader Project – Step1 Figure 14. Bootloader Project – Step2...
  • Page 18: Figure 15. Bootloader Project - Step3

    7. User Bootloader project A31G32x USB Bootloader quick guide Figure 15. Bootloader Project – Step3 Figure 16. Bootloader Project – Step4...
  • Page 19: Application Project

    SCB->VTOR = 0x00001000; //Vector Table Offset Register bootcode.c ① Include C file converted from hex file to the Project (added to example project already). ② If there is a change in the bootloader project, update it. Figure 17. Add bootcode.c in Application Project – A31G32x...
  • Page 20: Figure 18. Example Of Setting Options For Target In Application Project - A31G32X

    A31G32x USB Bootloader quick guide Compiler Settings ① Set Application start address in IROM1 and Bootcode area in IROM2. ② Select the Hex file creation option (For use in UART downloader). Figure 18. Example of Setting Options for Target in Application Project – A31G32x...
  • Page 21: Figure 19. Example Of Bootcode.c File Option In Application Project - A31G32X

    A31G32x USB Bootloader quick guide 7. User Bootloader project ③ Set specific Address for Bootcode (Options for File ‘Bootcode.C’). Figure 19. Example of bootcode.c File Option in Application Project – A31G32x...
  • Page 22: Example Of User Bootloader For Usb

    8. Example of User Bootloader for USB A31G32x USB Bootloader quick guide Example of User Bootloader for USB Building and running project Running application code makes it easier to start the Shield Board. To run the application code, follow the steps below: Step 1.
  • Page 23: Prepare The Starter Kit

    Pin Headers connected to MCU C. USB, switch and jumper to check input/output, reset, and debugger pins A-Link (CMSIS-DAP/UART) board configuration A-Link for programming and debugging with ABOV 32-bit MCU(connected to USB port of Supports UART. Figure 20. Starter Kit B/D...
  • Page 24: Set Up The Starter Kit

    8. Example of User Bootloader for USB A31G32x USB Bootloader quick guide Set up the Starter Kit 8.3.1 Set jumpers to control the Starter Kit To set up the Starter Kit, follow the procedure introduced below: The Starter Kit uses USB power-①.
  • Page 25: Connect The Starter Kit To Your Pc

    A31G32x USB Bootloader quick guide 8. Example of User Bootloader for USB Connect the Starter Kit to your PC 8.4.1 PC connection via USB on the Starter Kit Connect the USB 2.0 (mini-B type) cable to the Starter Kit as shown in Figure 22.
  • Page 26: Compile & Firmware Update As User Bootloader Project

    8. Example of User Bootloader for USB A31G32x USB Bootloader quick guide Compile & firmware update as User Bootloader project 8.5.1 Run the Bootloader project Before downloading the Bootloader example, Keil uVision5 for ARM must be installed on your PC.
  • Page 27: Compiling The Bootloader & Application Project

    A31G32x USB Bootloader quick guide 8. Example of User Bootloader for USB 8.5.2 Compiling the Bootloader & application project Execute “Rebuild all target files” on the created uVision5 (User Bootloader for USB Project). Select Rebuild (①) to proceed with compilation.
  • Page 28: Download The Bootloader

    8. Example of User Bootloader for USB A31G32x USB Bootloader quick guide 8.5.3 Download the Bootloader If the compilation finishes without error, you can begin programming the starter kit. Check the following in case of errors in settings. Check that CMSIS-DAP Debugger (①) is selected in the Debug tab (use CMSIS-DAP for A-Link).
  • Page 29: Update Firmware As Usb User Bootloader

    A31G32x USB Bootloader quick guide 8. Example of User Bootloader for USB 8.5.4 Update firmware as USB User Bootloader In this section, you can learn how to update firmware via USB. The starter kit board is comprised of a device board and the USB modules.
  • Page 30: Figure 29. Run Quickwriter (Pc Tool) For Usb

    8. Example of User Bootloader for USB A31G32x USB Bootloader quick guide After setting the device, turn on the power. The device enters the boot mode for USB communication. See Figure 29. Run QuickWriter (PC tool) for USB. There are 3 programs for Supporting Virtual com port, HID full-speed, and HID low speed.
  • Page 31: Check The Updated Application Operation

    A31G32x USB Bootloader quick guide 8. Example of User Bootloader for USB 8.5.5 Check the updated application operation In this section, you can check the application operation (downloaded using the USB bootloader): To enter the application, PF1 pin (user define) is low level, and then reset the device.
  • Page 32: Revision History

    Revision history A31G32x USB Bootloader quick guide Revision history Date Version Description 20.12.04 1.00 Document created...
  • Page 33 ABOV Semiconductor ("ABOV") reserves the right to make changes, corrections, enhancements, modifications, and improvements to ABOV products and/or to this document at any time without notice. ABOV does not give warranties as to the accuracy or completeness of the information included herein. Purchasers should obtain the latest relevant information of ABOV products before placing orders.

Table of Contents