Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ivan Grokhotkov
@igrr
could you also do read_flash instead of read_mem?
Victor Aprea
@vicatcu
does esptool talk to the flash through the ROM bootloader?
yea sure, one sec
Ivan Grokhotkov
@igrr
partially. most commands work through bootloader, but for some commands (like read_flash and read_mac) esptool.py uploads a short piece of code into RAM and runs it... then this piece of code does things which bootloader was not programmed to do
you can do some interesting tricks this way. for example, i have used this idea in my branch of esptool-ck to implement deflate-compressed code uploads.
basically esptool-ck first uploads decompressor into ESP8266's RAM, runs it, and then pumps compressed program over serial. Decompressor reads the stream, inflates it, and writes to flash.
after you do read_flash, do a diff against the .bin which is uploaded by Arduino
Victor Aprea
@vicatcu
@igrr what address range should I do read_flash on?
Sketch uses 207,276 bytes (19%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 44,816 bytes (54%) of dynamic memory, leaving 37,104 bytes for local variables. Maximum is 81,920 bytes.
Ivan Grokhotkov
@igrr
address 0, size should be the size of the uploaded bin
207276 bytes
Victor Aprea
@vicatcu
k that's
what i thougth
can't just diff on binary files though right?
@igrr well the file sizes differ, which I guess is interesting for a start
Ivan Grokhotkov
@igrr
perhaps esptool.py doesn't know how to read sizes which are not multiple of 4 bytes?
Victor Aprea
@vicatcu
no it's the compiled bin ...
i need to turn the elf into a bin or something right?
Ivan Grokhotkov
@igrr
oh, darn, you're right. it's the size being reported by the IDE which is off the mark :)
Victor Aprea
@vicatcu
rather than just grabbing the bin file from home/vic/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/bootloaders/eboot/eboot.elf -bo /tmp/build6389748398816362263.tmp/sketch_oct05b.cpp.bin -bm dio -bf 40 -bz 2M -bs .text -bp 4096 -ec -eo /tmp/build6389748398816362263.tmp/sketch_oct05b.cpp.elf -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
the bin there is 211424 bytes
Ivan Grokhotkov
@igrr
it doesn't account for the sector which contains eboot, and some additional padding
so you should read 211424. sorry, forgot about that...
Victor Aprea
@vicatcu
python esptool.py -p /dev/ttyUSB0 read_flash 0x00 211424 download.sketch.bin
ya?
Ivan Grokhotkov
@igrr
yep
you can do hexdump and the diff hexdumped bins
Victor Aprea
@vicatcu
ah ok one sec
files are identical
is the bootloader ROM actually a ROM or could it have been corrupted?
and if it's corrupted can it be restored?
Ivan Grokhotkov
@igrr
It's a mask rom, and looking at serial output, it appears to work.
Victor Aprea
@vicatcu
i'm not sure what to make of the fact that I can't seem to see the bootloader output now though
i think i was in windows when i was seeing it before
a little hard to believe that would matter... but
i'll reboot and check it out in windows again
brb
Victor Aprea
@vicatcu
what the hell, i see output in windows @ 77600
Ivan Grokhotkov
@igrr
might be a driver-related difference
Victor Aprea
@vicatcu

anyway, ya
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

what's the 6 part of (3,6) telling me?
the rst cause: 2 is strange because there is no activity on the reset line either
it is pegged high
how about the flash_id... is that actually reading it out of from spi flash, or is that in memory somewhere
Victor Aprea
@vicatcu
@igrr i have a feeling we're just going to call it an unsolved ESD mystery and move on... hehe
Ivan Grokhotkov
@igrr
might be the right thing to do, in terms of time spent :)
Daniel Tullemans
@tullo-x86
Hi all, is this an appropriate place to ask questions about usage? I'm trying to figure out if the Arduino <SPI.h> header is what I need to use to get SPI output working.
Victor Aprea
@vicatcu
yea i only care if it's a thing that happens more than once
@igrr what country are you in btw?
Ivan Grokhotkov
@igrr
Russia, Saint-Petersburg
Victor Aprea
@vicatcu
that's what i thought, you're a night owl :)