Skip to content

Commit 5737b79

Browse files
MPAE-18393: Update for v1.1.0 of MDFU Client
1 parent 2c8be92 commit 5737b79

File tree

327 files changed

+12803
-2115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+12803
-2115
lines changed

.main-meta/main.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"content": {
55
"metaDataVersion": "1.3.0",
66
"name": "com.microchip.mcu8.mplabx.project.pic18f56q24-cnano-8bit-mdfu-client-mplab-mcc",
7-
"version": "1.1.0",
7+
"version": "1.2.0",
88
"displayName": "Getting Started with the 8-Bit MDFU Client for PIC18F56Q24",
99
"projectName": "pic18f56q24-cnano-8bit-mdfu-client-mplab-mcc",
1010
"shortDescription": "GitHub Example for the 8bit MDFU Client Library using PIC18F56Q24 with a CNANO board.",
@@ -15,7 +15,7 @@
1515
"compiler": [
1616
{
1717
"name": "XC8",
18-
"semverRange": "^2.46.0"
18+
"semverRange": "^2.50.0"
1919
}
2020
],
2121
"dfp": {
@@ -39,6 +39,7 @@
3939
"author": "Microchip",
4040
"peripherals": [
4141
"UART",
42+
"SPI",
4243
"Memory Module"
4344
],
4445
"keywords": [
@@ -50,6 +51,7 @@
5051
"Memory",
5152
"Serial Communication",
5253
"EUSART",
54+
"SPI",
5355
"Virtual COM Port",
5456
"Microchip Device Firmware Update",
5557
"8-bit MDFU Client",

README.md

Lines changed: 79 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,44 @@
22

33
[![MCHP](images/microchip.png)](https://www.microchip.com)
44

5-
# Getting Started With the 8-bit MDFU Client for PIC18F56Q24 using MPLAB® X
5+
# Getting Started With the 8-Bit MDFU Client for PIC18F56Q24 Using MPLAB® X
66

7-
This is an example on how to use the MPLAB Code Configurator (MCC) generated code for configuring several basic Microchip Device Firmware Update (MDFU) bootloader solutions for the PIC18F56Q24 Curiosity Nano Evaluation Board.
7+
This example demonstrates how to utilize MPLAB Code Configurator (MCC) generated code to set up various Microchip Device Firmware Update (MDFU) bootloader solutions for the PIC18F56Q24 Curiosity Nano Evaluation board.
88

9-
The Microchip Device Firmware Update (MDFU) is a device firmware update ecosystem that uses a device agnostic host application to update the application firmware. The application image that is loaded into the host follows a custom file format that includes the device and application-specific parameters needed to perform the update. This repository provides the basic starting point to configure and customize the MCC Melody 8-Bit MDFU Client library on the PIC18F56Q24 Curiosity Nano Base for Click boards™ and also provides instructions for running the examples.
9+
The MDFU is a firmware update system that employs a device-independent host application to update application firmware. The application image loaded into the host adheres to a custom file format, incorporating device and application-specific parameters necessary for the update. This repository offers a foundational setup to configure and customize the MCC Melody 8-Bit MDFU Client library on the PIC18F56Q24 Curiosity Nano Base for Click boards™, along with instructions for executing the examples.
1010

11-
This example will demonstrate:
11+
This example demonstrates:
1212
- How to configure the 8-Bit MDFU Client library in MCC Melody for different verification schemes
1313
- How to create a simple Blinky LED application
14-
- How to use the [`pyfwimagebuilder`](https://pypi.org/project/pyfwimagebuilder/) command line interface to convert application hex file into the application image
14+
- How to use the [`pyfwimagebuilder`](https://pypi.org/project/pyfwimagebuilder/) command line interface to convert the application hex file into an application image
1515
- How to use the [`pymdfu`](https://pypi.org/project/pymdfu/) command line interface to update the application firmware
16-
---
16+
1717
## Related Documentation
1818

1919
- [PIC18F56Q24 Family Product Page](https://www.microchip.com/en-us/product/PIC18F56Q24)
20-
- [8-Bit MDFU Client v1.0.0 Release Notes](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=RELEASE_NOTES_8BIT_MDFU_CLIENT_LIBRARY&version=latest&redirect=true)
21-
- [8-Bit MDFU Client v1.0.0 Getting Started Guide](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=8BIT_MDFU_CLIENT&version=latest&redirect=true)
22-
- [8-Bit MDFU Client v1.0.0 API Documentation](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=8BIT_MDFU_CLIENT&version=latest&redirect=true)
23-
- [8-Bit MDFU Client v1.0.0 Known Issues List](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=KNOWN_ISSUES_8BIT_MDFU_CLIENT&version=latest&redirect=true)
20+
- [8-Bit MDFU Client v1.1.0 Release Notes](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=RELEASE_NOTES_8BIT_MDFU_CLIENT_LIBRARY&version=latest&redirect=true)
21+
- [Getting Started Document, API Reference and Update Image Specification](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=8BIT_MDFU_CLIENT&version=latest&redirect=true)
22+
- [8-Bit MDFU Client Known Issues List](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=KNOWN_ISSUES_8BIT_MDFU_CLIENT&version=latest&redirect=true)
2423

25-
---
2624
## Software Used
2725

2826
- [MPLAB X IDE 6.20.0](https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide)
29-
- [MPLAB XC8 2.46.0](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers)
27+
- [MPLAB XC8 2.50.0](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers)
3028
- [MPLAB Code Configurator (MCC) 5.5.1](https://www.microchip.com/mplab/mplab-code-configurator)
31-
- [MPLAB Code Configurator (MCC) Device Libraries PIC10 / PIC12 / PIC16 / PIC18 MCUs](https://www.microchip.com/en-us/tools-resources/develop/libraries/microchip-libraries-for-applications)
29+
- [MPLAB Code Configurator (MCC) Device Libraries PIC10/12/16/18 microcontrollers (MCUs)](https://www.microchip.com/en-us/tools-resources/develop/libraries/microchip-libraries-for-applications)
3230
- [Python 3.8 or later](https://www.python.org/downloads/)
33-
- [pyfwimagebuilder v1.0.1.14](https://pypi.org/project/pyfwimagebuilder/)
34-
- [pymdfu v1.0.1.5](https://pypi.org/project/pymdfu/)
31+
- [pyfwimagebuilder v1.0.1](https://pypi.org/project/pyfwimagebuilder/)
32+
- [pymdfu v2.4.0](https://pypi.org/project/pymdfu/)
3533

36-
---
3734
## Hardware Used
3835

3936
- PIC18F56Q24 Curiosity Nano [(EV01E86A)](https://www.microchip.com/en-us/development-tool/ev01e86a)
4037

41-
[![PIC18F56Q24_CNano](images/230928-mcu8-photo-ev01e86a-front-transparent.PNG)](images/230928-mcu8-photo-ev01e86a-front-transparent.PNG)
38+
[![PIC18F56Q24_CNano](images/230928-MCU8-PHOTO-EV01E86A-Front-Transparent.png)](images/230928-MCU8-PHOTO-EV01E86A-Front-Transparent.png)
4239

43-
---
4440
## Setup
4541

46-
MDFU Client and Application projects have to be configured according to [Client Setup](#client-setup) and [Application Setup](#application-setup). The following project setup is the same for all the example project pairs. If something goes wrong while running these examples, confirm that the settings in the respective projects are consistent with the options seen in the following sections.
42+
The following project setup steps demonstrate the basic configuration for setting up the 8-Bit MDFU Client with Universal Asynchronous Receiver-Transmitter (UART) communication. The configuration bits, clock, Non-Volatile Memory (NVM), and General Purpose Input/Output (GPIO) settings will be consistent across all examples in this repository and any deviations from this setup due to the chosen communication protocol will be described individually later in this section.
4743

4844
### [Client Setup](#client-setup)
4945
[![mdfu-builder](images/ProjectConfigurationOverview.PNG)](images/ProjectConfigurationOverview.PNG)
@@ -56,7 +52,7 @@ MDFU Client and Application projects have to be configured according to [Client
5652

5753
**Clock Control**
5854
- Clock Source: HFINTOSC
59-
- HF Internal Clock: 8_MHz
55+
- HF Internal Clock: 8_MHz or higher
6056
- Clock Divider: 1
6157

6258
[![CLK](images/ClockSetup.PNG)](images/ClockSetup.PNG)
@@ -68,8 +64,26 @@ MDFU Client and Application projects have to be configured according to [Client
6864

6965
[![NVM](images/NVMSetup.PNG)](images/NVMSetup.PNG)
7066

67+
**8-Bit MDFU Client**
68+
69+
This section will guide you through the setup process for UART communication. For more details on configuring and operating other communication protocols, please refer to the pages listed below:
70+
- [SPI Communication](spi/Readme.md)
71+
72+
**8-Bit MDFU Client with UART Communication**
73+
74+
- Communication Protocol: SERCOM
75+
- Application Start Address: Different for each project based on the verification selected
76+
- Device ID: 0x7920 (automatically added)
77+
- I/O Pin Indicator: Enabled
78+
- I/O Pin Entry: Enabled
79+
- Memory Verification: Assigned based on the example project naming convention
80+
81+
> **Tip**: This example is for CRC32 verification.
82+
83+
[![MDFU](images/MDFUClientSetup.PNG)](images/MDFUClientSetup.PNG)
84+
7185
**UART**
72-
- Custom Name: UART2
86+
- Custom Name: SERCOM
7387
- Requested Baudrate: 9600
7488
- Parity: None
7589
- Data Size: 8
@@ -95,66 +109,47 @@ MDFU Client and Application projects have to be configured according to [Client
95109

96110
[![UART_Pins](images/UARTPortsSetup.PNG)](images/UARTPortsSetup.PNG)
97111

98-
**8-Bit MDFU Client**
99-
- Communication Protocol: UART
100-
- Application Start Address: Different for each project based on the verification selected
101-
- Device ID: 0x7920
102-
- I/O Pin Indicator: Enabled
103-
- I/O Pin Entry: Enabled
104-
- Memory Verification: Assigned Based on Example Project Naming Convention
105-
106-
**Tip**: The easiest way to get the correct device ID is to connect your device and use the **Refresh Debug Tool Status** button on the Dashboard left panel in MPLAB X IDE. Upon clicking the button and selecting the correct PKOB Nano, in the Output window it prints out the device ID and other information.
107-
108-
[![Refresh Debug Tool Status](images/RefreshDebugToolStatus.png)](images/RefreshDebugToolStatus.png)
109-
110-
*Example for CRC32 Verification*
111-
112112
**8-Bit MDFU Client I/O**
113113
- BOOT INDICATE: RF2
114114
- BOOT ENTRY: RF3
115115

116116
[![IO-Pins](images/IOPortSetup.PNG)](images/IOPortSetup.PNG)
117117
- BOOT INDICATE: Start High
118-
- BOOT ENTRY: Weak Pullup
118+
- BOOT ENTRY: Weak Pull up
119119

120120
[![IO-Settings](images/IOPinsSetup.PNG)](images/IOPinsSetup.PNG)
121121

122-
**Updating Application Start Address**
123-
124-
This is an important step to ensure that the bootloader and application FLASH sections are configured to provide maximum space for the application while decreasing the bootloader section to be as close to the memory consumed by the bootloader code as possible.
125-
126-
- At this point, as mentioned in the 8-Bit MDFU Client section, this depends on the verification method used in the project. Initially, configure the application start address to be closer to the MAXSIZE to allow sufficient memory for flashing the bootloader code. Do not exceed (MAXSIZE - 4)
127-
[![Max Boot Size](images/MaxBootSize.png)](images/MaxBootSize.png)
128-
129-
- After a clean and build, the bytes of memory consumed by bootloader can be observed under the Memory Summary section in the Output window
130-
131-
[![Build Memory Consumption](images/BuildMemoryConsumption.png)](images/BuildMemoryConsumption.png)
132-
133-
- Update the application start address to the start address of the next page in FLASH, following the memory allocation utilized by the bootloader code
134-
135-
- Since in this example, the bootloader code consumes 0x168B bytes, the application start address can be configured to 0x2000
136-
137-
[![Updated Boot Size](images/UpdatedBootSize.png)](images/UpdatedBootSize.png)
138-
139-
- After updating the application start address, final configurations must be as mentioned below
122+
**8-Bit MDFU Client Project Properties**
140123

141-
[![MDFU](images/MDFUClientSetup.PNG)](images/MDFUClientSetup.PNG)
124+
> **Tip**: These values can be copied from the "Linker Options" section of 8-Bit MDFU Client MCC UI.
142125
143-
**8-Bit MDFU Client Project Properties**
144-
- ROM Ranges: This option is configured based on the start address of the application
126+
- ROM Ranges: This option is configured based on the application's start address
145127
- For example, if the application starts at 0x2000 then this value will reflect as `0-1FFF`
146128

147129
[![IO-Settings](images/MemoryModelSettings.PNG)](images/MemoryModelSettings.PNG)
148130

149131
---
150132
### [Application Setup](#application-setup)
133+
134+
This section is consistent for any example created in this repository.
135+
151136
[![app-builder](images/AppConfigurationOverview.PNG)](images/AppConfigurationOverview.PNG)
152137

138+
**Clock And Configuration**
139+
- Set the clock and configuration bits to the same values that were set in the MDFU Client
140+
141+
[![CLK](images/ClockSetup_App.PNG)](images/ClockSetup_App.PNG)
142+
143+
[![CFG](images/ConfigBitsSetup_App.PNG)](images/ConfigBitsSetup_App.PNG)
144+
153145
**I/O Pins**
146+
- GPIO Input: RF3
147+
- Custom Name: BTN
148+
- Weak Pull up: Enabled
154149
- GPIO Output: RF2
150+
- Custom Name: LED
155151

156152
[![app_io](images/AppPortSetup.PNG)](images/AppPortSetup.PNG)
157-
- Custom Name: LED
158153

159154
[![app_io_settings](images/LEDSetup.PNG)](images/LEDSetup.PNG)
160155

@@ -166,15 +161,15 @@ Linker Additional Options
166161

167162
[![app_offset](images/AppOffset.PNG)](images/AppOffset.PNG)
168163

169-
**Note**:*Check the table below to understand how the CRC32 option must be configured in the application projects*
164+
Check the table below to understand how the CRC32 option must be configured in the application projects:
170165

171166
|Verification Scheme | Checksum Setting |
172167
|---- |---- |
173168
|Reset Vector | N/A |
174169
|Status Byte | N/A |
175-
|Checksum | C00-3FFD@3FFE,width=-2,algorithm=2,code=3F |
176-
|CRC-16 | C00-3FFD@3FFE,width=-2,algorithm=5,offset=FFFF,polynomial=1021,code=3F |
177-
|CRC-32 | C00-3FFB@3FFC,width=-4,algorithm=-5,offset=FFFFFFFF,polynomial=04C11DB7,code=3F |
170+
|Checksum | 2000-FFFD@FFFE,width=-2,algorithm=2 |
171+
|CRC-16 | 2000-FFFD@FFFE,width=-2,algorithm=5,offset=FFFF,polynomial=1021 |
172+
|CRC-32 | 2000-FFFB@FFFC,width=-4,algorithm=-5,offset=FFFFFFFF,polynomial=04C11DB7 |
178173

179174
Fill Flash Memory
180175
- Which area to fill: Provide Range to fill
@@ -227,30 +222,46 @@ Right click, then select Clean and Build
227222

228223
[![CleanBuild_App](images/CleanAndBuildApp.png)](images/CleanAndBuildApp.png)
229224

230-
4. Build the Application Image File using **pyfwimagebuilder**.
225+
4. Build the Application Image File using [pyfwimagebuilder](https://pypi.org/project/pyfwimagebuilder/).
226+
227+
- 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
228+
- Select Run
231229

232-
*Hint: The configuration TOML file is generated by the MDFU Client project under \mcc_generated_files\bootloader\configurations*
230+
[![Run_BuildScript](images/RunBuildScript.png)](images/RunBuildScript.png)
231+
232+
> **Tip**: The configuration TOML file is generated by the MDFU Client project under `\mcc_generated_files\bootloader\configurations`
233233
234234
**Example Command:**
235235

236236
`pyfwimagebuilder build -i "application_hex_file.hex" -c "bootloader_configuration.toml" -o output.img`
237237

238238
[![build_img](images/BuildTheImage.PNG)](images/BuildTheImage.PNG)
239239

240-
5. Use the **pymdfu** host tool to transfer the application image file to the bootloader.
240+
5. Use the [pymdfu](https://pypi.org/project/pymdfu/) host tool to transfer the application image file to the bootloader.
241+
242+
> **Tip**: You can find the COM port of the MCU using the MPLAB Data Visualizer.*
243+
244+
- 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.
245+
- Edit the port number to the CDC port name that is assigned to the Curiosity Nano device
246+
- Then right click on the script and select Run
241247

242-
*Hint: You can find the COM port of the MCU using the MPLAB Data Visualizer.*
248+
[![UpdateScript_BL](images/runUpdateScript.PNG)](images/runUpdateScript.PNG)
243249

244250
**Example Command:**
245251

246-
`pymdfu update serial ./crc32.img --baudrate 9600 --port COM##`
252+
`pymdfu update --tool serial --image ./crc32.img --baudrate 9600 --port COM##`
247253

248254
[![transfer_img](images/SendTheImage.PNG)](images/SendTheImage.PNG)
249255

250256
**Application Has Been Updated Successfully**
251257

252258
[![MDFU_AppMode](images/PIC18F56Q24_AppMode.gif)](images/PIC18F56Q24_AppMode.gif)
253259

260+
**Example Application Features:**
261+
262+
1. Blink the on-board LED at a rate of 200 ms.
263+
2. Pressing the button on the Curiosity Nano and holding it down will force entry into the bootloader, allowing a new application to be transferred.
264+
254265
## Summary
255266

256267
This repository demonstrates how to configure the 8-Bit MDFU Client library in MCC to enable device firmware updates over UART on a PIC18F56Q24 Curiosity Nano.
@@ -263,4 +274,4 @@ This repository demonstrates how to configure the 8-Bit MDFU Client library in M
263274
- [Back to Setup](#setup)
264275
- [Back to Operation](#operation)
265276
- [Back to Summary](#summary)
266-
- [Back to Top](#getting-started-with-the-8-bit-mdfu-client-for-pic18f56q24-using-mplab®-x)
277+
- [Back to Top](#getting-started-with-the-8-bit-mdfu-client-for-pic18f56q24-using-mplab-x)

0 commit comments

Comments
 (0)