Hi everyone,
is there any API to know the size of my firmware size .Matter of fact is there any api to know the amount of portion written in a given partition.
Regards,
Dhananjay Sutariya
How to know amount of Binary image size that is running?
-
- Posts: 41
- Joined: Thu Feb 28, 2019 12:21 pm
Re: How to know amount of Binary image size that is running?
Running the command will give you the entire size of your application and the output will look like:
There is also the command that will break your application size down by each used component from the idf, your main app, and any extra components you've added.
Code: Select all
make size
Code: Select all
Total sizes:
DRAM .data size: 14892 bytes
DRAM .bss size: 42664 bytes
Used static DRAM: 57556 bytes ( 67024 available, 46.2% used)
Used static IRAM: 100377 bytes ( 30695 available, 76.6% used)
Flash code: 907603 bytes
Flash rodata: 244904 bytes
Total image size:~1267776 bytes (.bin may be padded larger)
Code: Select all
make size-components
-
- Posts: 41
- Joined: Thu Feb 28, 2019 12:21 pm
Re: How to know amount of Binary image size that is running?
Hi eagi,
Thanks for the response. However are there any api's that do the same?
Thanks for the response. However are there any api's that do the same?
Re: How to know amount of Binary image size that is running?
Ah, so you want to figure out the size of you firmware at runtime? It may be possible, but I'm not sure what the use case of that would be since you know it at compile time... You can read out the contents of a partition (though the factory partition may be protected in some way so you can't corrupt it) using the flash_partition api https://docs.espressif.com/projects/esp ... flash.html. That will definitely give you the size of the partition, but as for the actual size used by the firmware, I don't know of a way to do that besides manually reading the entire firmware from the flash until you get to the empty section (0xff or 0x00 repeated I think? can't remember). Maybe it would be helpful to know what you're trying to accomplish so someone can have a better idea of what you need. Sorry I couldn't be of more help!
Re: How to know amount of Binary image size that is running?
It does seem to be possible. Try this: (it's also used in there to calculate hashes of the current program, which is a good example usage)
https://github.com/espressif/arduino-es ... p.cpp#L151
Looks like the real magic happens here, for interest:
https://github.com/espressif/esp-idf/bl ... mat.c#L158
https://github.com/espressif/arduino-es ... p.cpp#L151
Looks like the real magic happens here, for interest:
https://github.com/espressif/esp-idf/bl ... mat.c#L158
-
- Posts: 41
- Joined: Thu Feb 28, 2019 12:21 pm
Re: How to know amount of Binary image size that is running?
Hi eagi,eagi223 wrote: ↑Thu May 02, 2019 5:11 pmAh, so you want to figure out the size of you firmware at runtime? It may be possible, but I'm not sure what the use case of that would be since you know it at compile time... You can read out the contents of a partition (though the factory partition may be protected in some way so you can't corrupt it) using the flash_partition api https://docs.espressif.com/projects/esp ... flash.html. That will definitely give you the size of the partition, but as for the actual size used by the firmware, I don't know of a way to do that besides manually reading the entire firmware from the flash until you get to the empty section (0xff or 0x00 repeated I think? can't remember). Maybe it would be helpful to know what you're trying to accomplish so someone can have a better idea of what you need. Sorry I couldn't be of more help!
I want to know the amount of flash utilised at runtime.
Not only the amount of flash utilised by firmware but the amount of flash utilised in each partition (NVS,OTADATA,phy_init) etc.
Regards,
Dhananjay
Last edited by dhananjay.sutariya on Tue May 07, 2019 12:02 pm, edited 1 time in total.
-
- Posts: 41
- Joined: Thu Feb 28, 2019 12:21 pm
Re: How to know amount of Binary image size that is running?
Hi boarchuz,boarchuz wrote: ↑Fri May 03, 2019 2:17 amIt does seem to be possible. Try this: (it's also used in there to calculate hashes of the current program, which is a good example usage)
https://github.com/espressif/arduino-es ... p.cpp#L151
Looks like the real magic happens here, for interest:
https://github.com/espressif/esp-idf/bl ... mat.c#L158
seems like this will only provide the amount of flash utilised by firmware correct me if im wrong
Regards,
Dhananjay
Who is online
Users browsing this forum: Google [Bot] and 117 guests