Open apiel opened 6 years ago
You could checkout extras/http_client_ota/http_client_ota.c
as sample. This is a ota HTTP client.
This flash firmware and setup bootloader rom area.
use rboot_set_current_rom(rom_to_use) for setup next bot rom. with
rboot_config = rboot_get_config();`
rboot_config give you other useful info as where is rom page address...
Check rboot_config struct and how other firmware use it.
Hi, thx for your help. I already tried several time this example, I was actually using it to implement OTA in my firmware. It's actually interesting, cause this example doesn't seem to have issue with sdk_spi_flash_erase_sector where this was one of my problem. Anyhow, the example is also failing and not able to reboot. But with the bootloader I wrote yesterday, it work: https://github.com/apiel/aboot
So I guess at some point there might be some memory issue in esp-open-rtos and of course, I might also make some wrong stuff in my firmware. I wish I could find the reason of all this problem and provide some improvement ;-)
For another example using temporary boot you can look at https://github.com/HomeACcessoryKid/life-cycle-manager. This saves the sector 0x1000 from being written to.
On one of my esp8266 (sonoff) the Rom is only able to boot at position 0x2000. So even If I upload a new rom with OTA at the second address (romconf->roms[1]) the mcu will keep booting at 0x2000 even if the setting of romconf->current_rom are set to 1. To solve this issue I updated rboot to copy the rom at the address romconf->roms[1] to 0x2000. Then it boot to the new rom. Is there any reason this happen? How to solve this without to customize rboot?
This is a part of what I did in rBoot (still not very clean for the moment but it s working):
Unless I find a better solution to make the rom boot at a different address with rboot, I guess I will write my own bootloader. But of course it would be better to keep rboot as it is ;-)