Skip to content

Commit 4849ea1

Browse files
committed
Pull request #36: Develop
Merge in MCU16CE/dspic33-dsc-bootloader-code-examples from develop to feature/MCU16GITHUB-913-bootloader-prebuilt-hex-file * commit '4a1562ba54216b75ee3c309a33637b85bab0aa03': Slight improvements to README.md. Fixed issue where Chrome would not render the a, b, c ordered list correctly. Implement verification indication. Pull request #32: Feature/MCU16GITHUB-937 see about maxing out the clock speed of the device for the demo 2 more consistent punctuation. Update instructions for clean and build in 6.15 Update documentation to specify the SPI TA100 and jumper settings. Center arrow in image and remove white spaces in Readme Add S1 for reentry into the bootloader Add steps for pre-generated hex file
2 parents 23b1841 + 4a1562b commit 4849ea1

File tree

24 files changed

+318
-92
lines changed

24 files changed

+318
-92
lines changed

secure_boot_and_secure_firmware_upgrade_over_canfd/README.md

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,22 @@ The associated bootloader and application projects demonstrate the following:
4040
* A CAN cable
4141
* A CAN-FD bus terminator (or modify the Peak analyzer per their user's guide for proper CAN-FD termination)
4242
* 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)
43+
* [TA100 Trust Anchor External HSM 8-Pin SOIC](https://www.microchip.com/en-us/product/ta100) - NOTE: make sure to get the **SPI** variant for this demo.
4444
* [TA100 8-Pin SOIC CryptoAutomotive™ Socket Board](https://www.microchip.com/en-us/development-tool/AC164167)
4545

4646
## Running the Demo
4747

4848
##### 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.<br>
49+
1. Insert the TA100 into the TA100 8-Pin SOIC CryptoAutomotive™ Socket board. **NOTE** - make sure to align the TA100 pin 1 indicator with the pin 1 indicator on the socket board silkscreen.<br>
50+
![TA100 Socket Alignment](./images/socket_pin_1.png)
51+
2. Short the J10 jumper to the "3.3v" option.<br>
52+
![Power Jumper](./images/socket_power_jumper.png)
53+
3. Switch all the jumpers on the TA100 8-Pin SOIC CryptoAutomotive™ Socket board to the SPI setting (J3, J4, J5, J6, J7).<br>
54+
![SPI Jumpers](./images/socket_spi_jumper.png)
55+
4. 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.
56+
5. Connect the Peak analyzer/generator to your computer.
57+
6. Connect the Peak analyzer/generator to the CAN/CAN-FD Driver Circuit on the Development Board.
58+
7. Connect the micro-USB cable to port J1 of the Development Board to the host computer.<br>
5359

5460
![Hardware Setup](./images/hardware_setup.png)
5561

@@ -60,21 +66,22 @@ The associated bootloader and application projects demonstrate the following:
6066
![Force Update](./images/MCC_Force_Update.png)
6167
4. Click "Generate"<br>
6268
![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**<br>
69+
5. Accept all incoming code changes for files **within the CryptoAuthenticationLibrary directory** by selecting "Replace All" in the merge helper UI<br> **NOTE: DO NOT accept incoming changes for boot_demo.c. Accept all other file changes and close out of MCC**<br>
6470
![Merge Resolution](./images/MCC_Merge_Resolution.png)
6571
6. Press the “Make and Program” button on the top bar<br>
6672
![Make and Program Device](./images/make_and_program.png)
6773
7. Select the appropriate programmer if prompted
6874
8. The project should compile and program successfully
6975
9. Verify the LED11 is solid on the Development Board. This indicates the bootloader is running
7076

71-
#### Building the Application
77+
#### Building the Application (Optional)
78+
**NOTE**: A pre-generated .hex file has been included with this demo, therefore the following steps are **optional**
7279
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<br>
80+
2. Click the dropdown arrow next to the “Clean and Build Project” button on the top bar and select "Clean and Build Project" <br>**NOTE**: If "Clean and Build for Debugging" is selected instead, a new hex file will not be generated <br>**NOTE**: Make sure not to hit the program button. This will program the application code over the bootloader that was just programmed<br>
7481
![Clean and Build](./images/clean_and_build.png)
7582
3. The project should compile cleanly. app.X/dist/default/production/app.X.production.hex should be generated
7683
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
84+
1. 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
7885

7986
#### Loading the Application
8087
1. Open the Universal Bootloader Host Application tool (UBHA)<br>
@@ -86,27 +93,36 @@ The associated bootloader and application projects demonstrate the following:
8693
4. Select the “Settings->CAN” option from the top menu<br>
8794
![UBHA CAN Settings Dropdown](./images/UBHA_Settings_CAN_Dropdown.png)
8895
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<br>
96+
1. Nominal Bit Rate: 125.00 kbits/s
97+
2. CAN-FD: enabled
98+
3. CAN-FD TX Data Length: 8
99+
4. Flexible Data Rate: Enabled
100+
5. Flexible Data Rate: 2Mbits/s
101+
6. Message Format: Standard
102+
7. Host to Device ID: 0xA1
103+
8. Device to Host ID: 0xA2<br>
97104
![CAN Settings](./images/UBHA_CAN_Settings.png)
98105
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<br>
106+
1. 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<br>
100107
![Read Device Settings](./images/UBHA_Read_Device_Settings.png)
101108
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<br>
109+
1. Select app.X/dist/default/production/app.X.production.hex. This is included with the demo but may have been re-generated if Building the Application (Optional) was completed<br>
103110
![Open Hex File](./images/UBHA_Open_Hex.png)
104111
8. Check the "Enable Self Verification After Program" checkbox<br>
105112
![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<br>
113+
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.<br>**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
114+
1. During the verification process, LED6 will be solid to indicate the image is being verified.
115+
2. After the verification process is complete, LED6 will turn off. If the image was verified, it will start to run and LED11 should be blinking. If LED6 is still solid, the image failed verification and is still in bootload mode.<br>
108116
![Program Device](./images/UBHA_Program.png)
109117

118+
#### Re-Entering Bootloader Mode
119+
1. Power off the board by unplugging the micro-USB cable from port J1
120+
2. While the board is powered off, hold down switch S1<br>
121+
![S1](./images/switch_location.png)
122+
3. Continue holding down S1 and plug the micro-USB cable back into port J1
123+
4. Once the board is powered back on, release S1
124+
5. Verify LED11 is solid, indicating the device is in bootloader mode. The application can now be loaded once again (see Loading the Application)
125+
110126
## Trademarks
111127

112128
MPLAB® is a registered trademark of Microchip Technology Inc. All other trademarks are the property of their respective owner.

0 commit comments

Comments
 (0)