Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Victor Aprea
@vicatcu
what's the right baud rate to see the bootloader messages, 76800?
alon24
@alon24
74880
Victor Aprea
@vicatcu
wierd, putty looks like gibberish at that baud rate
looks like a 13.86uS bit time
alon24
@alon24
did any1 try using gpio9 and gpio10?
Ivan Grokhotkov
@igrr
@alon24 I haven't, if you do, make sure you call pinMode(9, OUTPUT)
or INPUT
unlike other GPIOs these pins are not initialized as INPUT at startup
@vicatcu this weird baud rate is 115200 * xtal_frequency / 40
alon24
@alon24
k, thanks, do iu have a way to set to dio
Victor Aprea
@vicatcu
@igrr ah that's interesting
@igrr so have you seen anything like this before, or do I have a snowflake here?
as in 'beautiful and unique'
Ivan Grokhotkov
@igrr
no i haven't seen a1a1 stuff yet.
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