How can I change program start address in flash memory of the esp8266?

Hello everyone;
I want to send the written program through espnoww protocol. Then I write this program in the flash memory of the esp8266 module in the receiver. Then i change the start address of the program to write address so that the new program runs.
How can I change the starting address?

You can use the built-in Updater library for this.

A “#include <Updater.h>” and some calls to Updater.begin(), Updater.write() and Updater.end() should be sufficient.

Unfortunately, there is no explicit example for the Updater library.
But the principle is similar to ArduinoOTA.

Hello, dear sivar2311
Can you give more guidance on this matter?
I think I can copy another module’s flash memory program and store it in the new address of this module. But I should be able to change the start address of the program so that this module will run the new program after being reset.

I have created a sample project:

The example contains two projects in one: Sender and Receiver.
You can select these in the environment switcher.
Set the serial interfaces for Sender and Receiver in the platformio.ini.

The sender creates an access point and starts an (async) web server. Connect to the access point and open the start page in your browser (see serial output). Select a “firmware.bin” to be transferred to the receiver and click “upload”.

The firmware.bin is transferred to the receiver and is written to the flash there.

As espnow is a connectionless protocol, packet losses occur which are not dealt with in this example. This leads to an incomplete OTA update.