File tree Expand file tree Collapse file tree 6 files changed +67
-6
lines changed
secure_boot_and_secure_firmware_upgrade_over_canfd Expand file tree Collapse file tree 6 files changed +67
-6
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,15 @@ The associated bootloader and application projects demonstrate the following:
107107 a. After a few seconds, LED11 should be blinking<br >
108108![ Program Device] ( ./images/UBHA_Program.png )
109109
110+ #### Re-Entering Bootloader Mode
111+ 1 . Power off the board by unplugging the micro-USB cable from port J1
112+ 2 . While the board is powered off, hold down switch S1<br >
113+ ![ S1] ( ./images/switch_location.png )
114+ 3 . Continue holding down S1 and plug the micro-USB cable back into port J1
115+ 4 . Once the board is powered back on, release S1
116+ 5 . Verify LED11 is solid, indicating the device is in bootloader mode. The application can now be loaded once again (see Loading the Application)
117+
118+
110119## Trademarks
111120
112121MPLAB® is a registered trademark of Microchip Technology Inc. All other trademarks are the property of their respective owner.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ Copyright (c) [2012-2024] Microchip Technology Inc.
6060#include "boot_application_header.h"
6161#include "boot_image.h"
6262#include "boot_process.h"
63+ #include "../mcc_generated_files/system/pins.h"
6364#include "../mcc_generated_files/timer/mccp9.h"
6465
6566#define DOWNLOADED_IMAGE 1u
@@ -216,5 +217,5 @@ static bool EnterBootloadMode(void)
216217 /* NOTE: This might be a a push button status on power up, a command from a peripheral,
217218 * or whatever is specific to your boot loader implementation */
218219
219- return false ;
220+ return ( IO_RD13_GetValue () == 0 ) ;
220221}
Original file line number Diff line number Diff line change 9494 */
9595#define IO_RA6_SetDigitalOutput () (_TRISA6 = 0)
9696
97+ /**
98+ * @ingroup pinsdriver
99+ * @brief Sets the RD13 GPIO Pin which has a custom name of IO_RD13 to High
100+ * @pre The RD13 must be set as Output Pin
101+ * @param none
102+ * @return none
103+ */
104+ #define IO_RD13_SetHigh () (_LATD13 = 1)
105+
106+ /**
107+ * @ingroup pinsdriver
108+ * @brief Sets the RD13 GPIO Pin which has a custom name of IO_RD13 to Low
109+ * @pre The RD13 must be set as Output Pin
110+ * @param none
111+ * @return none
112+ */
113+ #define IO_RD13_SetLow () (_LATD13 = 0)
114+
115+ /**
116+ * @ingroup pinsdriver
117+ * @brief Toggles the RD13 GPIO Pin which has a custom name of IO_RD13
118+ * @pre The RD13 must be set as Output Pin
119+ * @param none
120+ * @return none
121+ */
122+ #define IO_RD13_Toggle () (_LATD13 ^= 1)
123+
124+ /**
125+ * @ingroup pinsdriver
126+ * @brief Reads the value of the RD13 GPIO Pin which has a custom name of IO_RD13
127+ * @param none
128+ * @return none
129+ */
130+ #define IO_RD13_GetValue () _RD13
131+
132+ /**
133+ * @ingroup pinsdriver
134+ * @brief Configures the RD13 GPIO Pin which has a custom name of IO_RD13 as Input
135+ * @param none
136+ * @return none
137+ */
138+ #define IO_RD13_SetDigitalInput () (_TRISD13 = 1)
139+
140+ /**
141+ * @ingroup pinsdriver
142+ * @brief Configures the RD13 GPIO Pin which has a custom name of IO_RD13 as Output
143+ * @param none
144+ * @return none
145+ */
146+ #define IO_RD13_SetDigitalOutput () (_TRISD13 = 0)
147+
97148/**
98149 * @ingroup pinsdriver
99150 * @brief Sets the RD15 GPIO Pin which has a custom name of IO_RD15 to High
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ void PINS_Initialize(void)
100100 ANSELA = 0x001F ;
101101 ANSELB = 0x039E ;
102102 ANSELC = 0x00CF ;
103- ANSELD = 0x2C00 ;
103+ ANSELD = 0x0C00 ;
104104 ANSELE = 0x000F ;
105105 ANSELF = 0x03C0 ;
106106
You can’t perform that action at this time.
0 commit comments