summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorja Martinez2016-09-30 02:31:52 -0500
committerBorja Martinez2016-09-30 02:31:52 -0500
commitb2618eb317b404c630ae64b52194246452aebbfd (patch)
treeeb19ffbf5ff4aee76acc0c612270d4b8876215a9
parent60278208598eea8ff075260eae80884cdbc6d9fe (diff)
downloadi3-mote-b2618eb317b404c630ae64b52194246452aebbfd.tar.gz
i3-mote-b2618eb317b404c630ae64b52194246452aebbfd.tar.xz
i3-mote-b2618eb317b404c630ae64b52194246452aebbfd.zip
Bug fixed in MSP430 BSL Code
-rw-r--r--Basic-Test-Package/BSL/MSP430/Boot_MSP430_Chain/main.c53
-rw-r--r--Basic-Test-Package/BSL/MSP430/Boot_MSP430_Dual/main.c56
2 files changed, 63 insertions, 46 deletions
diff --git a/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Chain/main.c b/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Chain/main.c
index c7e5407..f378fdf 100644
--- a/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Chain/main.c
+++ b/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Chain/main.c
@@ -144,21 +144,25 @@ __interrupt void port1_isr (void) {
144 144
145 // BOOT_IN2 interrupt clear and disable 145 // BOOT_IN2 interrupt clear and disable
146 P1IFG &=~ (BOOT_IN1); 146 P1IFG &=~ (BOOT_IN1);
147 P1IE &=~ (BOOT_IN1);
148 147
149 flag=1; 148 // RESET_IN1 should be low
149 if ((P1IN & RESET_IN1) == 0) {
150 150
151 /* Disable CC2650 BSL */ 151 // BOOT_IN2 interrupt disable
152 P1IFG &=~(RESET_IN2|BOOT_IN2); 152 P1IE &=~ (BOOT_IN1);
153 P1IE &=~(RESET_IN2|BOOT_IN2); 153
154 flag=1;
155
156 /* Disable CC2650 BSL */
157 P1IFG &=~(RESET_IN2|BOOT_IN2);
158 P1IE &=~(RESET_IN2|BOOT_IN2);
159
160 /* Enable Reset High to Low */
161 P1IES |= (RESET_IN1);
162 P1IFG &=~ (RESET_IN1);
163 P1IE |= (RESET_IN1);
154 164
155 /* Enable Reset High to Low */
156 P1IES |= (RESET_IN1);
157 P1IFG &=~ (RESET_IN1);
158 P1IE |= (RESET_IN1);
159 165
160 // RESET_IN1 should be low
161 if ((P1IN & RESET_IN1) == 0) {
162 bootloader_active = true; 166 bootloader_active = true;
163 } 167 }
164 } 168 }
@@ -228,21 +232,24 @@ __interrupt void port1_isr (void) {
228 232
229 // BOOT_IN2 interrupt clear and disable 233 // BOOT_IN2 interrupt clear and disable
230 P1IFG &=~ (BOOT_IN2); 234 P1IFG &=~ (BOOT_IN2);
231 P1IE &=~ (BOOT_IN2);
232 235
233 flag=1; 236 // RESET_IN2 should be low
237 if ((P1IN & RESET_IN2) == 0) {
234 238
235 /* Disable MCP432 Boot */ 239 P1IE &=~ (BOOT_IN2);
236 P1IFG &=~(RESET_IN1|BOOT_IN1); 240
237 P1IE &=~(RESET_IN1|BOOT_IN1); 241 flag=1;
242
243 /* Disable MCP432 Boot */
244 P1IFG &=~(RESET_IN1|BOOT_IN1);
245 P1IE &=~(RESET_IN1|BOOT_IN1);
246
247 /* Enable Reset High to Low */
248 P1IES |= (RESET_IN2);
249 P1IFG &=~ (RESET_IN2);
250 P1IE |= (RESET_IN2);
238 251
239 /* Enable Reset High to Low */
240 P1IES |= (RESET_IN2);
241 P1IFG &=~ (RESET_IN2);
242 P1IE |= (RESET_IN2);
243 252
244 // RESET_IN2 should be low
245 if ((P1IN & RESET_IN2) == 0) {
246 bootloader_active = true; 253 bootloader_active = true;
247 } 254 }
248 } 255 }
@@ -307,6 +314,8 @@ __interrupt void port1_isr (void) {
307 /* Unknown Sequence: Disable PIOs, Wait Timout */ 314 /* Unknown Sequence: Disable PIOs, Wait Timout */
308 if(flag==0){ 315 if(flag==0){
309 P1IE &=~ (RESET_IN1|RESET_IN2|BOOT_IN1|BOOT_IN2); 316 P1IE &=~ (RESET_IN1|RESET_IN2|BOOT_IN1|BOOT_IN2);
317 bootloader_active = true; // Ensure LMP3 (Timer active)
318
310 P1IFG = 0; 319 P1IFG = 0;
311 } 320 }
312 321
diff --git a/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Dual/main.c b/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Dual/main.c
index fe0983e..fa968da 100644
--- a/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Dual/main.c
+++ b/Basic-Test-Package/BSL/MSP430/Boot_MSP430_Dual/main.c
@@ -142,23 +142,26 @@ __interrupt void port1_isr (void) {
142 ((P1IN & BOOT_IN1) == 0) && 142 ((P1IN & BOOT_IN1) == 0) &&
143 ((P1IES & BOOT_IN1) == BOOT_IN1)) { 143 ((P1IES & BOOT_IN1) == BOOT_IN1)) {
144 144
145 // BOOT_IN2 interrupt clear and disable 145 // BOOT_IN2 interrupt clear
146 P1IFG &=~ (BOOT_IN1); 146 P1IFG &=~ (BOOT_IN1);
147 P1IE &=~ (BOOT_IN1);
148 147
149 flag=1; 148 // RESET_IN1 should be low
149 if ((P1IN & RESET_IN1) == 0) {
150 150
151 /* Disable CC2650 BSL */ 151 // BOOT_IN2 interrupt disable
152 P1IFG &=~(RESET_IN2|BOOT_IN2); 152 P1IE &=~ (BOOT_IN1);
153 P1IE &=~(RESET_IN2|BOOT_IN2);
154 153
155 /* Enable Reset High to Low */ 154 flag=1;
156 P1IES |= (RESET_IN1); 155
157 P1IFG &=~ (RESET_IN1); 156 /* Disable CC2650 BSL */
158 P1IE |= (RESET_IN1); 157 P1IFG &=~(RESET_IN2|BOOT_IN2);
158 P1IE &=~(RESET_IN2|BOOT_IN2);
159
160 /* Enable Reset High to Low */
161 P1IES |= (RESET_IN1);
162 P1IFG &=~ (RESET_IN1);
163 P1IE |= (RESET_IN1);
159 164
160 // RESET_IN1 should be low
161 if ((P1IN & RESET_IN1) == 0) {
162 bootloader_active = true; 165 bootloader_active = true;
163 } 166 }
164 } 167 }
@@ -226,23 +229,27 @@ __interrupt void port1_isr (void) {
226 ((P1IN & BOOT_IN2) == 0) && 229 ((P1IN & BOOT_IN2) == 0) &&
227 ((P1IES & BOOT_IN2) == BOOT_IN2)) { 230 ((P1IES & BOOT_IN2) == BOOT_IN2)) {
228 231
229 // BOOT_IN2 interrupt clear and disable 232 // BOOT_IN2 interrupt clear
230 P1IFG &=~ (BOOT_IN2); 233 P1IFG &=~ (BOOT_IN2);
231 P1IE &=~ (BOOT_IN2);
232 234
233 flag=1; 235 // RESET_IN2 should be low
236 if ((P1IN & RESET_IN2) == 0) {
234 237
235 /* Disable MCP432 Boot */ 238 // BOOT_IN2 interrupt disable
236 P1IFG &=~(RESET_IN1|BOOT_IN1); 239 P1IE &=~ (BOOT_IN2);
237 P1IE &=~(RESET_IN1|BOOT_IN1); 240
241 flag=1;
242
243 /* Disable MCP432 Boot */
244 P1IFG &=~(RESET_IN1|BOOT_IN1);
245 P1IE &=~(RESET_IN1|BOOT_IN1);
246
247 /* Enable Reset High to Low */
248 P1IES |= (RESET_IN2);
249 P1IFG &=~ (RESET_IN2);
250 P1IE |= (RESET_IN2);
238 251
239 /* Enable Reset High to Low */
240 P1IES |= (RESET_IN2);
241 P1IFG &=~ (RESET_IN2);
242 P1IE |= (RESET_IN2);
243 252
244 // RESET_IN2 should be low
245 if ((P1IN & RESET_IN2) == 0) {
246 bootloader_active = true; 253 bootloader_active = true;
247 } 254 }
248 } 255 }
@@ -307,6 +314,7 @@ __interrupt void port1_isr (void) {
307 /* Unknown Sequence: Disable PIOs, Wait Timout */ 314 /* Unknown Sequence: Disable PIOs, Wait Timout */
308 if(flag==0){ 315 if(flag==0){
309 P1IE &=~ (RESET_IN1|RESET_IN2|BOOT_IN1|BOOT_IN2); 316 P1IE &=~ (RESET_IN1|RESET_IN2|BOOT_IN1|BOOT_IN2);
317 bootloader_active = true;
310 P1IFG = 0; 318 P1IFG = 0;
311 } 319 }
312 320