Skip to content

Latest commit

 

History

History
153 lines (92 loc) · 5.47 KB

File metadata and controls

153 lines (92 loc) · 5.47 KB

MCHP

8-Bit MDFU Client Setup for SPI Communication

Go Back

Required Hardware

Hardware Configuration

MDFU_SPI_HW

8-Bit MDFU Client SPI Communication

  • Communication Protocol: SPI
  • Application Start Address: 0x2000
  • Device ID: 0x7920 (automatically added)
  • I/O Pin Indicator: Enabled
  • I/O Pin Entry: Enabled
  • Memory Verification: CRC32

MDFU

SPI

  • Custom Name: SERCOM
  • BOOT_CONFIG: Mode 0
  • Interrupt Driven: Disabled

SPI

MSSP1 PLIB

  • Serial Protocol: SPI
  • Enable Client Select: Enabled

SPI_PLIB

SPI Pins

  • MSSP SCK: RC1
  • MSSP SDI (MOSI): RB3
  • MSSP SDO (MISO): RC0
  • MSSP SS (Chip Select): RA5
    • Custom Name: CHIP_SELECT

SPI_Pins

8-Bit MDFU Client I/O

  • BOOT INDICATE: RF2
  • BOOT ENTRY: RF3

IO-Pins

  • BOOT INDICATE: Start High
  • BOOT ENTRY: Weak Pullup

IO-Settings

8-Bit MDFU Client Project Properties

  • ROM Ranges: This option is configured based on the start address of the application
  • For example, if the application starts at 0x2000 then this value will reflect as 0-1FFF

IO-Settings

Application Setup

Refer to the Application Setup section in the main Readme file.

Operation

This example shows how to execute the CRC32 verification example and update the device Flash memory with the CRC32 application image to demonstrate a successful device firmware update (DFU) over the SPI communication protocol.

8-Bit MDFU Client Operation

  1. Open the MDFU client project.

OpenMDFU

OpenMDFUProject

  1. Set MDFU client project as Main Project.

SetAsMainMDFUProject

  1. Right click, then select Clean and Build.

CleanBuild

  1. Program the MDFU client project.

ProgramMDFU

Bootloader Operation After Initial Programming

After initial programming, the LED must be on.

MDFU_BootMode

Application Operation

  1. Open the application project that is configured for your selected verification scheme.

OpenApp

OpenAppProject

  1. Set the application project as the Main Project.

MainAppProject

  1. Build the required application project.

Right click, then select Clean and Build

CleanBuild_App

  1. Build the Application Image File using pyfwimagebuilder.
  • To build the application image files, navigate to the Projects tab and right click Important Files>build_free_image.bat for Windows or Important Files>build_free_image.sh for Mac and Linux
  • Select Run

Run_BuildScript

Example Command:

Below is an example of the command used in the above step.

pyfwimagebuilder build -i "application_hex_file.hex" -c "mdfu_config_file.toml" -o output.img

build_img

Tip: The configuration TOML file is generated by the MDFU Client project.

FindTheTOML_BL

  1. Use the pymdfu host tool to transfer the application image file to the bootloader.
  • To run the update with the examples, navigate to the project tab and right click, Important Files>pymdfu_update.bat for Windows or Important Files>pymdfu_update.sh for Mac and Linux. Double click to open the file.
  • Edit the chip select number to the proper GPIO you have set on your MCP2210 Breakout Module
  • Then right click on the script in the Files tab and select Run

UpdateScript_BL

Example Command:

Below is an example of the command used in the above step.

pymdfu update --tool mcp2210 --image ./output.img --chip-select 7 --clk-speed 50000

transfer_img

Application Has Been Updated Successfully

MDFU_AppMode

Back to top