Design specification

<< Click to Display Table of Contents >>

Navigation:  STM32F4 Target > Demos > Waijung Demos > Network Firmware upgrade >

Design specification

Previous pageReturn to chapter overviewNext page

Program memory division

iap_concept_sector

Boot program

This sector is program compile with default configuration, flash base address start at 0x08000000.

Flow chart:

iap_concept_boot

The implementation of the above bootloader program / mechanism is provided in a form of Simulink Boot Loader demo model.

Sector healthy check

In boot program must implement method to detect the corrupt firmware.

User program

This sector compiled with Flash base offset configuration.

Data

This is Data sector, MCU did not run in this sector. It used for storing the receiving program data for temporary.

IAP Protocol

The demo use CAN for programming interface, below specification for CAN packet.

1. Device ID

 1.1 Use Standard ID (11 bits) for CAN-IAP demo.

 1.2 Bit 10 of ID is reserved and must be ‘1’ to specify ID is for IAP command.

 1.3 Bits 9:8 of ID used for identify IAP type.

 Type 0: CAN-IAP packet is COMMAND.

 Type 1: CAN-IAP packet is STATUS

 Type 2: CAN-IAP packet is DATA.

 Type 3: Reserved

1.4 Bits [7:0] of ID use for device ID

2. Data length code (DLC)

Data length code must be 8.

3. CAN packet type

 3.1 COMMAND packet (Bits 9:8 = 0)

         3.1.1 This packet type normally sent by Host.

         3.1.2 Packet data will be D0: uint32, D1: uint32.

         3.1.3 D0 is IAP_CMD.

         3.1.4 D1 is constant value 0x00000000.

 3.2 STATUS packet (Bits 9:8 = 1)

         3.2.1 This packet type normally sent by Device.

         3.2.2 Packet data will be D0: uint32, D1: uint32.

         3.2.3 D0 is IAP_STA.

         3.2.4 D1 is constant value 0x00000000.

 3.3 DATA packet (Bits 9:8 = 2)

         3.3.1 This packet type normally sent by Host.

         3.3.2 Packet data will be D0: uint32, D1: uint32.

         3.3.3 D0 is IAP_OFFSET.

         3.3.4 D1 is IAP_DATA.

 3.4 RESERVED (Bits 9:8 = 3)

4. IAP_CMD

 4.1 Command 0: IAP initial state.

 4.2 Command 1: IAP Finalize state.

 4.3 Command 2: MCU reset.

 4.4 Command 3-7: Reserved.

5. IAP_STATUS

 Status 0: Success. Otherwise: Fail.

6. IAP_OFFSET

 This will be flash memory offset, start from 0.

7. IAP_DATA

 This is Word data (32 bits) to program into flash.

Firmware upgrade file