Skip to content

Commit 8919e4b

Browse files
aiwyatt787davidflowers
authored andcommitted
Pull request #100: Add fix and update version and changelog, MCU16GITHUB-1786, MCU16GITHUB-1788
Merge in MCU16CE/dspic33-dsc-bootloader-code-examples from ~C74569/dspic33-dsc-bootloader-code-examples:bugfix/MCU16GITHUB-1796-fix-invalid-mode to develop * commit 'e82ec3499213e5bddb7a35b8f04f43653959c4a8': Add fix and update version and changelog
2 parents 88de751 + e82ec34 commit 8919e4b

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

.main-meta/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"content": {
55
"metaDataVersion": "1.3.0",
66
"name": "com.microchip.mplabx.project.dspic33-dsc-bootloader-code-examples",
7-
"version": "1.2.4",
7+
"version": "1.2.5",
88
"displayName": "dsPIC33 DSC Bootloader Code Examples",
99
"projectName": "dspic33-dsc-bootloader-code-examples",
1010
"shortDescription": "dsPIC33 DSC Bootloader Code Examples",

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# dsPIC33 DSC Bootloader Code Examples v1.2.5
2+
### Release Highlights
3+
* Removed invalid mode change in dspic33a_secure_boot demo.
4+
5+
### Features Added\Updated
6+
* Removed invalid mode change in dspic33a_secure_boot demo.
7+
18
# dsPIC33 DSC Bootloader Code Examples v1.2.4
29
### Release Highlights
310
* Corrected application/executable entry address in dspic33a_bootloader_and_firmware_upgrade_demo and dspic33a_secure_boot.

dspic33a_secure_boot/.main-meta/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"content": {
55
"metaDataVersion": "1.3.0",
66
"name": "com.microchip.mplabx.project.dspic33a-secure-boot-and-secure-firmware-upgrade-demo",
7-
"version": "1.2.4",
7+
"version": "1.2.5",
88
"displayName": "dsPIC33A Secure Boot and Secure Firmware Upgrade Demo",
99
"projectName": "dspic33a-secure-boot-and-secure-firmware-upgrade-demo",
1010
"shortDescription": "This MPLAB® X IDE example demonstrates how to perform secure boot authentication and secure firmware upgrade via UART with Microchip Device Firmware Update Protocol (M-DFU) and ECDSA with P-384 verification within MCC Melody.",

dspic33a_secure_boot/boot.X/mdfu/mdfu_boot_demo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ void MDFU_BootDemoTasks(void)
153153
if(executable.modeChange(MDFU_PARTITION_MODE_READ & MDFU_PARTITION_MODE_WRITE) == MDFU_PARTITION_STATUS_SUCCESS)
154154
{
155155
executable.copy(&download);
156-
/* Make the executable partition readable and locked to prevent self writes. */
157-
if (executable.modeChange(MDFU_PARTITION_MODE_READ & MDFU_PARTITION_MODE_LOCKED) != MDFU_PARTITION_STATUS_SUCCESS)
156+
/* Make the executable partition readable to prevent self writes. */
157+
if (executable.modeChange(MDFU_PARTITION_MODE_READ) != MDFU_PARTITION_STATUS_SUCCESS)
158158
{
159159
Reset();
160160
}

dspic33a_secure_boot/boot.X/mdfu/mdfu_partition_executable.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ static enum MDFU_PARTITION_STATUS ModeChange(enum MDFU_PARTITION_MODE mode)
276276
enum FLASH_REGION_PERMISSION permissions = (FLASH_REGION_PERMISSION_EXECUTION_ENABLED & FLASH_REGION_PERMISSION_READ_ENABLED);
277277
status = flashRegion2.permissionsSet(permissions, true) ? MDFU_PARTITION_STATUS_SUCCESS : MDFU_PARTITION_STATUS_LOCKED;
278278
}
279+
else if (mode == (enum MDFU_PARTITION_MODE)(MDFU_PARTITION_MODE_READ))
280+
{
281+
enum FLASH_REGION_PERMISSION permissions = (FLASH_REGION_PERMISSION_READ_ENABLED);
282+
status = flashRegion2.permissionsSet(permissions, false) ? MDFU_PARTITION_STATUS_SUCCESS : MDFU_PARTITION_STATUS_LOCKED;
283+
}
279284
else
280285
{
281286
}

0 commit comments

Comments
 (0)