I want to suspend all interrupts and FreeRTOS events etc, and run some bare-metal code to move bytes from one place in flash to another...
The "target" location is the "firmware" (A FreeRTOS build of MicroPython) - aka 0x1000 (sector 1) for a length of 1737664 bytes.
The "source" for the move is the stream of bytes which is hte firmware (it arrived as a (possibly fragmented) file onto littlefs or fatfs filesystem) and my code already understands how to reconstruct the original binary from direct flash reads (for both fat and littlefs with it's in-sector added bytes)
I suspect that I cannot simply call flash_erase and flash_write and flash_read because I'm guessing that all of those will stop working the instant my update overwrites the flash location where those FreeRTOS spiflash routines live ?
Hence my question: does anyone know what machine instructions are needed to read, erase, and write spi flash directly from the CPU, without using any RTOS calls ?
Self-updating flash from micropython (how to read and write flash WITHOUT using FreeRTOS ?)
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: Self-updating flash from micropython (how to read and write flash WITHOUT using FreeRTOS ?)
Can I ask why you don't want to use the OTA functionality in ESP-IDF? That is made for that purpose.
-
- Posts: 1705
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Self-updating flash from micropython (how to read and write flash WITHOUT using FreeRTOS ?)
You want to update the firmware 'in-place', i.e. without switching to a second 'OTA' partition?
Who is online
Users browsing this forum: No registered users and 106 guests