Skip to content

Commit 84ce4ed

Browse files
aiwyatt787davidflowers
authored andcommitted
Pull request #6: Feature/MCU16GITHUB-837 update the readme.md
Merge in MCU16CE/dspic33-dsc-bootloader-code-examples from ~C74569/dspic33-dsc-bootloader-code-examples:feature/MCU16GITHUB-837-update-the-readme.md to feature/MCU16GITHUB-836-bootloader-pre-generated-demos * commit 'c74efd411b47ee91afa57c0b0ec315f309fab415': Update instructions to reflect MCC generated CAL rather than copy paste Update pathing for MCHP logo Remove non-relevant files Add Trademark info Switch ordering of bootloader instructions Update README and add images
2 parents 912493f + c74efd4 commit 84ce4ed

18 files changed

+110
-36
lines changed

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,17 @@
44
<img alt="Microchip Logo." src="images/microchip_logo_black_red.png">
55
</picture>
66

7-
## dspic33 dsc bootloader code examples
8-
9-
Board Image if any.
7+
## dsPIC33 CAN/CAN-FD Bootloader Demo
108

119
## Summary
12-
10+
An example bootloader using the 16-bit MCC bootloader and the CAN or CAN-FD peripheral.
1311

1412
## Related Documentation
13+
https://www.microchip.com/16-bit-bootloader
1514

15+
## Setup And Operation
1616

17-
## Software Used
18-
19-
20-
## Hardware Used
21-
22-
23-
## Setup
24-
25-
26-
## Operation
17+
See the README files associated with each folder that describe the required hardware, software, and setup instructions.
2718

2819

2920

dsPIC33CK1024MP710/README.md

Lines changed: 105 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,112 @@
11
<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">
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">
55
</picture>
66

7-
## dspic33 dsc bootloader code examples
7+
## Secure Boot and Secure Firmware Upgrade over CAN-FD for dsPIC33C DSCs Demo
88

9-
Board Image if any.
10-
11-
## Summary
9+
![Board picture](./images/board.jpg)
1210

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
1318

1419
## Related Documentation
15-
16-
17-
## Software Used
18-
19-
20-
## Hardware Used
21-
22-
23-
## Setup
24-
25-
26-
## Operation
27-
28-
29-
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 by selecting "Replace All" in the merge helper UI
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+
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
71+
72+
#### Building the Application
73+
1. Open the app.X project in MPLAB® X
74+
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
75+
![Clean and Build](./images/clean_and_build.png)
76+
3. The project should compile cleanly. app.X/dist/default/production/app.X.production.hex should be generated
77+
4. Verify that LED11 is still solid
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.
19.4 KB
Loading
17 KB
Loading
91.3 KB
Loading
24.3 KB
Loading
32.7 KB
Loading
34.7 KB
Loading
32.2 KB
Loading
32.3 KB
Loading

0 commit comments

Comments
 (0)