These are chat archives for esp8266/Arduino

22nd
Oct 2015
kathir1951
@kathir1951
Oct 22 2015 11:02
Y
Can we upload external bin files from arduino upload button.? Any method
Me No Dev
@me-no-dev
Oct 22 2015 11:05
no, but what you can do is upload a blank sketch with arduino upload debugging enaled
see the command executed at the top of the debug screen
copy it and replace the bin path with your bin
then run in terminal
maybe add it to your externam makefile that created the bin you ant to upload
kathir1951
@kathir1951
Oct 22 2015 11:07
@ me-no-dev yes
@me-no-dev Pl once again explain detail
kathir1951
@kathir1951
Oct 22 2015 11:16
How can i add my make filethat create. Bin file
@me-no-dev pl clear explanation may help me My previous problem was solved by using 1.6,2 version Thanks very much
Me No Dev
@me-no-dev
Oct 22 2015 11:22
that depends on your makefile, but since you do not know that, I imagine you didn't write the makefile, so better leave it be and follow the terminal path
did you get the command that the IDE is executing to upload a bin?
kathir1951
@kathir1951
Oct 22 2015 11:27
@me-no-dev I. Know about make files Can you pl send details to my mail id kathiresanmuthiah2001@gmail.com How to make upload debug enable.
@me-no-dev Sorry for giving trouble alwaya
kathir1951
@kathir1951
Oct 22 2015 11:35
@me-no-dev can i use make files that create bin files using sdk
Me No Dev
@me-no-dev
Oct 22 2015 11:49
i'm not sure I understand your question
enable upload debug from Arduino IDE Settings
kathir1951
@kathir1951
Oct 22 2015 12:29
@me-no-dev ok How can i upload bin files created by make file? You told we can add make lies
@me-no-dev that method also you can explain
kathir1951
@kathir1951
Oct 22 2015 12:51
@me-no-dev if we set the path of xtensa tool chain in the arduino ide. Is it possible?
Me No Dev
@me-no-dev
Oct 22 2015 15:09
@kathir1951 did you get the command that was executed by the IDE?
for the makefile you need to understand how makefile works first, then you will know how to add the command to it
Victor Aprea
@vicatcu
Oct 22 2015 15:36
@igrr any thoughts on igrr/esptool-ck#16
Me No Dev
@me-no-dev
Oct 22 2015 15:38
@vicatcu is that other MCU an arduino?
Victor Aprea
@vicatcu
Oct 22 2015 15:39
yup
Me No Dev
@me-no-dev
Oct 22 2015 15:39
if so, small adjustments can be made to the bootloader to pass through that traffic when it'sintended for the ESP
Victor Aprea
@vicatcu
Oct 22 2015 15:39
i'm spinning my WildFire board to put an ESP8266 in place of the CC3000
Me No Dev
@me-no-dev
Oct 22 2015 15:40
so when the first couple of bytes arrive after reset, they can be checked if they are for the arduino bootloader (STK command) or for the ESP, then act acordingly
Victor Aprea
@vicatcu
Oct 22 2015 15:41
oh that's an interesting thought... i am a tiny bit worried about power / reset sequencing though
but that would be clever
and cleaner, so i wouldn't need application code to intervene as a transparent serial repeater
Me No Dev
@me-no-dev
Oct 22 2015 15:44
when the ardiono resets it waits for serial data for a little bit then boots, the esptool will send a byte and will trip the bootloader, but the bootloader expects particular bytes and only needs to be told to not respond to those if they are for the ESP and wait for maybe esptool upload end to boot the sketch and release both bootloaders
Victor Aprea
@vicatcu
Oct 22 2015 15:44
i'm already running a modified version of optiboot as well
so modifying it further is certainly plausible
Me No Dev
@me-no-dev
Oct 22 2015 15:45
I have written a programmer for AVRs that uses something similar to decide if it should flash the AVR or open serial for communication with the sketch
let me see if I can dig up the code
Victor Aprea
@vicatcu
Oct 22 2015 15:46
yea it would just be a bit of logic (here)[https://github.com/WickedDevice/WildFire-Arduino-Core/blob/master/WickedDevice/bootloaders/spiflash_optiboot/optiboot.c#L991-L994] and some code added to initialize UART1
and would need to handle exit criteria somehow
when it's in transparent serial mode
presumably there's a way to tell the esp load is done
Me No Dev
@me-no-dev
Oct 22 2015 15:48
are you using 32u4?
Victor Aprea
@vicatcu
Oct 22 2015 15:48
atmega1284p
and an ft231x usb chip
Me No Dev
@me-no-dev
Oct 22 2015 15:48
nice :)
well here is the part of one method that recognizes what mode it should enter
if(run_mode == RUNING_MODE_UNDEF){
    uint8_t tried = 1;
    while(usb_available() == 0 && tried++){
      usb_poll();
      _delay_ms(1);
    }
    if(usb_available()){
      uint8_t data[2];
      data[0] = stk_read_byte();
      if(data[0] == STK_GET_SYNC){
        data[1] = stk_read_byte();
        if(data[1] == STK_CRC_EOP){
          run_mode = RUNING_MODE_PROGRAM;
          PORT |= 1;
        } else {
          run_mode = RUNING_MODE_SERIAL;
          PORT |= 2;
          serial_write(data[0]);
          serial_write(data[1]);
        }
      } else {
        run_mode = RUNING_MODE_SERIAL;
        serial_write(data[0]);
      }
    } else {
      run_mode = RUNING_MODE_SERIAL;
    }
  }
