Skip to content

Commit 8f4c220

Browse files
aiwyatt787davidflowers
authored andcommitted
Pull request #4: Move demos to external staging repo
Merge in MCU16CE/dspic-bootloader-mdfu from ~C74569/dspic-bootloader-mdfu:feature/CC16BOOT-8699-move-demos-to-github-staging-repo to develop * commit 'cc05d5edea66a18ca1a2f8b15f191e8feeb79796': Fix invalid marketing terms Add chmod to build scripts for .sh files Move demos to external staging repo
2 parents 877f200 + cc05d5e commit 8f4c220

File tree

633 files changed

+104693
-10
lines changed

Some content is hidden

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

633 files changed

+104693
-10
lines changed

.citd/Jenkinsfilek8s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ pipeline {
8484

8585
stage('Build') {
8686
steps {
87-
script {
87+
script {
88+
sh("find . -type f -name postBuild.sh -exec chmod +x {} \\;")
89+
sh("find . -type f -name preBuild.sh -exec chmod +x {} \\;")
8890
mplabxProjectBuild(
8991
sourceFilePath: "${env.MPLABX_PROJECT_SOURCE}"
9092
)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ An example secure bootloader using the Microchip Device Firmware Update (MDFU) p
3535
### Setup And Operation
3636
See [secure_boot_uart_2_images](secure_boot_uart_2_images/) and the associated [README.md](secure_boot_uart_2_images/README.md) files for details on the required hardware, software, setup, and how to run the demo.
3737

38-
## <u>dsPIC33A Multi-Image ECDSA CAN-TP Boot Demo</u>
38+
## <u>dsPIC33A Multi-Image ECDSA CAN Boot Demo</u>
3939

4040
### Summary
41-
An example secure bootloader using the Microchip Device Firmware Update (MDFU) protocol and CAN-TP peripheral on the Curiosity Platform Development Board with a dsPIC33AK512MPS512 DIM demonstrating the following:
42-
* Secure firmware update via CAN-TP using Microchip Device Firmware Update (MDFU) protocol
41+
An example secure bootloader using the Microchip Device Firmware Update (MDFU) protocol and CAN-FD peripheral on the Curiosity Platform Development Board with a dsPIC33AK512MPS512 DIM demonstrating the following:
42+
* Secure firmware update via CAN-FD using Microchip Device Firmware Update (MDFU) protocol
4343
* Application verification checking using Elliptic Curve Digital Signature Algorithm (ECDSA) with P-384
4444

4545
### Related Documentation

changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
### Release Highlights
33

44
* Addition of "dsPIC33A Single Image CRC UART Boot Demo" and "dsPIC33A Multi-Image ECDSA UART Boot Demo" to the dsPIC Bootloader MDFU repository.
5-
* Initial Release of "dsPIC33A Multi-Image ECDSA CAN-TP Boot Demo". Refer to the README.md for a summary and execution procedure
5+
* Initial Release of "dsPIC33A Multi-Image ECDSA CAN Boot Demo". Refer to the README.md for a summary and execution procedure
66

77
### Features Added\Updated
88

99
* Addition of "dsPIC33A Single Image CRC UART Boot Demo" and "dsPIC33A Multi-Image ECDSA UART Boot Demo" to the dsPIC Bootloader MDFU repository.
10-
* Initial Release of "dsPIC33A Multi-Image ECDSA CAN-TP Boot Demo". Refer to the README.md for a summary and execution procedure.
10+
* Initial Release of "dsPIC33A Multi-Image ECDSA CAN Boot Demo". Refer to the README.md for a summary and execution procedure.
1111

dspic33a/crc_uart_1_image/README.md

Lines changed: 316 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#
2+
# There exist several targets which are by default empty and which can be
3+
# used for execution of your targets. These targets are usually executed
4+
# before and after some main targets. They are:
5+
#
6+
# .build-pre: called before 'build' target
7+
# .build-post: called after 'build' target
8+
# .clean-pre: called before 'clean' target
9+
# .clean-post: called after 'clean' target
10+
# .clobber-pre: called before 'clobber' target
11+
# .clobber-post: called after 'clobber' target
12+
# .all-pre: called before 'all' target
13+
# .all-post: called after 'all' target
14+
# .help-pre: called before 'help' target
15+
# .help-post: called after 'help' target
16+
#
17+
# Targets beginning with '.' are not intended to be called on their own.
18+
#
19+
# Main targets can be executed directly, and they are:
20+
#
21+
# build build a specific configuration
22+
# clean remove built files from a configuration
23+
# clobber remove all built files
24+
# all build all configurations
25+
# help print help mesage
26+
#
27+
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28+
# .help-impl are implemented in nbproject/makefile-impl.mk.
29+
#
30+
# Available make variables:
31+
#
32+
# CND_BASEDIR base directory for relative paths
33+
# CND_DISTDIR default top distribution directory (build artifacts)
34+
# CND_BUILDDIR default top build directory (object files, ...)
35+
# CONF name of current configuration
36+
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
37+
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
38+
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
39+
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
40+
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
41+
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
42+
#
43+
# NOCDDL
44+
45+
46+
# Environment
47+
MKDIR=mkdir
48+
CP=cp
49+
CCADMIN=CCadmin
50+
RANLIB=ranlib
51+
52+
53+
# build
54+
build: .build-post
55+
56+
.build-pre:
57+
# Add your pre 'build' code here...
58+
59+
.build-post: .build-impl
60+
# Add your post 'build' code here...
61+
62+
63+
# clean
64+
clean: .clean-post
65+
66+
.clean-pre:
67+
# Add your pre 'clean' code here...
68+
# WARNING: the IDE does not call this target since it takes a long time to
69+
# simply run make. Instead, the IDE removes the configuration directories
70+
# under build and dist directly without calling make.
71+
# This target is left here so people can do a clean when running a clean
72+
# outside the IDE.
73+
74+
.clean-post: .clean-impl
75+
# Add your post 'clean' code here...
76+
77+
78+
# clobber
79+
clobber: .clobber-post
80+
81+
.clobber-pre:
82+
# Add your pre 'clobber' code here...
83+
84+
.clobber-post: .clobber-impl
85+
# Add your post 'clobber' code here...
86+
87+
88+
# all
89+
all: .all-post
90+
91+
.all-pre:
92+
# Add your pre 'all' code here...
93+
94+
.all-post: .all-impl
95+
# Add your post 'all' code here...
96+
97+
98+
# help
99+
help: .help-post
100+
101+
.help-pre:
102+
# Add your pre 'help' code here...
103+
104+
.help-post: .help-impl
105+
# Add your post 'help' code here...
106+
107+
108+
109+
# include project implementation makefile
110+
include nbproject/Makefile-impl.mk
111+
112+
# include project make variables
113+
include nbproject/Makefile-variables.mk

dspic33a/crc_uart_1_image/app.X/app.mc3

Lines changed: 273 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
22+
#ifndef BUTTON_SIMPLE_H
23+
#define BUTTON_SIMPLE_H
24+
25+
#include <stdbool.h>
26+
27+
/**
28+
@ingroup button_simple
29+
@struct BUTTON_SIMPLE
30+
@brief Defines structure for interface for a simple button interface
31+
*/
32+
struct BUTTON_SIMPLE
33+
{
34+
//Initialize the button. Must be called before other functions can be used
35+
void (*const initialize)(void);
36+
//Gives the current state of the button (not debounced)
37+
bool (*const isPressed)(void);
38+
};
39+
40+
#endif
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
22+
#include <xc.h>
23+
#include "led0.h"
24+
25+
void LED0_Initialize(void)
26+
{
27+
TRISCbits.TRISC3 = 0;
28+
}
29+
30+
void LED0_On(void)
31+
{
32+
LATCbits.LATC3 = 1;
33+
}
34+
35+
void LED0_Off(void)
36+
{
37+
LATCbits.LATC3 = 0;
38+
}
39+
40+
void LED0_Toggle(void)
41+
{
42+
LATCbits.LATC3 ^= 1;
43+
}
44+
45+
void LED0_Set(bool on)
46+
{
47+
LATCbits.LATC3 = on;
48+
}
49+
50+
const struct LED_SIMPLE led0 =
51+
{
52+
&LED0_Initialize,
53+
&LED0_On,
54+
&LED0_Off,
55+
&LED0_Toggle,
56+
&LED0_Set
57+
};
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
#ifndef LED_0_H
22+
#define LED_0_H
23+
24+
#include "led_simple.h"
25+
#include <stdbool.h>
26+
27+
/**
28+
* @ingroup led0
29+
* @brief Initializes the LED. Must be called before other functions can be used.
30+
* @param none
31+
* @return none
32+
*/
33+
void LED0_Initialize(void);
34+
35+
/**
36+
* @ingroup led0
37+
* @brief Turns on the LED
38+
* @param none
39+
* @return none
40+
*/
41+
void LED0_On(void);
42+
43+
/**
44+
* @ingroup led0
45+
* @brief Turns off the LED
46+
* @param none
47+
* @return none
48+
*/
49+
void LED0_Off(void);
50+
51+
/**
52+
* @ingroup led0
53+
* @brief Toggles the LED between on/off states (on->off or off->on)
54+
* @param none
55+
* @return none
56+
*/
57+
void LED0_Toggle(void);
58+
59+
/**
60+
* @ingroup led0
61+
* @brief Sets the LED on(true) or off(false) based on provided input.
62+
* @param[in] bool on - true = on, false = off
63+
* @return none
64+
*/
65+
void LED0_Set(bool on);
66+
67+
/**
68+
@ingroup led0
69+
@brief Declaration of LED_SIMPLE structure for LED0.
70+
*/
71+
extern const struct LED_SIMPLE led0;
72+
73+
#endif
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
22+
#include <xc.h>
23+
#include "led1.h"
24+
25+
void LED1_Initialize(void)
26+
{
27+
TRISCbits.TRISC4 = 0;
28+
}
29+
30+
void LED1_On(void)
31+
{
32+
LATCbits.LATC4 = 1;
33+
}
34+
35+
void LED1_Off(void)
36+
{
37+
LATCbits.LATC4 = 0;
38+
}
39+
40+
void LED1_Toggle(void)
41+
{
42+
LATCbits.LATC4 ^= 1;
43+
}
44+
45+
void LED1_Set(bool on)
46+
{
47+
LATCbits.LATC4 = on;
48+
}
49+
50+
const struct LED_SIMPLE led1 =
51+
{
52+
&LED1_Initialize,
53+
&LED1_On,
54+
&LED1_Off,
55+
&LED1_Toggle,
56+
&LED1_Set
57+
};

0 commit comments

Comments
 (0)