ETP 522 The Bootloader Commands & Packets

Wikis > Software > ETP 522 The Bootloader Commands & Packets

Date: 9/22/2015

1. PURPOSE / DESCRIPTION

  • Knowing how to build new commands and packets for bootloader
  • Introduce the commands which are used currently

2. TEST SET-UP

Marc Basic bootloader firmware (https://github.com/TechJect/TJ_BOOTLOADER)

3. PROCEDURE

  • The existing commands for bootloader:
    • SDConnectToBootloaderCmdID (0x55)
      • Client APP should send this command before flash to reset everything on Marc
      • Client APP should keep the sequence number updated
    • SDBootloaderDataCmdID (0x56)
      • Client APP should keep the sequence number updated
      • Client APP should put the flash data into the payload field.
      • Process only if last packet is (ProcessedPacket = 1)
      • If the last packet failed (IncorrectSentinel = 1), then the transmission stalled until the Response field is 1 à the SDP_Build_Bootloader_Packet() is called, and update the status IncorrectSentinel and ProcessedPacket to struct SDBootloaderPacket which is defined in SDCommands.h.
      • You can refer to the readme file on https://github.com/TechJect/Selfi-Drone-Flight-Control for the packet structure
    • SDResetToBootloaderCmdID (0x60)
      • It will make the system reboot from auxiliary memory ( starts from 0x7FC000)
      • It’s also used in flight control firmware
    • SDGetVersionString
      • It’s also used in flight control firmware
      • Please see the details in ETP 523
  • To create a new command, one needs to declare the CID (like 3.1.x), and add corresponding behavior in SDP_Process_Command(). Also establish the command in Client APP
  • The existing packets for bootloader: (defined in h)
    • SDBootloaderPacket: When receiving SDBootloaderDataCmdID with Respond = 1, Marc has to send this packet back to WiRa. Update the corresponding fields defined in that structure
    • SDVersionPacket: Please see the details in ETP 523
  • To create a new packet, one needs to declare the CID (like 3.3.x), and make sure the Respond = 1 in the request command. Also update wrflags.response_requested to 1 for processing in SDP_Continue(). Make sure the Client APP also add the CID for new packet.

4. ACCEPTANCE CRITERIA

TBD

5. TEST RECORDS

Test results shall be recorded and dated by tester. Results shall be filed and retained for 7 years.