Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By piperpilot
#26632 I'm getting there...I have it parsing the elf file now with the following:

Code: Select allCODE_END = $(shell printf '0x%x' $$($(READELF) -s $(TARGET_OUT_U1) | /usr/local/bin/gawk -F " " '/_flash_code_end/ {print $$2}'))


The above doesn't seem to output a number...printf doesn't like the hex output and I can't figure out how to tell it that its HEX.

I get

Code: Select all/bin/sh: line 0: printf: 4023cc1e: invalid number


Ultimately I want to take that and subtract off the 40200000 to get just the offset for end of code.
User avatar
By gschmott
#26635 How about something like this:
Code: Select allCODE_END = $(shell printf '0x%x' $$($(READELF) -s $(TARGET_OUT_U1) | /usr/local/bin/gawk -F " " '/_flash_code_end/ {print strtonum("0x" $$2)}'))


I think that will convert the hex to decimal.
User avatar
By LuckyFIA
#26637
gschmott wrote:Hi Richard -

I've made a little progress.


Hi gschmott!

Please tell us where need copy rboot-bigflash file in the Sming project and how to properly include him.
If possible, please write a step by step instructions.

Thank you for any help!
User avatar
By rab
#26659 This is working for me, from command line (will need tweaking for makefile).
Code: Select allreadelf -s app_0.out | gawk "/_flash_code_end/ {printf(\"0x%x\", strtonum(\"0x\" $2) - 0x40200000)}"