SLAA450G April   2010  – April 2020

 

  1.   Creating a Custom Flash-Based Bootloader (BSL)
    1.     Trademarks
    2. 1 5xx and 6xx Bootloader Customization
      1. 1.1 BSL Memory Layout
        1. 1.1.1 Z-Area
        2. 1.1.2 BSL Reserved Memory Locations
      2. 1.2 Device Start-up Sequence
        1. 1.2.1 BSL Protect Function
          1. 1.2.1.1 Protection of BSL Memory
          2. 1.2.1.2 Checking for BSL Invoke
      3. 1.3 TI-Supplied BSL Software
        1. 1.3.1 Software Overview
        2. 1.3.2 Software File Details
          1. 1.3.2.1 BSL430_Low_Level_Init.s43 (IAR) / BSL430_Low_Level_Init.asm (CCS)
          2. 1.3.2.2 BSL_Device_File.h
          3. 1.3.2.3 lnk430FXXXX_BSL_AREA.xcl (IAR) / MSP430Fxxxx_BSL.cmd (CCS)
        3. 1.3.3 Known Limitations in CCS CSL Code Example
          1. 1.3.3.1 Memory Allocation of BSL Code Under Linker Command File
          2. 1.3.3.2 BSL Functions Supported in the Default Setting Project
          3. 1.3.3.3 How to Accomodate Full Function of BSL
          4. 1.3.3.4 Using Modified boot_hook.h and boot.c (CCS Only)
      4. 1.4 Creation of Custom Peripheral Interface
        1. 1.4.1 PI_init ()
        2. 1.4.2 PI_receivePacket()
        3. 1.4.3 PI_sendData(int bufSize)
      5. 1.5 BSL Development and Debug
        1. 1.5.1 Development and Testing
        2. 1.5.2 Special Notes and Tips
        3. 1.5.3 USB BSL External Oscillator Frequency
    3. 2 G2xx Bootloader Creation and Customization
      1. 2.1 Target System Specification
      2. 2.2 BSL Specification
        1. 2.2.1 Functionality
          1. 2.2.1.1 Entry Sequence
          2. 2.2.1.2 Synchronization
          3. 2.2.1.3 Erasing Previous Flash Content
          4. 2.2.1.4 Receiving and Writing New User Data
          5. 2.2.1.5 Data Verification
        2. 2.2.2 Memory Footprint
        3. 2.2.3 Peripherals
      3. 2.3 Implementation
        1. 2.3.1 BSL Assembler Code
          1. 2.3.1.1 Save DCO Calibration Data
          2. 2.3.1.2 Linker Command File
            1. 2.3.1.2.1 Locating the Linker Command File
            2. 2.3.1.2.2 Modify Linker File
            3. 2.3.1.2.3 Force the IDE to Use Custom Linker File
          3. 2.3.1.3 Project Settings
        2. 2.3.2 User Application
      4. 2.4 BSL Operation
        1. 2.4.1 Hardware Setup
        2. 2.4.2 Connection to Host
          1. 2.4.2.1 Determining COM Port
          2. 2.4.2.2 Setup of COM Port
        3. 2.4.3 Operate BSL - Standard Sequence
        4. 2.4.4 Create New Code to Download Through BSL
          1. 2.4.4.1 Create Custom Application
          2. 2.4.4.2 Save Calibration Data
          3. 2.4.4.3 Make User Application Code a BSL Update File
            1. 2.4.4.3.1 Using CCS
            2. 2.4.4.3.2 Using IAR
          4. 2.4.4.4 Obtaining XOR Checksum
            1. 2.4.4.4.1 Send User Data
            2. 2.4.4.4.2 Read Checksum
            3. 2.4.4.4.3 Send Acquired Checksum
            4. 2.4.4.4.4 Verify Data
            5. 2.4.4.4.5 Save Checksum
        5. 2.4.5 Getting Ready for Production
    4. 3 Frequently Asked Questions (FAQ)
  2.   Revision History

How to Accomodate Full Function of BSL

To be able to use all BSL functions, some code need to be placed in the other than BSL information memory area. One most important thing to be considered is that the BSL area in the information memory is protected by default, but not with the main memory. The user needs to understand the BSL flow to erase the memory carefully during programming so that the BSL code will not be accidentally erased.

It is recommended to also place the additional section after the interrupt vector area in the main memory which is located from 0xFF80-0xFFFF.

To allocate BSL in main memory, the linker command file need to have second flash section. For example:

Memory sections of BSL code

ZAREA : origin = 0x1000, length = 0x0010 BSL430_VERSION_VENDOR : origin = 0x1010, length = 0x0001 BSL430_VERSION_CI : origin = 0x1011, length = 0x0001 BSL430_VERSION_API : origin = 0x1012, length = 0x0001 BSL430_VERSION_PI : origin = 0x1013, length = 0x0001 ZAREA_CODE : origin = 0x1014, length = 0x002E FLASH : origin = 0x1042, length = 0x07AE FLASH2 : origin = 0x10000,length = 0x1000 BSLSIG : origin = 0x17F0, length = 0x000C JTAGLOCKKEY : origin = 0x17FC, length = 0x0004

Assignment between build binary and memory sections

... .text : {}>> FLASH | FLASH2 /* CODE */ .text:_isr : {} > FLASH | FLASH2 /* ISR CODE SPACE */ .cinit : {} > FLASH | FLASH2 /* INITIALIZATION TABLES */ .const : {} > FLASH | FLASH2 /* CONSTANT DATA */ .cio : {} > RAM /* C I/O BUFFER */ .pinit : {} > FLASH | FLASH2 /* C++ CONSTRUCTOR TABLES */ .init_array : {} > FLASH | FLASH2 /* C++ CONSTRUCTOR TABLES */ .mspabi.exidx : {} > FLASH | FLASH2 /* C++ CONSTRUCTOR TABLES */ .mspabi.extab : {} > FLASH | FLASH2 /* C++ CONSTRUCTOR TABLES */ ...