Skip to content

Commit f6350ce

Browse files
aiwyatt787davidflowers
authored andcommitted
Pull request #4: Feature/MCU16GITHUB-840 Generate boot.x in MCC Feature/MCU16GITHUB-839 Generate app.x in MCC
Merge in MCU16CE/dspic33-dsc-bootloader-code-examples from ~C74569/dspic33-dsc-bootloader-code-examples:feature/MCU16GITHUB-840-generate-boot.x-in-mcc to feature/MCU16GITHUB-836-bootloader-pre-generated-demos Squashed commit of the following: commit a58768904faa548abebd5f7cea221b5ef7ce02ac Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Wed Feb 28 12:19:15 2024 -0700 Re-add call to timer stop commit c19a2faac89ed2ed81c49e786868543b4c846ef1 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Mon Feb 26 14:30:48 2024 -0700 Update hal_timer so no merge resolution is needed commit d327995f302849b3a61bc1887716f9275508891c Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Mon Feb 26 13:26:17 2024 -0700 Remove LED code from boot_demo to avoid merge conflicts on generation commit 9e0c74cd6fdc1154069a00abe198465b590d1fc3 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Mon Feb 26 09:55:44 2024 -0700 Remove unnecessary stubbed files commit 0bc32c3130f4cda1484531d1e1556cf8923b13cc Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 13:07:11 2024 -0700 Change slash direction commit ffd6474f376601740c884109f5d2ba902abff85b Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 12:47:25 2024 -0700 Add chmod to the config file commit 9609f66856cba0ca5ac9a90a79679f9b8a741cd7 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 12:31:20 2024 -0700 Update project name commit 0a00b40fa06a70af3f0f751505e6268c064c8166 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 12:20:24 2024 -0700 Regenerate app and update bootloader MCC to include CAL and TALIB commit 3af2b3236612c34af6e5df38c01181abe4fe2b76 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 11:19:23 2024 -0700 Update source root list commit 9ca2f1f017393d0b00975040e29f8d7d91c6632c Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 10:47:54 2024 -0700 Update toolchain commit 4dc1ac443915e75a9e387c584fd9ec551a94b572 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Thu Feb 22 10:25:36 2024 -0700 Add app project commit bf0b6b859203ba023cdeba3d329289ed5eb3b8ef Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Wed Feb 21 15:20:02 2024 -0700 Update configurations commit 1d09b812dcbddc13caf3a9c11349be39f8e179d2 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Wed Feb 21 15:15:28 2024 -0700 Add external hal_timer and remove stub commit a1a6e35fb8bb31d9f751c9df4112a325d8f9cb68 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Wed Feb 21 10:25:00 2024 -0700 Stub remaining two files commit e8c9642893105a3992c3fd80b59b34c362be6929 Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Tue Feb 20 16:29:48 2024 -0700 Remove app and submit in seperate PR commit 9ca6a012d62d867aac49b18b0ef981123414f08e Author: Anastasia Wyatt <Tess.Wyatt@microchip.com> Date: Tue Feb 20 16:19:50 2024 -0700 Stub CAL and TALIB files and add app and bootloader
1 parent df13c82 commit f6350ce

File tree

110 files changed

+16159
-57
lines changed

Some content is hidden

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

110 files changed

+16159
-57
lines changed

dsPIC33CK1024MP710/app.X/app.mc3

Lines changed: 292 additions & 0 deletions
Large diffs are not rendered by default.

