| Serial.print(" END "); | Serial.print(" END "); | |
| Serial.print(last_part); | Serial.print(last_part); | |
| Serial.println(" bytes of Final-Block transfered.............. "); | Serial.println(" bytes of Final-Block transfered.............. "); | |
| Serial.println(""); | Serial.println(""); | |
| digitalWrite(PN_1, LOW); | digitalWrite(PN_1, LOW); | |
| <> | #if 0 | |
| EEPROM.write(BOOTLOADING, 0); | EEPROM.write(BOOTLOADING, 0); | |
| delay(500); | = | delay(500); |
| Serial.println(">>>>>>>>>>>>> IoT module will now REBOOT in main_application in 6 seconds <<<<<<<<<<<<<"); | Serial.println(">>>>>>>>>>>>> IoT module will now REBOOT in main_application in 6 seconds <<<<<<<<<<<<<"); | |
| while (1) /// Watchdog0 will issue a rebboot in 6 seconds | while (1) /// Watchdog0 will issue a rebboot in 6 seconds | |
| { | { | |
| } | } | |
| -+ | #endif | |
| #if 1 //Simone: go to main app after FLASH update | ||
| system_watchdog_feed(); | ||
| HWREG(0xE000E000 + (0xD08)) = (0x10000 & 0xFFFFF); // Update vector table offset register | ||
| asm(" MOVW r0, #0x0000"); // Load r0-Low with low-part of the address, 2-bytes | ||
| asm(" MOVT r0, #0x0001"); // Load r0-High with high-part of the address, 2-bytes | ||
| asm(" ldr sp, [r0]"); // Load app vector address into SP | ||
| asm(" ldr r0, [r0, #4]"); // Prepare jump to starting address + 4 | ||
| asm(" bx r0"); // Make the jump | ||
| #endif | ||
| } | = | } |