|
5 | 5 | </picture> |
6 | 6 |
|
7 | 7 | ## Secure Boot and Secure Firmware Upgrade over CAN-FD for dsPIC33C DSCs Demo - ICSP Inhibit |
8 | | - |
9 | | -#### ICSP Inhibit |
10 | 8 | --- |
11 | 9 | > **_!!WARNING!!_** |
12 | 10 | **Running the icsp_inhibit.X application and following the steps outlined in the resulting console will PERMANENTLY DISABLE direct programming and debugging of the board. For additional information, see section 5.5: Flash OTP by ICSP Write Inhibit of the [dsPIC33CK1024MP708 Family Data Sheet](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU16/ProductDocuments/DataSheets/dsPIC33CK1024MP710-Family-Data-Sheet-DS70005496.pdf).** |
13 | 11 |
|
14 | 12 | --- |
15 | 13 |
|
16 | 14 | ## Introduction |
17 | | -This project contains an application which, when programmed properly via the bootloader, prevents alteration of all Flash memory and permanently disables direct programming and debugging of the board. Once programmed, ICSP inhibit cannot be deactivated. |
| 15 | +This project contains an application which, when programmed properly via the bootloader, prevents alteration of all Flash memory and **PERMANANTLEY** disables direct programming and debugging of the board. Once programmed, ICSP inhibit cannot be deactivated. |
| 16 | + |
| 17 | +All tool setup and programming instructions for the bootloader and application are the same as those used in boot.X and app.X, however the icsp_inhibit.X project will be used in place of app.X referenced in the README.md file in the top-level folder. For additional details on tool setup and how to run the demo, see the [README.md](../README.md) file in the top-level folder. |
18 | 18 |
|
19 | | -All software and hardware are the same as those used in boot.X and app.X. See the README.md file in the top-level folder of the demo for additional tool setup instructions. |
| 19 | +**NOTE: The ICSP inhibit functionality can only be programmed via bootloader. Direct download of the icsp_inhibit.X application will prevent the ICSP inhibit feature from being installed.** |
20 | 20 |
|
21 | 21 | ## Running the Demo |
22 | 22 |
|
23 | | -#### Programming the Bootloader |
24 | | -**NOTE: The ICSP inhibit functionality can only be programmed via bootloader. Direct download of the icsp_inhibit.X application will prevent the ICSP inhibit feature from being installed.** |
25 | | -1. Open the boot.X project in MPLAB® X |
26 | | -2. Open MCC |
27 | | -3. Right click on Project Resources and select "Force Update on All"<br> |
28 | | - |
29 | | -4. Click "Generate"<br> |
30 | | - |
31 | | -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> |
32 | | - |
33 | | -6. Press the “Make and Program” button on the top bar<br> |
34 | | - |
35 | | -7. Select the appropriate programmer if prompted |
36 | | -8. The project should compile and program successfully |
37 | | -9. Verify the LED11 is solid on the Development Board. This indicates the bootloader is running |
| 23 | +#### Building the Bootloader |
| 24 | +* See the [README.md](../README.md) file in the top-level folder. |
38 | 25 |
|
39 | 26 | #### Building the ICSP Inhibit Application |
40 | | -1. Open the icsp_inhibit.X project in MPLAB® X |
41 | | -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> |
42 | | - |
43 | | -3. The project should compile cleanly. icsp_inhibit.X/dist/default/production/icsp_inhibit.X.production.hex should be generated |
44 | | -4. Verify that LED11 is still solid |
45 | | - a. If LED11 is not longer solid, then the application code was programmed instead of only compiled. Go back to the “Programming the Bootloader” stage and re-program the bootloader |
| 27 | +* See the [README.md](../README.md) file in the top-level folder. **NOTE: The icsp_inhibit.X application does not utilize a blinking LED to indicate the application is running** |
46 | 28 |
|
47 | 29 | #### Loading the Application |
| 30 | +* See the [README.md](../README.md) file in the top-level folder. |
48 | 31 | **NOTE: The ICSP inhibit functionality will only be programmed once the steps in Locking the Device have been completed successfully. The steps listed in this section (Loading the Application) will not permanentley alter the device** |
49 | | -1. Open the Universal Bootloader Host Application tool (UBHA)<br> |
50 | | - |
51 | | -2. Select the “PIC24/dsPIC” option from the “Device Architecture” selection drop down<br> |
52 | | - |
53 | | -3. Select “CAN” from the protocol drop down selection box<br> |
54 | | - |
55 | | -4. Select the “Settings->CAN” option from the top menu<br> |
56 | | - |
57 | | -5. Select the Peak protocol analyzer being used and the appropriate CAN configuration settings for this demo (listed below). When complete, press “Apply”: |
58 | | - a. Nominal Bit Rate: 125.00 kbits/s |
59 | | - b. CAN-FD: enabled |
60 | | - c. CAN-FD TX Data Length: 8 |
61 | | - d. Flexible Data Rate: Enabled |
62 | | - e. Flexible Data Rate: 2Mbits/s |
63 | | - f. Message Format: Standard |
64 | | - g. Host to Device ID: 0xA1 |
65 | | - h. Device to Host ID: 0xA2<br> |
66 | | - |
67 | | -6. Press the "Read Device Settings" button |
68 | | - 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> |
69 | | - |
70 | | -7. Load the application hex file by selecting “File->Open/Load File (*.hex)” |
71 | | - a. Select the file generated in the previous section: icsp_inhibit.X/dist/default/production/icsp_inhibit.X.production.hex<br> |
72 | | - |
73 | | -8. Check the "Enable Self Verification After Program" checkbox<br> |
74 | | - |
75 | | -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<br> |
76 | | - |
| 32 | +**NOTE: When prompted in the instructions, utilize the hex file located at icsp_inhibit.X/dist/default/production/icsp_inhibit.X.production.hex** |
| 33 | +**NOTE: The icsp_inhibit.X application does not utilize a blinking LED to indicate the application is running** |
77 | 34 |
|
78 | 35 | #### Locking the Device |
79 | 36 | 1. Open a terminal emulator program such as Tera Term and connect to the COM port used by the device. If the COM port is unknown: |
80 | | - 1. Open UBHA |
81 | | - 2. Select "UART" from the protocol drop down selection box<br> |
| 37 | + 1. Open UBHA. |
| 38 | + 2. Select "UART" from the protocol drop down selection box.<br> |
82 | 39 |  |
83 | | - 3. Select the “Settings->Serial” option from the top menu<br> |
| 40 | + 3. Select the “Settings->Serial” option from the top menu.<br> |
84 | 41 |  |
85 | | - 4. With the micro-USB cable connected to port J1 of the Development Board, click the COM Port dropdown and note the COM ports listed<br> |
| 42 | + 4. With the micro-USB cable connected to port J1 of the Development Board, click the COM Port dropdown and note the COM ports listed.<br> |
86 | 43 |  |
87 | | - 5. Unplug the micro-USB cable from port J1 and click the Refresh button in the Port Settings next to the COM Port dropdown |
88 | | - 6. Click the COM Port dropdown and note which COM port is missing. This is the port that is being used by the device |
89 | | -2. Run the application. Text should appear in the console indicating the ICSP inhibit application is running |
90 | | -3. **!!NOTE: THE FOLLOWING WILL PERMANENTLY LOCK THE DEVICE, DISABLING PROGRAMMING AND DEBUGGING** In all CAPS type, "LOCKDEVICE" and hit enter. Flash memory is not restricted and the board is locked from any programming or debugging. |
| 44 | + 5. Unplug the micro-USB cable from port J1 and click the Refresh button in the Port Settings next to the COM Port dropdown. |
| 45 | + 6. Click the COM Port dropdown and note which COM port is missing. This is the port that is being used by the device. |
| 46 | +2. Run the application. Text should appear in the console indicating the ICSP inhibit application is running. |
| 47 | +3. **!!NOTE: THE FOLLOWING WILL PERMANENTLY LOCK THE DEVICE, DISABLING PROGRAMMING AND DEBUGGING.** In all CAPS type, "LOCKDEVICE" and hit enter. Flash memory is not restricted and the board is locked from any programming or debugging. |
91 | 48 |
|
92 | 49 | ## Trademarks |
93 | 50 |
|
|
0 commit comments