These are chat archives for esp8266/Arduino

5th
Oct 2015
Victor Aprea
@vicatcu
Oct 05 2015 12:51
hi, anybody home?
Steve Nelson
@zenmanenergy
Oct 05 2015 13:09
I’m around, but probably not much help.
Victor Aprea
@vicatcu
Oct 05 2015 13:13
@zenmanenergy hehe nice to meet you :)
i'll be back, switching back to ubuntu
Victor Aprea
@vicatcu
Oct 05 2015 13:42
i'll leave gitter open, if anyone has insights into #855 would be much appreciated
Steve Nelson
@zenmanenergy
Oct 05 2015 13:47
Do you have more than one esp you can test with? Does it do that with every device? I’m testing it on a nodemcu 1.0 right now… one sec.
Victor Aprea
@vicatcu
Oct 05 2015 13:53
@zenmanenergy yea I'm going to go ahead right now with another one, but I don't know how the borked one got into that state
Steve Nelson
@zenmanenergy
Oct 05 2015 13:54
I just uploaded it 5 times to my development board and it worked fine every time. one thing that’s different about esp boards versus arduinos is that to see the Serial output in the setup() function I always seem to have to reset the board after you upload it with the serial monitor open.
Victor Aprea
@vicatcu
Oct 05 2015 13:54
and i'm hoping there's a way to recover it, i'm more worried about bricking more without knowing if it can come back
Steve Nelson
@zenmanenergy
Oct 05 2015 13:54
another super minor thing… add a println to this:
Serial.print(F("Flash Chip Size By Id: "));
the text is showing up at the end of the garbage for me after i reset
Victor Aprea
@vicatcu
Oct 05 2015 13:54
i was able to load software on it multiple times before i wasn't
the garbage you're seeing is almost certainly decode-able at 77600 baud
if you use PuTTY instead of Arduino Serial Monitor you can set arbitrary baud rates
crazy ass baud rate, but it is what it is
Martin Ayotte
@martinayotte
Oct 05 2015 13:56
I see that you are using F macro, but the Serial.print() is not PROGMEM aware ...
Steve Nelson
@zenmanenergy
Oct 05 2015 13:56
which board are you working with? I have struggled with a bunch of them, the power requirements usually cause the issues.
Martin are you suggesting he just get rid of the F() function in the print?
Victor Aprea
@vicatcu
Oct 05 2015 13:59
@martinayotte if you're talking to me, it doesn't matter what I try and load anymore, it just goes reset crazy in flash load boot mode
Martin Ayotte
@martinayotte
Oct 05 2015 14:00
Yes ! F macro can only be used with method like client.write_P() or server.send_P(), Serial doesn't have such method.
Steve Nelson
@zenmanenergy
Oct 05 2015 14:01
sweet. that’s good to know.
Victor Aprea
@vicatcu
Oct 05 2015 14:01
btw I just loaded code onto a different board and it's fine
Steve Nelson
@zenmanenergy
Oct 05 2015 14:01
the board must have just gone bad.
Victor Aprea
@vicatcu
Oct 05 2015 14:01
i don't think so honestly
i just don't understand well enough what's going on at the boot level to know what boot mode (3, 6) means
Victor Aprea
@vicatcu
Oct 05 2015 14:13
is the ROM bootloader documented anywhere, like how to decode boot mode and reset cause?
Steve Nelson
@zenmanenergy
Oct 05 2015 14:17
I’m not certain about that. martin may know. are you sure you have the right flash size?
Victor Aprea
@vicatcu
Oct 05 2015 14:18
which suggests
reset causes:
0:
1: normal boot
2: reset pin
3: software reset
4: watchdog reset
boot device:
    0:
    1: ram
    3: flash
