Skip to content

Latest commit

 

History

History
146 lines (86 loc) · 5.33 KB

File metadata and controls

146 lines (86 loc) · 5.33 KB

MCHP

8-Bit MDFU Client Setup for I2C Communication

Go Back

Required Hardware

Hardware Configuration

MDFU_I2C_HW

8-Bit MDFU Client I2C Communication

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

MDFU

I2C

  • Custom Name: SERCOM
  • Client Address: 0x20
  • Client Mask: 0x7F
  • I2C Client PLIB Selector: I2C1

I2C

I2C1 PLIB

  • Interrupt Driven: Enabled

I2C_PLIB

I2C Pins

  • I2C SCL: RB1
  • I2C SDA: RB2

I2C_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 0x3000 then this value will reflect as 0-2FFF.

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 I2C communication protocol.

8-Bit MDFU Client Operation

  1. Open the MDFU client project.

OpenMDFU

OpenMDFUProject

  1. Set the 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 the initial programming, the LED must be ON.

MDFU_BootMode

Application Operation

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

OpenApp

OpenAppProject

  1. Set the application project as the Main Project.

MainAppProject

  1. Build the application project. Right click, then select Clean and Build.

CleanBuild_App

  1. Build the Application Image File using pyfwimagebuilder:
  • 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 previous 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:
  • Navigate to the Projects 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.
  • Then right click the script in the Files tab and select Run.

UpdateScript_BL

Example Command:

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

pymdfu update --tool mcp2221a --image ./output.img --interface i2c --address 32 --clk-speed 100k

transfer_img

Application Has Been Updated Successfully

MDFU_AppMode

Back to top