Victor Aprea
@vicatcu
Oct 22 2015 15:51
interesting, thanks, i'll tuck that away and try and understand it better later :smile: - but you've got my wheels turning now, that would be a way better solution if i can make it work
Me No Dev
@me-no-dev
Oct 22 2015 15:53
in the basics what it does is wait a bit for a couple of bytes if those two bytes are the beginning of the AVR flash procedure, then it changes the mode to programming the avr, else it sets the mode to serial (esp flash)
if no bytes are gotten the mode will stay udefined and you can exit the bootloader
if serial, flash the esp and exit once that is done, else flash the AVR
usb here plays serial0 and serial plays serial1 in your case
Victor Aprea
@vicatcu
Oct 22 2015 15:55
incidentally how do you know when it's done flashing the ESP?
Me No Dev
@me-no-dev
Oct 22 2015 15:55
check the esptool source for that
Victor Aprea
@vicatcu
Oct 22 2015 15:55
gotcha
Me No Dev
@me-no-dev
Oct 22 2015 15:55
there is a command to exit the bootloader and start the sketch
Victor Aprea
@vicatcu
Oct 22 2015 15:56
yea that sounds right, i was perusing that code the other day
i'm also thinking about trying to port the esptool flashing code into AVR
but that's probably overkill
Me No Dev
@me-no-dev
Oct 22 2015 15:57
you mean to flash AVR img using esptool?
Victor Aprea
@vicatcu
Oct 22 2015 15:58
thought being that i could push an OTA update to the ESP8266, store it in my external spi flash, and then burn the ESP8266 from the image in my spiflash
but that's probably the wrong approach
Me No Dev
@me-no-dev
Oct 22 2015 15:58
you can upload both images and flash them :)
for parsing AVR hex files you can look at Adafruit's sketch for Arduino for loading trinket bootloader
Victor Aprea
@vicatcu
Oct 22 2015 16:00
the Optiboot mod I have parses Intel Hex files stored in the external SPI flash in the bootloader already
anyway, remotely reloading the ESP8266 is a problem for another day
as long as I give the ATMega1284p control over GPIO0 and CH_PD, something should be possible
kathir1951
@kathir1951
Oct 22 2015 20:05
@me-no-dev sorry for delay there is no setting in the menu for enabling Debug upload ? and when i try to upload empty sketch it shows error
kathir1951
@kathir1951
Oct 22 2015 20:32
@me-no-dev Thanks for the make tutorial
Me No Dev
@me-no-dev
Oct 22 2015 20:33
in my settings I see "Show verbose output during:" then two checkboxes
click the "upload" one
kathir1951
@kathir1951
Oct 22 2015 20:37
@me-no-dev what is the version you are using ? I am using 1.6.2 there no such ?