Hello,
I am trying to do a esp32 that programs another esp32. On the master I have 3 different partition tables and firmware saved in the fatfs vfs in different folder and I have 3 push buttons. What should I modify on the https://github.com/espressif/esp-serial-flasher so when I press a button the chosen bootloader, firmware and partition table is transferred to the slave?
I am not asking to give the entire process but where I can look for that kind of information. There is a cmake that embeds the files from a the example/binaries directory, but I want to embed it from the esp32 virtual files system.
Thank you
ESP SERIAL FLASHER
Re: ESP SERIAL FLASHER
Hi pepopi,
Please start here: https://github.com/espressif/esp-serial ... mon.c#L121
You need to modify this function to open the file, (fopen) read chunks of data from the file (fread), then pass the chunks to esp_flash_loader_write function.
Currently this function is called for bootloader, partition table, binary. You can add some code to check the button state (GPIO) and call this function with the right arguments.
Please start here: https://github.com/espressif/esp-serial ... mon.c#L121
You need to modify this function to open the file, (fopen) read chunks of data from the file (fread), then pass the chunks to esp_flash_loader_write function.
Currently this function is called for bootloader, partition table, binary. You can add some code to check the button state (GPIO) and call this function with the right arguments.
Re: ESP SERIAL FLASHER
Thanks,
The part of pressing a push button and transferring the selected firmware, bootloader and partition table should it be included in esp32 example main or in the example commons? Calculating the size of the files also happens after pressing the push button because it folder0, folder1 and folder2 have different size of firmware and partition table. I am starting to understand what I need to change, but my doubts now are which modifications are in the commons file and which in the esp32 main.
Also, what do I have to change in the cmake? There is a cmake that takes the files from the helloworld folder, but I must take them from the vfs fatfs.
Thank you
The part of pressing a push button and transferring the selected firmware, bootloader and partition table should it be included in esp32 example main or in the example commons? Calculating the size of the files also happens after pressing the push button because it folder0, folder1 and folder2 have different size of firmware and partition table. I am starting to understand what I need to change, but my doubts now are which modifications are in the commons file and which in the esp32 main.
Also, what do I have to change in the cmake? There is a cmake that takes the files from the helloworld folder, but I must take them from the vfs fatfs.
Thank you
Re: ESP SERIAL FLASHER
This is totally up to you. The example is split between the "esp32" part and "common" part just because there is some shared code for the different platforms. If you are only working with the esp32, you can combine everything inside one directory.pepopi wrote: The part of pressing a push button and transferring the selected firmware, bootloader and partition table should it be included in esp32 example main or in the example commons?
I can't walk you through every single step (you'll have to study this yourself, sorry), but briefly you'll need the following:pepopi wrote: Also, what do I have to change in the cmake? There is a cmake that takes the files from the helloworld folder, but I must take them from the vfs fatfs.
- remove the part responsible for embedding the binaries into the app (https://github.com/espressif/esp-serial ... xt#L16-L22)
- add a partition table with your FAT partition (https://github.com/espressif/esp-idf/bl ... xample.csv)
- set the custom partition table in menuconfig (https://github.com/espressif/esp-idf/bl ... ults#L1-L2)
- use relevant parts of the fatfs wear_levelling example to initialize the filesystem
- use fopen, fread functions to read chunks of data from the files in a FAT partition and pass them to esp_flash_loader_write function.
Re: ESP SERIAL FLASHER
Along this concept. I saved my 3 .bin files files files to a SD card on the Master.
bootloader.bin
partitions.bin
firmware.bin
Would the correct method be for each file ?
esp_loader_flash_start
esp_loader_flash_write
esp_loader_flash_finish
bootloader.bin
partitions.bin
firmware.bin
Would the correct method be for each file ?
esp_loader_flash_start
esp_loader_flash_write
esp_loader_flash_finish
Who is online
Users browsing this forum: Bing [Bot] and 176 guests