dsPIC33CK1024MP710/app.X/main.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
© [2024] Microchip Technology Inc. and its subsidiaries.
3+
4+
Subject to your compliance with these terms, you may use Microchip
5+
software and any derivatives exclusively with Microchip products.
6+
You are responsible for complying with 3rd party license terms
7+
applicable to your use of 3rd party software (including open source
8+
software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
9+
NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
10+
SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
11+
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
12+
WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
13+
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
14+
KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
15+
MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
16+
FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
17+
TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
18+
EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
19+
THIS SOFTWARE.
20+
*/
21+
#include "mcc_generated_files/system/system.h"
22+
#include "mcc_generated_files/system/pins.h"
23+
24+
/*
25+
Main application
26+
*/
27+
28+
int main(void) {
29+
unsigned int counter = 0;
30+
31+
SYSTEM_Initialize();
32+
33+
while (1) {
34+
if ((counter++ % 0x8000) == 0) {
35+
IO_RE9_Toggle();
36+
}
37+
}
38+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
/**
3+
@Generated 16-bit Bootloader Source File
4+
5+
@Company:
6+
Microchip Technology Inc.
7+
8+
@File Name:
9+
app_code_protect.c
10+
11+
@Summary:
12+
This is the app_code_protect.c file generated using 16-bit Bootloader
13+
14+
@Description:
15+
This header file provides implementations for driver APIs for all modules selected in the GUI.
16+
Generation Information :
17+
Product Revision : 16-bit Bootloader - 1.25.0
18+
Device : dsPIC33CK1024MP710
19+
The generated drivers are tested against the following:
20+
Compiler : XC16 v1.36B
21+
MPLAB : MPLAB X v5.15
22+
*/
23+
/*
24+
Copyright (c) [2012-2024] Microchip Technology Inc.
25+
26+
All rights reserved.
27+
28+
You are permitted to use the accompanying software and its derivatives
29+
with Microchip products. See the Microchip license agreement accompanying
30+
this software, if any, for additional info regarding your rights and
31+
obligations.
32+
33+
MICROCHIP SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
34+
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
35+
LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT
36+
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP OR ITS
37+
LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT
38+
LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE
39+
THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
40+
LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES,
41+
OR OTHER SIMILAR COSTS.
42+
43+
To the fullest extend allowed by law, Microchip and its licensors
44+
liability will not exceed the amount of fees, if any, that you paid
45+
directly to Microchip to use this software.
46+
47+
THIRD PARTY SOFTWARE: Notwithstanding anything to the contrary, any
48+
third party software accompanying this software is subject to the terms
49+
and conditions of the third party's license agreement. To the extent
50+
required by third party licenses covering such third party software,
51+
the terms of such license will apply in lieu of the terms provided in
52+
this notice or applicable license. To the extent the terms of such
53+
third party licenses prohibit any of the restrictions described here,
54+
such restrictions will not apply to such third party software.
55+
*/
56+
57+
#include <xc.h>
58+
59+
#if (__XC16_VERSION__ < 1050)
60+
#error "The code protection/CodeGuard feature of this bootloader requires features only found in XC16 version 1.50 or later. Update to a newer version of the XC16 compiler."
61+
#endif
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
@Generated 16-bit Bootloader Source File
3+
4+
@Company:
5+
Microchip Technology Inc.
6+
7+
@File Name:
8+
application_header_requirements.c
9+
10+
@Summary:
11+
This is the application_header_requirements.c file generated using 16-bit Bootloader
12+
13+
@Description:
14+
This header file provides implementations for driver APIs for all modules selected in the GUI.
15+
Generation Information :
16+
Product Revision : 16-bit Bootloader - 1.25.0
17+
Device : dsPIC33CK1024MP710
18+
The generated drivers are tested against the following:
19+
Compiler : XC16 v1.36B
20+
MPLAB : MPLAB X v5.15
21+
*/
22+
/*
23+
Copyright (c) [2012-2024] Microchip Technology Inc.
24+
25+
All rights reserved.
26+
27+
You are permitted to use the accompanying software and its derivatives
28+
with Microchip products. See the Microchip license agreement accompanying
29+
this software, if any, for additional info regarding your rights and
30+
obligations.
31+
32+
MICROCHIP SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
33+
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
34+
LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT
35+
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP OR ITS
36+
LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT
37+
LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE
38+
THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
39+
LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES,
40+
OR OTHER SIMILAR COSTS.
41+
42+
To the fullest extend allowed by law, Microchip and its licensors
43+
liability will not exceed the amount of fees, if any, that you paid
44+
directly to Microchip to use this software.
45+
46+
THIRD PARTY SOFTWARE: Notwithstanding anything to the contrary, any
47+
third party software accompanying this software is subject to the terms
48+
and conditions of the third party's license agreement. To the extent
49+
required by third party licenses covering such third party software,
50+
the terms of such license will apply in lieu of the terms provided in
51+
this notice or applicable license. To the extent the terms of such
52+
third party licenses prohibit any of the restrictions described here,
53+
such restrictions will not apply to such third party software.
54+
*/
55+
56+
#include <xc.h>
57+
58+
#if (__XC16_VERSION__ < 1060)
59+
#error "The scripts generated to sign, or help sign, the application image require MPLAB XC16 version 1.60 or later. Install MPLAB XC16 version 1.60 and add it to the system path."
60+
#endif
61+
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/**
2+
@Generated 16-bit Bootloader Source File
3+
4+
@Company:
5+
Microchip Technology Inc.
6+
7+
@File Name:
8+
application_header_secure_element.S
9+
10+
@Summary:
11+
This is the application_header_secure_element.S file generated using 16-bit Bootloader
12+
13+
@Description:
14+
This header file provides implementations for driver APIs for all modules selected in the GUI.
15+
Generation Information :
16+
Product Revision : 16-bit Bootloader - 1.25.0
17+
Device : dsPIC33CK1024MP710
18+
The generated drivers are tested against the following:
19+
Compiler : XC16 v1.36B
20+
MPLAB : MPLAB X v5.15
21+
*/
22+
/*
23+
Copyright (c) [2012-2024] Microchip Technology Inc.
24+
25+
All rights reserved.
26+
27+
You are permitted to use the accompanying software and its derivatives
28+
with Microchip products. See the Microchip license agreement accompanying
29+
this software, if any, for additional info regarding your rights and
30+
obligations.
31+
32+
MICROCHIP SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
33+
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
34+
LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT
35+
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP OR ITS
36+
LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT
37+
LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE
38+
THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
39+
LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES,
40+
OR OTHER SIMILAR COSTS.
41+
42+
To the fullest extend allowed by law, Microchip and its licensors
43+
liability will not exceed the amount of fees, if any, that you paid
44+
directly to Microchip to use this software.
45+
46+
THIRD PARTY SOFTWARE: Notwithstanding anything to the contrary, any
47+
third party software accompanying this software is subject to the terms
48+
and conditions of the third party's license agreement. To the extent
49+
required by third party licenses covering such third party software,
50+
the terms of such license will apply in lieu of the terms provided in
51+
this notice or applicable license. To the extent the terms of such
52+
third party licenses prohibit any of the restrictions described here,
53+
such restrictions will not apply to such third party software.
54+
*/
55+
56+
/* This file puts an application header at the start of the application image
57+
* that the bootloader will use to verify the integrity of the application image.
58+
*/
59+
60+
#include "boot_config.h"
61+
62+
.section .application_header_atecc608, code, address(BOOT_CONFIG_APPLICATION_IMAGE_APPLICATION_HEADER_ADDRESS), keep
63+
64+
/* Skip the instruction that holds the digital signature - this will have to be injected
65+
* by a tool later, but we need to reserve the space for it.
66+
*/
67+
.long(0)
68+
.long(0)
69+
.long(0)
70+
.long(0)
71+
.long(0)
72+
.long(0)
73+
.long(0)
74+
.long(0)
75+
.long(0)
76+
.long(0)
77+
.long(0)
78+
.long(0)
79+
.long(0)
80+
.long(0)
81+
.long(0)
82+
.long(0)
83+
84+
/* Address where to start the hash for the signature */
85+
.long(0x7000)
86+
87+
/* Address where to end the hash for the signature */
88+
.long(0x5AFFE)
89+
90+
/* Firmware Image Reset Remap */
91+
goto __resetPRI
92+
93+
/* Start of Extended Application Header */
94+
.word 0
95+
96+
/* Length of Extended Application Header */
97+
.long (2)
98+
99+
/* Count of Items in Application Header */
100+
.word (2)
101+
102+
/* Version Number ID */
103+
.word (2)
104+
105+
/* Version Number Length */
106+
.long (4)
107+
108+
/* Version Number Data - 32-bit number in the format of:
109+
* 0x00MMmmpp
110+
* MM = Major revision
111+
* mm = minor revision
112+
* pp = patch revision
113+
*
114+
* e.g. 0x00020A03 = version 2.10.3
115+
*/
116+
.long(0x0)
117+
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/**
2+
@Generated 16-bit Bootloader Source File
3+
4+
@Company:
5+
Microchip Technology Inc.
6+
7+
@File Name:
8+
boot_config.h
9+
10+
@Summary:
11+
This is the boot_config.h file generated using 16-bit Bootloader
12+
13+
@Description:
14+
This header file provides implementations for driver APIs for all modules selected in the GUI.
15+
Generation Information :
16+
Product Revision : 16-bit Bootloader - 1.25.0
17+
Device : dsPIC33CK1024MP710
18+
The generated drivers are tested against the following:
19+
Compiler : XC16 v1.36B
20+
MPLAB : MPLAB X v5.15
21+
*/
22+
/*
23+
Copyright (c) [2012-2024] Microchip Technology Inc.
24+
25+
All rights reserved.
26+
27+
You are permitted to use the accompanying software and its derivatives
28+
with Microchip products. See the Microchip license agreement accompanying
29+
this software, if any, for additional info regarding your rights and
30+
obligations.
31+
32+
MICROCHIP SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
33+
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
34+
LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT
35+
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP OR ITS
36+
LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT
37+
LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE
38+
THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
39+
LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES,
40+
OR OTHER SIMILAR COSTS.
41+
42+
To the fullest extend allowed by law, Microchip and its licensors
43+
liability will not exceed the amount of fees, if any, that you paid
44+
directly to Microchip to use this software.
45+
46+
THIRD PARTY SOFTWARE: Notwithstanding anything to the contrary, any
47+
third party software accompanying this software is subject to the terms
48+
and conditions of the third party's license agreement. To the extent
49+
required by third party licenses covering such third party software,
50+
the terms of such license will apply in lieu of the terms provided in
51+
this notice or applicable license. To the extent the terms of such
52+
third party licenses prohibit any of the restrictions described here,
53+
such restrictions will not apply to such third party software.
54+
*/
55+
#ifndef BOOT_CONFIG_H
56+
#define BOOT_CONFIG_H
57+
58+
#define BOOT_CONFIG_PROGRAMMABLE_ADDRESS_LOW 0x7000
59+
#define BOOT_CONFIG_PROGRAMMABLE_ADDRESS_HIGH 0x5AFFE
60+
61+
#define BOOT_CONFIG_DOWNLOAD_LOW 0x5B000
62+
#define BOOT_CONFIG_DOWNLOAD_HIGH 0xAEFFE
63+
64+
#define BOOT_CONFIG_VERIFICATION_APPLICATION_HEADER_SIZE 72
65+
66+
/* On devices with CodeGuard, the hardware will require the first page of the
67+
* application memory hold the AIVT table and the rest is not allowed to have
68+
* executable memory so we must offset the start of the actual application code
69+
* by this reserved hardware page. */
70+
#define BOOT_CONFIG_HARDWARE_RESERVED_SECTION 2048
71+
72+
#define BOOT_CONFIG_APPLICATION_IMAGE_APPLICATION_HEADER_ADDRESS (BOOT_CONFIG_PROGRAMMABLE_ADDRESS_LOW + BOOT_CONFIG_HARDWARE_RESERVED_SECTION)
73+
74+
#define BOOT_CONFIG_APPLICATION_RESET_ADDRESS (BOOT_CONFIG_PROGRAMMABLE_ADDRESS_LOW + BOOT_CONFIG_VERIFICATION_APPLICATION_HEADER_SIZE + BOOT_CONFIG_HARDWARE_RESERVED_SECTION)
75+
76+
77+
#define BOOT_CONFIG_DISABLE_CHECKSUM_COMMAND
78+
79+
#define BOOT_CONFIG_VERSION 0x0102
80+
81+
#define BOOT_CONFIG_MAX_PACKET_SIZE 0x100
82+
83+
#endif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hexmate r0-DFFF,..\..\..\boot.X\dist\default\production\boot.X.production.hex rE000-B5FFF,..\..\dist\default\production\app.X.production.hex rB6000-FFFFFFFF,..\..\..\boot.X\dist\default\production\boot.X.production.hex -O..\..\dist\default\production\combined.production.hex
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hexmate r0-DFFF,../../../boot.X/dist/default/production/boot.X.production.hex rE000-B5FFF,../../dist/default/production/app.X.production.hex rB6000-FFFFFFFF,../../../boot.X/dist/default/production/boot.X.production.hex -O../../dist/default/production/combined.production.hex

0 commit comments

Comments
 (0)