It looks like the bootloader expects a CRC32 checksum to be stored in the image and MicroPython doesn't have one, which explains why it thinks its invalid.
You'd need to put something into the build to calculate that checksum and store it in the image.,
Downloading, Building and Deploying the Firmware
- SureshVakati
- Posts: 42
- Joined: Fri Feb 24, 2017 3:52 pm
Re: Downloading, Building and Deploying the Firmware
Hello Dave,
I got it working! Thank you!
I got it working! Thank you!
Last edited by SureshVakati on Wed Mar 01, 2017 10:59 pm, edited 1 time in total.
-
- Posts: 1
- Joined: Mon Nov 09, 2015 7:18 am
- Contact:
Re: Downloading, Building and Deploying the Firmware
I also followed what you said above.
___________________________________
Love me, love my dog!
[url=http://www.dentaldeal.es/]depósito dental[/url]
___________________________________
Love me, love my dog!
[url=http://www.dentaldeal.es/]depósito dental[/url]
- SureshVakati
- Posts: 42
- Joined: Fri Feb 24, 2017 3:52 pm
Re: Downloading, Building and Deploying the Firmware
Hello Dave,
Is there anyway that I can write a magic value to SRAM? I am trying to do OTA for STM32f405, I had methods to download the firmware and bootloader has code to update the firmware, now the bootloader checks for a magic value in SRAM, if it is there then it will do the update process. Can I write magic values like below from micropython?This is in 'C'
Bootloader checks that value while booting.
Writing the value to a file in SD card is another alternative, but this code is already tested and been working fine, so just thinking to keep everything as same in my project.
Is there anyway that I can write a magic value to SRAM? I am trying to do OTA for STM32f405, I had methods to download the firmware and bootloader has code to update the firmware, now the bootloader checks for a magic value in SRAM, if it is there then it will do the update process. Can I write magic values like below from micropython?This is in 'C'
Code: Select all
*((DWORD *)0x2001FFFC) = 0xCAFE0001; // Write Magic value to SRAM
NVIC_SystemReset();
Code: Select all
if (BootState == 0xCAFE0001)
AppErase(APPLICATION_BASE);
if (ApplicationFirmwareCheck() && !BreakKeyCheck())
{
printf("Application Valid\n");
while(USART_GetFlagStatus(USART3, USART_FLAG_TC) == RESET); /* Wait for characters to leave */
USART_Cmd(USART3, DISABLE); /* Disable the USART3 */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, DISABLE); /* Disable USART3 Clock */
Reboot_Application(); // Does not return
}
else
{
printf("Application Missing or Corrupt\n");
test(); // DFU Burner
}
Re: Downloading, Building and Deploying the Firmware
In MicroPython, the equivalent of those 2 lines would be:SureshVakati wrote:Hello Dave,
Is there anyway that I can write a magic value to SRAM? I am trying to do OTA for STM32f405, I had methods to download the firmware and bootloader has code to update the firmware, now the bootloader checks for a magic value in SRAM, if it is there then it will do the update process. Can I write magic values like below from micropython?This is in 'C'Code: Select all
*((DWORD *)0x2001FFFC) = 0xCAFE0001; // Write Magic value to SRAM NVIC_SystemReset();
Code: Select all
import machine
import stm
stm.mem32[0x2001FFFC] = 0xCAFE0001
machine.reset()