Downloading Firmware Question

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Downloading Firmware Question

Postby mzincali » Thu Oct 20, 2022 8:04 pm

Hi. I have made a custom board. I use VSCode and PlatformIO to write the firmware directly to the prototypes I have. It all works well.

I now need to send the firmware to an assembly company overseas. They say that they know how to install firmware using this https://www.espressif.com/en/support/do ... ther-tools

My question is, what file(s) I need to provide them so that they can successfully use that tool to install the firmware?

"Why don't you try it out yourself and see?" I can't. I don't have a Windows computer. I have three older Macs, and no access to Windows computers. I tried installing the Windows OS on one of the Macs, and it turned out to be a nightmare - I now can't start up that Mac!

I'm curious if some of you already use that Download tool, and whether there are things I have to know when providing .bin files to the overseas team so they can install the firmware on my custom boards.

Thank you!

User avatar
mbratch
Posts: 302
Joined: Fri Jun 11, 2021 1:51 pm

Re: Downloading Firmware Question

Postby mbratch » Fri Oct 21, 2022 2:34 am

You need to provide all the .bin products of your build, including bootloader, partition_table, app, and anything else you flash based on your partition table. You also need to provide the absolute addresses where each of those bin files goes. That info is available in your current partition table. The bootloader by default loads at 0x1000 and the partition table loads at 0x8000. There are a number of options in the programming software, but you leave those at default.

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Re: Downloading Firmware Question

Postby mzincali » Fri Oct 21, 2022 7:58 am

Thank you for that info.

Is esptool the command-line version of the same thing? I'm wondering if I can use eep-tool on my mac, to try and mimic what the testers will do with my binary files.

User avatar
mbratch
Posts: 302
Joined: Fri Jun 11, 2021 1:51 pm

Re: Downloading Firmware Question

Postby mbratch » Fri Oct 21, 2022 1:33 pm

Esptool and the windows flash tool do basically the same thing but of course they are different implementations.

If you do a flash using idf.py you should be able to see the specific esptool calls for flashing and the arguments. As long as you can assure the base addresses you provide the manufacturer are correct it should be fine. I would expect that they would also attempt a sample for you to verify it works before producingaeger quantities, which should be standard procedure.

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Re: Downloading Firmware Question

Postby mzincali » Fri Oct 21, 2022 7:47 pm

That is exactly where I am at. I've ordered the first 3000 units. They have made 5 and are waiting to test before doing more.

I am sending them these files from my build folder:

- firmware.bin
- firmware.elf
- firmware.map
- partitions.bin

I'm not sure what else I need. The base address should be the default 0x1000. Since I use PlatformIO to build and upload, I haven't really been exposed to the details of the firmware uploading. That's why I thought maybe I should learn to use command line tools to install the firmware and really get to understand the details better. Thank you for your help so far!

Here is a screenshot of what they said they will be using to install the firmware.
Attachments
00483495c7e63ceb117d5b69549131a.png
00483495c7e63ceb117d5b69549131a.png (33.42 KiB) Viewed 3785 times

User avatar
mbratch
Posts: 302
Joined: Fri Jun 11, 2021 1:51 pm

Re: Downloading Firmware Question

Postby mbratch » Sat Oct 22, 2022 7:43 pm

They only need the bin files and information on where they get loaded. You need to show your partition table since that's where that is described. Their screenshot only shows one file name. I can't tell what the other three that are checked are, so I couldn't offer an opinion a out whether they are correct. Need to see your partition table. You could grab the one printed out in the console when the unit boots. :)

0x1000 is the default base address for the bootloader. The partition table defaults at 0x8000 I think. The app is where ever your partition table says to put it. I think the default is 0x10000 but I could be wrong.

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Re: Downloading Firmware Question

Postby mzincali » Wed Oct 26, 2022 6:14 pm

I'm sorry to say, I'm still having trouble with this. First of all, when they plug my board in (and I only have a video to go by), there is no indication in the "ESP Download Tool" that it is plugged in. The COM port electro shows COM7. I can't tell if that is my board or something else they also have plugged in.

Second, I'm still not sure of the offsets they should use. I've provided them with 0x10000 since when I build with VSCode/PIO, I see:

Code: Select all

