Skip to content

Commit 4b80219

Browse files
aiwyatt787davidflowers
authored andcommitted
Pull request #10: Rename per requirements page
Merge in MCU16CE/dspic33-dsc-bootloader-code-examples from ~C74569/dspic33-dsc-bootloader-code-examples:feature/MCU16GITHUB-881-rename-folder-to-secure_boot_and_secure_firmware_upgrade_over_canfd-per-the to feature/MCU16GITHUB-836-bootloader-pre-generated-demos * commit 'c3e434d2ba9fb11214a4387879ffea52bef02ce3': Rename per requirements page
2 parents 583e865 + c3e434d commit 4b80219

File tree

129 files changed

+18769
-0
lines changed

Some content is hidden

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

129 files changed

+18769
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"metaDataVersion": "1.0.0",
3+
"category": "com.microchip.ide.project",
4+
"content": {
5+
"metaDataVersion": "1.3.0",
6+
"name": "com.microchip.mplabx.project.dspic33-dsc-bootloader-code-examples",
7+
"version": "1.0.0",
8+
"displayName": "CAN-FD Secure Boot and Secure Firmware Upgrade Demo",
9+
"projectName": "dspic33-dsc-bootloader-code-examples",
10+
"shortDescription": "This MPLAB® X IDE example demonstrates how to perform secure boot authentication and update via CAN-FD with ECDSA signature verification within MCC Melody.",
11+
"ide": {
12+
"name": "MPLABX",
13+
"semverRange": ">=6.15.0"
14+
},
15+
"compiler": {
16+
"name": "XC16",
17+
"semverRange": "^2.10.0"
18+
},
19+
"dfp": {
20+
"name": "dsPIC33CK-MP_DFP",
21+
"semverRange": ">=1.12.354"
22+
},
23+
"configurator": {
24+
"name": "MCC",
25+
"semverRange": ">=5.6.1"
26+
},
27+
"device": {
28+
"metaDataVersion": "1.0.0",
29+
"category": "com.microchip.portal.contentRef",
30+
"content": {
31+
"metaDataVersion": "1.0.0",
32+
"category": "com.microchip.device",
33+
"name": "dsPIC33CK1024MP710",
34+
"versionRange": "*"
35+
}
36+
},
37+
"keywords": [
38+
"Secure Bootloader",
39+
"Secure Firmware Upgrade",
40+
"Bootloader",
41+
"CAN FD",
42+
"Immutable Boot",
43+
"CodeGuard Security",
44+
"Firmware Upgrade",
45+
"Security",
46+
"Cryptography",
47+
"Public-key Cryptography",
48+
"CryptoAuthentication",
49+
"Authentication",
50+
"Microchip Device Firmware Update",
51+
"Certificate",
52+
"SHA",
53+
"SHA-256",
54+
"Public Key",
55+
"HSM",
56+
"Getting Started",
57+
"MCC",
58+
"XC16",
59+
"XC-DSC",
60+
"Private Key",
61+
"Code Protection",
62+
"TA100",
63+
"dsPIC",
64+
"DSC",
65+
"Over-the-Air Upgrade",
66+
"Automotive",
67+
"Hardware Security Module",
68+
"Flash OTP",
69+
"One-Time Programmable"
70+
]
71+
}
72+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<picture>
2+
<source media="(prefers-color-scheme: dark)" srcset="../images/microchip_logo_white_red.png">
3+
<source media="(prefers-color-scheme: light)" srcset="../images/microchip_logo_black_red.png">
4+
<img alt="Microchip Logo." src="../images/microchip_logo_black_red.png">
5+
</picture>
6+
7+
## Secure Boot and Secure Firmware Upgrade over CAN-FD Demo
8+
9+
![Board picture](./images/board.jpg)
10+
11+
## Introduction
12+
The associated bootloader and application projects demonstrate the following:
13+
* Immutable secure boot via CodeGuard
14+
* A/B type bootloading with Flash partitioning to support two firmware images and anti-roll back
15+
* Secure boot authentication via ECDSA signature verification
16+
* Secure firmware update via CAN-FD
17+
* Crypto acceleration via TA100
18+
19+
## Related Documentation
20+
* [dsPIC33C Touch-CAN-LIN Curiosity Development Board User's Guide](https://www.microchip.com/en-us/development-tool/EV97U97A)
21+
* [dsPIC33CK1024MP710 Datasheet](https://www.microchip.com/en-us/product/dsPIC33CK1024MP710)
22+
23+
## Tools
24+
25+
#### Software
26+
* **THIS PROJECT REQUIRES A NON PUBLIC COPY OF THE CRYPTOGRAPHIC AUTHENTICATION LIBRARY (CAL) FOR TA100 SUPPORT! CONTACT MICROCHIP TO OBTAIN A COPY. YOU MUST REQUEST VERSION CryptoAuthLib 3.6.1 or later**
27+
* The unzipped example project files, boot.X and app.X
28+
* [MPLAB® X IDE v6.15 or later](https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide)
29+
* [MPLAB® XC16 v2.10 or later](https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers)
30+
* [Universal Bootloader Host Application v1.19.3 or later](www.microchip.com/16-bit-bootloader)
31+
* Device Family Pack 1.12.354
32+
* [MPLAB® Code Configurator (MCC) v5.6.1 or later (optional - for code configuration)](https://www.microchip.com/en-us/tools-resources/configure/mplab-code-configurator)
33+
* 16-Bit Bootloader MCC module v1.25.0 or later (optional - for code configuration)
34+
* The drivers for the selected Peak CAN-FD protocol analyzer/protocol generator (available at https://www.peak-system.com/Home.59.0.html?&L=1)
35+
36+
37+
#### Hardware
38+
* [dsPIC33C Touch-CAN-LIN Curiosity Development Board (EV97U97A)](https://www.microchip.com/en-us/development-tool/EV97U97A)
39+
* A Peak CAN protocol analyzer/protocol generator. A PCAN-USB FD was used for development of this demo (https://www.peak-system.com/PCAN-USB-FD.365.0.html?&L=1)
40+
* A CAN cable
41+
* A CAN-FD bus terminator (or modify the Peak analyzer per their user's guide for proper CAN-FD termination)
42+
* A micro USB cable, a USB-Type C cable, or a 9v power adapter for the dsPIC33C Touch CAN LIN Curiosity Development Board (for powering the board)
43+
* [TA100 Trust Anchor External HSM 8-Pin SOIC](https://www.microchip.com/en-us/product/ta100)
44+
* [TA100 8-Pin SOIC CryptoAutomotive™ Socket Board](https://www.microchip.com/en-us/development-tool/AC164167)
45+
46+
## Running the Demo
47+
48+
##### Hardware Setup
49+
1. With the Development Board detached from any power source, programmer, or USB connection, connect the TA100 8-Pin SOIC CryptoAutomotive™ Socket board into the mikroBUS™ A slot with the jumpers set for SPI
50+
2. Connect the Peak analyzer/generator to your computer
51+
3. Connect the Peak analyzer/generator to the CAN/CAN-FD Driver Circuit on the Development Board
52+
4. Connect the micro-USB cable to port J1 of the Development Board to the host computer.
53+
54+
![Hardware Setup](./images/hardware_setup.png)
55+
56+
#### Programming the Bootloader
57+
1. Open the boot.X project in MPLAB® X
58+
2. Open MCC
59+
3. Right click on Project Resources and select "Force Update on All"
60+
![Force Update](./images/MCC_Force_Update.png)
61+
4. Click "Generate"
62+
![Generate](./images/MCC_Generate.png)
63+
5. Accept all incoming code changes for files **within the CryptoAuthenticationLibrary directory** by selecting "Replace All" in the merge helper UI. **NOTE: DO NOT accept incoming changes for boot_demo.c. Accept all other file changes and close out of MCC**
64+
![Merge Resolution](./images/MCC_Merge_Resolution.PNG)
65+
6. Press the “Make and Program” button on the top bar
66+
![Make and Program Device](./images/make_and_program.png)
67+
7. Select the appropriate programmer if prompted
68+
8. The project should compile and program successfully
69+
9. Verify the LED11 is solid on the Development Board. This indicates the bootloader is running
70+
71+
#### Building the Application
72+
1. Open the app.X project in MPLAB® X
73+
2. Press the “Clean and Build Project” button on the top bar. **NOTE**: Make sure not to hit the program button. This will program the application code over the bootloader that was just programmed
74+
![Clean and Build](./images/clean_and_build.png)
75+
3. The project should compile cleanly. app.X/dist/default/production/app.X.production.hex should be generated
76+
4. Verify that LED11 is still solid
77+
a. If LED11 is blinking instead of solid, then the application code was programmed instead of only compiled. Go back to the “Programming the Bootloader” stage and re-program the bootloader
78+
79+
#### Loading the Application
80+
1. Open the Universal Bootloader Host Application tool (UBHA)
81+
![UBHA](./images/UBHA_open.png)
82+
2. Select the “PIC24/dsPIC” option from the “Device Architecture” selection drop down
83+
![UBHA Device Architecture](./images/UBHA_device_architecture.png)
84+
3. Select “CAN” from the protocol drop down selection box
85+
![UBHA Protocol Selection](./images/UBHA_protocol.png)
86+
4. Select the “Settings->CAN” option from the top menu
87+
![UBHA CAN Settings Dropdown](./images/UBHA_Settings_CAN_Dropdown.png)
88+
5. Select the Peak protocol analyzer being used and the appropriate CAN configuration settings for this demo (listed below). When complete, press “Apply”:
89+
a. Nominal Bit Rate: 125.00 kbits/s
90+
b. CAN-FD: enabled
91+
c. CAN-FD TX Data Length: 8
92+
d. Flexible Data Rate: Enabled
93+
e. Flexible Data Rate: 2Mbits/s
94+
f. Message Format: Standard
95+
g. Host to Device ID: 0xA1
96+
h. Device to Host ID: 0xA2
97+
![CAN Settings](./images/UBHA_CAN_Settings.png)
98+
6. Press the "Read Device Settings" button
99+
a. The Application start address and Application end address fields should have updated. If it did not or if you get a communication error, please go back to the “Programming the Bootloader” stage to make sure the bootloader was programmed correctly
100+
![Read Device Settings](./images/UBHA_Read_Device_Settings.png)
101+
7. Load the application hex file by selecting “File->Open/Load File (*.hex)”
102+
a. Select the file generated in the previous section: app.X/dist/default/production/app.X.production.hex
103+
![Open Hex File](./images/UBHA_Open_Hex.png)
104+
8. Check the "Enable Self Verification After Program" checkbox
105+
![Enable Verification](./images/UBHA_Enable_Verification.png)
106+
9. Press “Program Device”. The application should program erase, program and perform a self verify using the TA100 for an ECDSA verify then read back verify correctly. Note: The reset response may not be fully transmitted before reset which may result in the reset response failing. The reset most likely did occur and the error can be safely ignored.
107+
a. After a few seconds, LED11 should be blinking
108+
![Program Device](./images/UBHA_Program.png)
109+
110+
## Trademarks
111+
112+
MPLAB® is a registered trademark of Microchip Technology Inc. All other trademarks are the property of their respective owner.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#
2+
# There exist several targets which are by default empty and which can be
3+
# used for execution of your targets. These targets are usually executed
4+
# before and after some main targets. They are:
5+
#
6+
# .build-pre: called before 'build' target
7+
# .build-post: called after 'build' target
8+
# .clean-pre: called before 'clean' target
9+
# .clean-post: called after 'clean' target
10+
# .clobber-pre: called before 'clobber' target
11+
# .clobber-post: called after 'clobber' target
12+
# .all-pre: called before 'all' target
13+
# .all-post: called after 'all' target
14+
# .help-pre: called before 'help' target
15+
# .help-post: called after 'help' target
16+
#
17+
# Targets beginning with '.' are not intended to be called on their own.
18+
#
19+
# Main targets can be executed directly, and they are:
20+
#
21+
# build build a specific configuration
22+
# clean remove built files from a configuration
23+
# clobber remove all built files
24+
# all build all configurations
25+
# help print help mesage
26+
#
27+
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28+
# .help-impl are implemented in nbproject/makefile-impl.mk.
29+
#
30+
# Available make variables:
31+
#
32+
# CND_BASEDIR base directory for relative paths
33+
# CND_DISTDIR default top distribution directory (build artifacts)
34+
# CND_BUILDDIR default top build directory (object files, ...)
35+
# CONF name of current configuration
36+
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
37+
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
38+
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
39+
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
40+
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
41+
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
42+
#
43+
# NOCDDL
44+
45+
46+
# Environment
47+
MKDIR=mkdir
48+
CP=cp
49+
CCADMIN=CCadmin
50+
RANLIB=ranlib
51+
52+
53+
# build
54+
build: .build-post
55+
56+
.build-pre:
57+
# Add your pre 'build' code here...
58+
59+
.build-post: .build-impl
60+
# Add your post 'build' code here...
61+
62+
63+
# clean
64+
clean: .clean-post
65+
66+
.clean-pre:
67+
# Add your pre 'clean' code here...
68+
# WARNING: the IDE does not call this target since it takes a long time to
69+
# simply run make. Instead, the IDE removes the configuration directories
70+
# under build and dist directly without calling make.
71+
# This target is left here so people can do a clean when running a clean
72+
# outside the IDE.
73+
74+
.clean-post: .clean-impl
75+
# Add your post 'clean' code here...
76+
77+
78+
# clobber
79+
clobber: .clobber-post
80+
81+
.clobber-pre:
82+
# Add your pre 'clobber' code here...
83+
84+
.clobber-post: .clobber-impl
85+
# Add your post 'clobber' code here...
86+
87+
88+
# all
89+
all: .all-post
90+
91+
.all-pre:
92+
# Add your pre 'all' code here...
93+
94+
.all-post: .all-impl
95+
# Add your post 'all' code here...
96+
97+
98+
# help
99+
help: .help-post
100+
101+
.help-pre:
102+
# Add your pre 'help' code here...
103+
104+
.help-post: .help-impl
105+
# Add your post 'help' code here...
106+
107+
108+
109+
# include project implementation makefile
110+
include nbproject/Makefile-impl.mk
111+
112+
# include project make variables
113+
include nbproject/Makefile-variables.mk

0 commit comments

Comments
 (0)