which doesn't really make sense unless you interpret 'ram' to mean 'uart'
Michael Miller
@Makuna
Oct 05 2015 17:15
@martinayotte i belive your statement is incorrect. F () macro casts to stringhelper type, of which the print does support. This is a Arduino feature not esp specific. The other progmem features like declaring a const with PROGMEM will not work with print.
The difference between atmel and avr support is that the atmel compiler will check for duplicate strings declared like this and only include one, while the gcc will not do this.
Martin Ayotte
@martinayotte
Oct 05 2015 18:03
Hi Makuna ! Thanks for clarification. Is that means that F macro will still work with Serial.print() but not with PROGMEM ?
xbary
@xbary
Oct 05 2015 20:50
Hello, I have a question: whether to use correctly the abilities of ESP8266HTTPUpdateServer need in the module ESP have twice as much flash memory as the size of the firmware's new?
Michael Miller
@Makuna
Oct 05 2015 22:03
@martinayotte I included a new "macro" FPSTR to allow you to use a progmem defined const in prints, the core issue is that progmem is not a type, its an attribute, and C++ does not consider attributes part of the type, so there is no way for it to figure out which print function to use based on the argument. By wrapping your program attributed const with FPSTR() as you pass it, then the correct print method will be used.
Martin Ayotte
@martinayotte
Oct 05 2015 22:09
Thanks Michael ! We have always something to learn, even after 25 years experience. :-)
Victor Aprea
@vicatcu
Oct 05 2015 22:10
evil macros :-)
Michael Miller
@Makuna
Oct 05 2015 22:13
@vicatcu Yeah, I don't disagree, but sometimes there is no other way to do some things. Further, this was all to keep it Arduino compatible. They never created a unique type for it.
Victor Aprea
@vicatcu
Oct 05 2015 22:14
ya I know too well
now if I could only figure out what the hell happened to this board
Michael Miller
@Makuna
Oct 05 2015 22:16
Is yours a dev board or just the module? I have had two modules go bad (I suspect bad contacts with the programmer and get strange reset as it programs) but I have only had one dev board go bad and that was due to dragging a hot 5v wire across it ;-)
Victor Aprea
@vicatcu
Oct 05 2015 22:17
@Makuna, it's a board I built myself actually, with an ESP-WROOM2 module on it
I had 4 made, and loaded code on two others fine, this one was working fine before too, but then it wasn't
still have one virgin board, I just wish I understood what happened to this one board
Michael Miller
@Makuna
Oct 05 2015 22:20
p.s. I tried replacing the module on the dev board, but in the process of heating it (hot air) the inside chips under the RF shield of the new module slid around and ruined the module. Without a IR preheat of a real rework station I wouldn't trust my work.
The module just gets too hot without the main board preheat.
Victor Aprea
@vicatcu
Oct 05 2015 22:21
oh interesting, i do have a hot air station
but I'm not satisfied to just fix it
Michael Miller
@Makuna
Oct 05 2015 22:24
I suspect that the chips under the shield are not epoxied down so if enough heat melts their solder, they slide. When I tore the RF shield off (literally used diagonal snips so I check what happened under it without another heating session) one chip was 30 degrees rotated.
Ivan Grokhotkov
@igrr
Oct 05 2015 22:25
@vicatcu your log indicates that module actually boots to the sketch, but something goes wrong afterwards
Could you please add Serial.setDebugOutput(true); after your Serial.begin line and check if you get more output?
Victor Aprea
@vicatcu
Oct 05 2015 22:26
@igrr sure... incidentally does upload verify the flash?
alon24
@alon24
Oct 05 2015 22:26
does arduino support gpio9 and gpio10 - if flashed as DIO mode?
Ivan Grokhotkov
@igrr
Oct 05 2015 22:27
It doesn't. Bootloader relies on a few checksums written along with the program.
alon24
@alon24
Oct 05 2015 22:27
meaning do I get these 2 pins? did any1 check?? with sming I am able to get gpio10 for myself, but gpio9 is not functioning for me, so I wondered if any1 here tried it
Ivan Grokhotkov
@igrr
Oct 05 2015 22:28
This looks fine. Although I normally use 115200, but that shouldn't matter much.
Victor Aprea
@vicatcu
Oct 05 2015 22:29
@igrr I'm just getting infinite resets from that, i think the fact that my flash ID says a1a1 is not good
Ivan Grokhotkov
@igrr
Oct 05 2015 22:29
Yes that flash ID is a bit funny.
Victor Aprea
@vicatcu
Oct 05 2015 22:29
what's the right baud rate to see the bootloader messages, 76800?
alon24
@alon24
Oct 05 2015 22:30
74880
Victor Aprea
@vicatcu
Oct 05 2015 22:31
wierd, putty looks like gibberish at that baud rate
looks like a 13.86uS bit time
alon24
@alon24
Oct 05 2015 22:33
did any1 try using gpio9 and gpio10?
Ivan Grokhotkov
@igrr
Oct 05 2015 22:33
@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
Oct 05 2015 22:35
k, thanks, do iu have a way to set to dio
Victor Aprea
@vicatcu
Oct 05 2015 22:35
@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
Oct 05 2015 22:37
no i haven't seen a1a1 stuff yet.
could you also do read_flash instead of read_mem?
Victor Aprea
@vicatcu
Oct 05 2015 22:37
does esptool talk to the flash through the ROM bootloader?
yea sure, one sec
Ivan Grokhotkov
@igrr
Oct 05 2015 22:38
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
Oct 05 2015 22:43
@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
Oct 05 2015 22:44
address 0, size should be the size of the uploaded bin
207276 bytes
Victor Aprea
@vicatcu
Oct 05 2015 22:44
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
Oct 05 2015 22:48
perhaps esptool.py doesn't know how to read sizes which are not multiple of 4 bytes?
Victor Aprea
@vicatcu
Oct 05 2015 22:49
no it's the compiled bin ...
i need to turn the elf into a bin or something right?
Ivan Grokhotkov
@igrr
Oct 05 2015 22:49
oh, darn, you're right. it's the size being reported by the IDE which is off the mark :)
Victor Aprea
@vicatcu
Oct 05 2015 22:49
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
Oct 05 2015 22:50
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
Oct 05 2015 22:50
python esptool.py -p /dev/ttyUSB0 read_flash 0x00 211424 download.sketch.bin
ya?
Ivan Grokhotkov
@igrr
Oct 05 2015 22:51
yep
you can do hexdump and the diff hexdumped bins
Victor Aprea
@vicatcu
Oct 05 2015 22:51
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
Oct 05 2015 22:54
It's a mask rom, and looking at serial output, it appears to work.
Victor Aprea
@vicatcu
Oct 05 2015 22:55
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
Oct 05 2015 23:00
what the hell, i see output in windows @ 77600
Ivan Grokhotkov
@igrr
Oct 05 2015 23:01
might be a driver-related difference
Victor Aprea
@vicatcu
Oct 05 2015 23:01

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
Oct 05 2015 23:08
@igrr i have a feeling we're just going to call it an unsolved ESD mystery and move on... hehe
Ivan Grokhotkov
@igrr
Oct 05 2015 23:08
might be the right thing to do, in terms of time spent :)
Daniel Tullemans
@tullo-x86
Oct 05 2015 23:09
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
Oct 05 2015 23:09
yea i only care if it's a thing that happens more than once
@igrr what country are you in btw?
Ivan Grokhotkov
@igrr
Oct 05 2015 23:10
Russia, Saint-Petersburg
Victor Aprea
@vicatcu
Oct 05 2015 23:10
that's what i thought, you're a night owl :)
xbary
@xbary
Oct 05 2015 23:11
i from Poland :)
Victor Aprea
@vicatcu
Oct 05 2015 23:11
i'm in upstate new york
lol
@igrr well let me just say you are doing great with this project
and thank you
i'm still curious what the 6 means in boot mode: (3,6) if anyone knows
but I need to get going, gotta lock the chickens in and let the dog out :)
xbary
@xbary
Oct 05 2015 23:14
Arduino project is a brilliant thing esp8266
Victor Aprea
@vicatcu
Oct 05 2015 23:15
cheers all, talk later
xbary
@xbary
Oct 05 2015 23:29
dobranoc