Wrote 12912 bytes (9261 compressed) at 0x00000000 in 0.4 seconds (effective 283.5 kbit/s)...
Wrote 3072 bytes (129 compressed) at 0x00008000 in 0.1 seconds (effective 348.5 kbit/s)...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 494.8 kbit/s)...
Wrote 922560 bytes (552011 compressed) at 0x00010000 in 13.2 seconds (effective 559.7 kbit/s)...
I see that things are being written to 0x0, 0x8000, 0xe000, and finally the bulk of the code goes into 0x10000.
What are the parts that go into 0x0, 0x8000, 0xe000?

firmware.bin is about 922kb so that is the easy one. But firmware.map and firmware.elp are way bigger than any of those. Partitions.bin is 3K, so that is probably what goes into 0x8000.

Can you help me with the other two please?

Code: Select all

Auto-detected: /dev/cu.usbmodem14201
Uploading .pio/build/esp32-c3-devkitm-1/firmware.bin
esptool.py v3.3
Serial port /dev/cu.usbmodem14201
Connecting...
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: a0:76:4e:46:14:fc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000f1fff...
Flash params set to 0x022f
Compressed 12912 bytes to 9261...
Writing at 0x00000000... (100 %)
Wrote 12912 bytes (9261 compressed) at 0x00000000 in 0.4 seconds (effective 283.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 129...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (129 compressed) at 0x00008000 in 0.1 seconds (effective 348.5 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 494.8 kbit/s)...
Hash of data verified.
Compressed 922560 bytes to 552011...
Writing at 0x00010000... (2 %)
Writing at 0x0001bb1c... (5 %)
Writing at 0x00026936... (8 %)
Writing at 0x00031c4e... (11 %)
Writing at 0x0003bcb1... (14 %)
Writing at 0x00041702... (17 %)
Writing at 0x00047c1d... (20 %)
Writing at 0x0004ecbe... (23 %)
Writing at 0x000559ba... (26 %)
Writing at 0x0005b94e... (29 %)
Writing at 0x00061782... (32 %)
Writing at 0x00067545... (35 %)
Writing at 0x0006d397... (38 %)
Writing at 0x00073582... (41 %)
Writing at 0x00079293... (44 %)
Writing at 0x0007f37f... (47 %)
Writing at 0x00084b62... (50 %)
Writing at 0x0008a0b0... (52 %)
Writing at 0x0008f6ee... (55 %)
Writing at 0x0009580b... (58 %)
Writing at 0x0009b29c... (61 %)
Writing at 0x000a0b96... (64 %)
Writing at 0x000a6d82... (67 %)
Writing at 0x000acb69... (70 %)
Writing at 0x000b2c26... (73 %)
Writing at 0x000b9257... (76 %)
Writing at 0x000bf96e... (79 %)
Writing at 0x000c5d28... (82 %)
Writing at 0x000cbdb5... (85 %)
Writing at 0x000d1d80... (88 %)
Writing at 0x000d81b5... (91 %)
Writing at 0x000dfbaa... (94 %)
Writing at 0x000e6b87... (97 %)
Writing at 0x000eccd3... (100 %)
Wrote 922560 bytes (552011 compressed) at 0x00010000 in 13.2 seconds (effective 559.7 kbit/s)...

User avatar
mbratch
Posts: 302
Joined: Fri Jun 11, 2021 1:51 pm

Re: Downloading Firmware Question

Postby mbratch » Wed Oct 26, 2022 11:00 pm

The windows device manager should reveal to them the correct com port or if it is recognized.

I ain't see a log from your console as your device boots up. That's what shows the partition table in a way I was hoping to see it

User avatar
mbratch
Posts: 302
Joined: Fri Jun 11, 2021 1:51 pm

Re: Downloading Firmware Question

Postby mbratch » Wed Oct 26, 2022 11:02 pm

The windows device manager should reveal to them the correct com port or if it is recognized. It should show up as CP210x

I didn't see a log from your console as your device boots up. That's what shows the partition table in a way I was hoping to see it
Last edited by mbratch on Thu Oct 27, 2022 2:11 am, edited 1 time in total.

mzincali
Posts: 46
Joined: Wed Jun 08, 2022 7:23 am

Re: Downloading Firmware Question

Postby mzincali » Thu Oct 27, 2022 12:02 am

While I've seen a log when dev kits I have used boot up, but my custom board doesn't seem to have that. I don't know if it is disabled or whether because we use the JTAG USB it's not supported?

Let me look at the settings.

Who is online

Users browsing this forum: No registered users and 58 guests