-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to force enter app after first reboot #46
Comments
The terminal script cannot change the boot partition setting that is stored in a dedicated partition (at least not without modification). The magic byte in RAM is a special libwebsocket tweak, but it does not alter the "boot indicator".
|
hi, I would say, default behaviour should be: is there a app.bin : yes > did app.bin ordered a return-to-factory: no == > also start the app This makes more sense, if i clean the memory, burn factory and app, than the app should started. No app, ofcourse factory It will be also ok, if i can force it via changing the code, but settings force_factory=0 didnt help. thanks |
I guess you could modify the bootloader to do what you want and write data into the ota-data partition accordingly, or maybe skip reading the ota-data partition completely. But that is not how it is done now. With an empty ota-data partition, it does not matter what the force_factory_magic is set to in the current setup if I understand it correctly. |
you are right and i want to achiev it, but it doesnt work. I override force_factory = 0; in function bootloader_main() but still factory is booted instead of ota-app. And i can not backtrace since i cannot find the code where factory ends end ota-app boots. This is exactly my problem. |
I think you should read a bit about OTA updates and partition tables in the esp-idf documentation. Like I said, "force_factory" has nothing to do with this. In bootloader_start_c on row 70 the program loads the stored data about preferred app to boot. However in your case, that partition is empty (since you have only flashed via terminal). So boot_index will point at the factory-partition by default. Finally at row 96 it will load Factory, independent of what you do with "force_factory". Now if you either create the ota-data partition before row 70, or try setting boot_index to 1 (I am just guessing) in row 96, it might work. |
here is our difference:
no. I upload bootloader, factory and app with a single terminal command. My esp32 is ready-to-ship. now with your hints, i searched and found the function "get_selected_boot_partition" should not return FACTORY_INDEX but a valid "ota_slot". I think, i have to trace what i have to change (except force_factory) to get a valid ota_slot. Unfortunately i have no debug environment ... |
Your statement:
suggests that you have not read and understood the esp-idf documentation about OTA updates and partitions. Do you realize the difference between ota-data partition and the ota_0 partition? I am sure that you have flashed the ota_0 partition, but unless you have invented something special, the ota-data partition is empty after your flashing and when the bootloader finds that the ota-data partition is empty it WILL default to factory. |
Hi,
i am installing factory and app binaries using terminal script but i get automatically into factory. I try to change the bit at the end of ram but no success. Is there a way to manually set or change the code, that the firmware starts the app after first reboot
thanks
The text was updated successfully, but these errors were encountered: