jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.83k stars 722 forks source link

support Arduino Mega / stk500v2 protocol #87

Closed tve closed 7 years ago

tve commented 8 years ago

Currently none of the flashing options work for the mega with the stk500v2 protocol. It's not clear why nothing works, so some logic analyzer work is required...

jcw commented 8 years ago

Different baud rate, perhaps?

ykri commented 8 years ago

Might help your investigation, I tried this with Mega:

  1. Installed MCU bootloader -> uploaded OTA with esp-link -> SUCCESS!!
  2. uploaded OTA with esp-link -> FAILURE!!

i.e. it uploads ok after a fresh bootloader but then any subsequent upload fails. It's like the first upload meshes up with the bootloader??? Any subsequent upload can succeed only by manually pressing MCU RESET and only at port 23.

Xerxes3rd commented 8 years ago

This sounds like an electrical problem- like the board isn't resetting at all or isn't resetting when the software thinks it is. See this post on the arduino forums for more information, noting that the symptoms described in the post are very similar to this issue (resetting and programming works fine with a 328/Uno but not a 2560/Mega):

http://forum.arduino.cc/index.php?topic=310109.0

bestbuddyrohit commented 8 years ago

hi, Any update with atmega2560. i also experienced the same. i i press the reset button i have a bit chance that mcu is programmed. but yes if the chip is freshly loaded with the boot loader, it will program at once without external reset required. after that same behaviour.

Grtschnk commented 7 years ago

Remark: I used the -D flag, but I'm not so sure if this is completely kosher. Flashing without -D flag gives: avrdude: stk500v2_command(): command failed

Found a quick fix for my Arduino Mega clone (equipped with CH340 Usb to Serial)! Don't know if it will work with a "proper" Mega

One way:

  1. avrdude -p m2560 -c stk500v2 -P net:192.168.0.27:23 -b 115200 -U flash:w:yourhex.hex -D It won't work anyway but now you can access it via ArrowUp in your console window
  2. Try: avrdude -p m2560 -c stk500v2 -P net:192.168.0.27:2323 -b 115200 -U flash:w:yourhex.hex -D ..and wait for the first timeout (after all it might work on the first try?)
  3. Ctr+C (abort sequence) The next command must follow immidietally!
  4. avrdude -p m2560 -c stk500v2 -P net:192.168.0.27:23 -b 115200 -U flash:w:yourhex.hex -D (to be fast you hit ArrowUp twice and then return in your console)

Other way: Hit the reset uC button in ESP-link and quickly follow step 4.

What happened? My theory (I'm certain someone with more knowledge might have a better explanation): The Mega needs the stk500v2 protocol, but ESP-Link doesn't detect it as a flashing sequence and doesn't reset the MCU. Using port 2323 in step 2 forces a reset of the MCU. Unfortunately it doesn't work immediately, maybe timing issues? By aborting (via Ctr+C) and immediately using the command with port 23 we just forward the flashing sequence from avrdude. Basically it is like hitting the reset button by hand - only remote.

Found this out while experimenting without the connected reset line first and noticed that manually hitting the button sometimes worked. After an hour or two I got the timing right most of the time 😆

My clone board has an LED that's on when it is in flash mode. Sometimes ESP-link manages to set it into flash mode via -c arduino, but then it just hangs at the "not in sync" error. (I read somewhere that the Mega only supports the stk500v2 bootloader // wiring works too with this method!)

A possible "proper" fix might be (just speculating) to change the delay time between reset and start of communication when using port 2323. Might mess up flashing of other chips, so it should be user configurable in the UI.

dannybackx commented 7 years ago

This issue is bothering me. Can anyone tell me where to look to debug/fix this ?

tve commented 7 years ago

I think the first step is probably to read up which char sequence starts the programming and add it to esp-link: https://github.com/jeelabs/esp-link/blob/master/serial/serbridge.c#L169-L182 The second step is probably to look at the TX and RX lines with a scope and see what the timing looks like, I hope the Mega responds with something similar to the way the 328p does....

janchrillesen commented 7 years ago

One thing I noticed is that I can't program my Mega2560 over USB when the ESP8266 is connected. I have two Mega2560 with ESP8266/ESP-link connected to a prototype cape.

One board is using a simple voltage divider on the Mega2560 TX line towards the ESP8266 and TX of the ESP8266 directly connected to the Mega2560 RX. On this cape I need to remove the ESP8266 to program using USB The other board is using "real" (MOSFET based) levelshifters on both RX and TX lines and on this board I need to remove the entire cape - so it seems like there may be some hardware level stuff stopping programming from working.

Does anyone else see this issue?

dannybackx commented 7 years ago

@tve If I understand this correctly, the Mega programmer sends a sequence which esplink needs to intercept, put the Mega in programming mode, and only then get avrdude and the Mega to talk to each other ?

When I run avrdude -patmega2560 -cwiring -t -Pnet:esplink:23 -x snooze=1 -v -v -v -v it says [...] avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14] avrdude: ser_recv(): programmer is not responding avrdude: stk500v2_ReceiveMessage(): timeout

So I'm guessing I need this sequence in serial/serbridge.c like || (len == 7 && data[0] == 0x1b && data[1] == 0x01 && data[2] == 0x00 && data[3] == 0x01 && data[4] == 0x0e && data[5] == 0x01 && data[6] == 0x14) and then I should see the reset sequence being triggered as 59746> SERBRIDGE Accept port 23, conn=0x3fff9828, pool slot 0, ix 0, mode 0 59747> SERBRIDGE Accept conns 0x3fff9828 0x00000000 0x00000000 0x00000000 59801> SERBRIDGE Accept ports 0x3fff6fb4 0x3fff6fd0 60050> MCU Reset=gpio5 ISP=gpio-1

tve commented 7 years ago

If the reset sync sequence is really that long, yes. You could also start with just matching the first 3 chars, for example.

On 12/11/2016 1:36 AM, dannybackx wrote:

@tve https://github.com/tve If I understand this correctly, the Mega programmer sends a sequence which esplink needs to intercept, put the Mega in programming mode, and only then get avrdude and the Mega to talk to each other ?

When I run avrdude -patmega2560 -cwiring -t -Pnet:esplink:23 -x snooze=1 -v -v -v -v it says [...] avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14] avrdude: ser_recv(): programmer is not responding avrdude: stk500v2_ReceiveMessage(): timeout

So I'm guessing I need this sequence in serial/serbridge.c like || (len == 7 && data[0] == 0x1b && data[1] == 0x01 && data[2] == 0x00 && data[3] == 0x01 && data[4] == 0x0e && data[5] == 0x01 && data[6] == 0x14) and then I should see the reset sequence being triggered as 59746> SERBRIDGE Accept port 23, conn=0x3fff9828, pool slot 0, ix 0, mode 0 59747> SERBRIDGE Accept conns 0x3fff9828 0x00000000 0x00000000 0x00000000 59801> SERBRIDGE Accept ports 0x3fff6fb4 0x3fff6fd0 60050> MCU Reset=gpio5 ISP=gpio-1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-266272242, or mute the thread https://github.com/notifications/unsubscribe-auth/AACaOJxvwX5K5p5zoWF58kK1oAeM7weyks5rG8QSgaJpZM4G9fKr.

FernandoGarcia commented 7 years ago

Hi @tve !

I don't know if it's possible or how to make but I would like to give this suggestion.

I have tested this library with an Arduino nano and worked very well. I'll try with Arduino Mega later.

https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266AVRISP

Maybe you could join this library to ESP-link to make possible programming via ISP instead UART.

With ISP is possible burn hex file to any type of Arduino.

Best regards.

FernandoGarcia commented 7 years ago

With Arduino mega 2560 doesn't work using CMD on Windows but worked using AVRDUDESS.

capturar

zrc98 commented 7 years ago

Hi. On MacOS doesn't work neither from terminal, nor with avrdudess(using with mono). If mega2560 connected to usb avrdude/avrdudess works fine. I tried to use v.2.2.3 and v.3.0.14 of esp-link. Need help(

FernandoGarcia commented 7 years ago

You needs check my suggestion again. AVRDUDESS can't be used with ESP-link for now. You should install this code directly on ESP8266 WITHOUT ESP-link. https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino

FernandoGarcia commented 7 years ago

Follow my tutorial to see how to update the sketch using this library

https://youtu.be/Ll35jVvetA8

FernandoGarcia commented 7 years ago

It worked using the IDE directly too with command ctrl + shift + u and programmer in Arduino as ISP.

dannybackx commented 7 years ago

Thanks @FernandoGarcia I'll have a look at this.

zrc98 commented 7 years ago

Thank you !! It could be a temporary solution) Hope one day esp-link will support mega clones.

CharlyBrok commented 7 years ago

I did this script as a workaround :

!/bin/bash

CMD="avrdude -p m2560 -c stk500v2 -P net:$1:2323 -U flash:w:$2 -D -v" CMD23="avrdude -p m2560 -c stk500v2 -P net:$1:23 -U flash:w:$2 -D -v"

timeout 1 $CMD

$CMD23 echo "Done" exit

Usage : ./flash_mega.sh esp-e62067 /tmp/arduino_build_495949/TFT_Test_Mega_3.ino.hex

rnizametdinov commented 7 years ago

More elegant workaround for windows and mega-esplink. Make bat file with next:

curl --data '' http://192.168.2.92/console/reset SET ADDRESS=192.168.2.92 SET BAUD=115200 SET HEXFILE=d:\YandexDisk\SmartHome\Arduino\test\test\test.ino\test.ino.ino.mega.hex set prog=D:\Software\arduino-1.8.1\hardware\tools\avr/bin/avrdude set conf=D:\Software\arduino-1.8.1\hardware\tools\avr/etc/avrdude.conf %prog% -C%conf% -v -p atmega2560 -b %BAUD% -c wiring -P net:%ADDRESS%:23 -D -Uflash:w:%HEXFILE%:i

curl --data '' http://192.168.2.92/console/reset - will reset Arduino Mega

uzi18 commented 7 years ago

reset with curl and launch avrdude works form me on linux.

Looks like reset related issue

uzi18 commented 7 years ago

It is possible for me to ivestigate it with logic analyser if you want

dannybackx commented 7 years ago

FYI a first cut of esp-link with mega flashing support is downloadable from http://danny.backx.info/danny/backup/esp-link-danny-20170204064017.tgz and the script at http://danny.backx.info/danny/backup/megaflash . This is a branch of 3.0alpha (by fuzzball03 and me) which contains stuff to change the telnet ports etc and to secure them. The UI of esp-link is protected with userid "admin" password "s3cr3t" by default. Feedback welcome.

uzi18 commented 7 years ago

Any patch?

04.02.2017 11:44 AM "dannybackx" notifications@github.com napisał(a):

FYI a first cut of esp-link with mega flashing support is downloadable from http://danny.backx.info/danny/backup/esp-link-danny- 20170204064017.tgz and the script at http://danny.backx.info/danny/ backup/megaflash . This is a branch of 3.0alpha (by fuzzball03 and me) which contains stuff to change the telnet ports etc and to secure them. The UI of esp-link is protected with userid "admin" password "s3cr3t" by default. Feedback welcome.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-277434834, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOUz1tv2hCiQBUZ9Fsv6P0A0zLZ3cyks5rZFaggaJpZM4G9fKr .

dannybackx commented 7 years ago

I'll see what I can do. This is my third piece of development in esp-link, neither of which is in the main source tree yet, so I'll have to see how to do this without making (more of) a mess.

uzi18 commented 7 years ago

Try to attach patch for upsteam i will try it and test

04.02.2017 3:31 PM "dannybackx" notifications@github.com napisał(a):

I'll see what I can do. This is my third piece of development in esp-link, neither of which is in the main source tree yet, so I'll have to see how to do this without making (more of) a mess.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-277449478, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOU1Ba0W41zWI1faGaKSBa9w4gVkk1ks5rZIvIgaJpZM4G9fKr .

dannybackx commented 7 years ago

I've uploaded my code to https://github.com/dannybackx/esp-link.git/trunk . This is without the serial-bridge/security changes that were in the binary version. So this is TVE's 3.0alpha with just a few changes.

uzi18 commented 7 years ago

@dannybackx does not work for me, used Your binary from tgz archive and script above

$ bash ../esp-link/megaflash -v 192.168.2.6 sterownik_ac_plus_dc_fan.hex Resetting AVR with http://192.168.2.6/pgmmega/sync

Error programming AVR

ESP-link Debug:

90714> processRecord 256, call programPage() 8000a700 590758> Address old 8000a700 new 8000a800 590760> processRecord 256, call programPage() 8000a800 590804> Address old 8000a800 new 8000a900 590807> processRecord 256, call programPage() 8000a900 590851> Address old 8000a900 new 8000aa00 590853> processRecord 256, call programPage() 8000aa00 590897> Address old 8000aa00 new 8000ab00 590900> processRecord 256, call programPage() 8000ab00 590944> Address old 8000ab00 new 8000ac00 590946> processRecord 256, call programPage() 8000ac00 590991> Address old 8000ac00 new 8000ad00 590992> processRecord 256, call programPage() 8000ad00 591036> Address old 8000ad00 new 8000ae00 591038> processRecord 256, call programPage() 8000ae00 591082> Address old 8000ae00 new 8000af00 591085> processRecord 256, call programPage() 8000af00 591129> Address old 8000af00 new 8000b000 591131> processRecord 256, call programPage() 8000b000 591175> Address old 8000b000 new 8000b100 591178> processRecord 256, call programPage() 8000b100 591222> Address old 8000b100 new 8000b200 591224> processRecord 256, call programPage() 8000b200 591268> Address old 8000b200 new 8000b300 591269> processRecord 256, call programPage() 8000b300 591313> Address old 8000b300 new 8000b400 591316> processRecord 256, call programPage() 8000b400 591361> Address old 8000b400 new 8000b500

uzi18 commented 7 years ago

But smaller hex file works ok:

$ ls -lh *.hex -rw-r--r-- 1 me users 241K 02-06 12:41 sterownik_ac_plus_dc_fan.hex <- NOT OK -rw-r--r-- 1 me users 103K 2015-11-24 sterownik_pwm.hex <- OK

dannybackx commented 7 years ago

Can you share the big file so I can try it ? I've had trouble with lagging in the version I distributed as binary, there might be issues with that version. The source version might not have that. So I'd like your big file to see if I can use it to narrow things down and/or find other problems with my code.

uzi18 commented 7 years ago

https://github.com/uzi18/sterownik/raw/master/arduino/sterownik_ac_plus_dc_fan.hex Why did You provide different/another cgi for mega?

wallorchid commented 7 years ago

Compiled dannybackx's code using the supplied docker config. Loaded in ESP8266MOD AI-THINKER module. Using avrdude to load got same error as std release of eep-link (...ioctl("TIOCMGET"): Device not configured...avrdude: stk500v2_ReceiveMessage(): timeout). Verified that rx/tx comm with 2560 is working within console of esp-link web ui. Reset also verified to work as expected from web ui.

Is danny... forked code only suppose to work with the http post method? vs using telnet 23 or 2323?

I am not clear what boot loader my Mega2560 boards are using, they are Osqyoo that appear identical to the branded Arduino boards except for logo. Several Mega2560 boot loaders exist.

Researching boot loaders it would appear that 2560 boot loaders use stk500v2 because of the memory size of the 2560. A fork of OptBoot, https://github.com/majekw/optiboot claims to be modified to work with the 2560 using what I understand to be stk500v1 (note version). Presumably the existing stock release of esp-link works with OptiBoot. Has anyone tried this path?

uzi18 commented 7 years ago

Need to mention - my "big" hex sent by Arduino IDE/avrdude and serial connection without problems. So it's not related to bootloader.

I have flashed fixed optiboot some time ago.

wallorchid commented 7 years ago

My understanding is that the developers of esp-link had to spend time figuring out how to sit as a man in the middle to avrdude and the micro. This detail work was done with std optiboot that uses stk500v1. Avrdude understands both v1 and v2. But esp-link only understands how to fake out std optiboot running stk500v1.

So in theory an atmega2560 running optiboot w/stk500v1 ought to work just fine. I likely will try it but wanted to know if my underlying assumptions are correct.

If esp-link can be made to support stk500v2 great, but my first try with solution did not work.

dannybackx commented 7 years ago

@wallorchid : your assumption is close to the truth. A module added to esp-link actually replaces avrdude. TVE already implemented this for stk500, I just added stk500v2.

dannybackx commented 7 years ago

The stk500v2 (Mega) implementation duplicates the method offered previously (see the avrflash script), also known as the "http post" method. For this, use the megaflash script. It uses curl to talk to esp-link. You should see something like this :

acer: {1941} megaflash testesp ~/src/sketchbook/mega-esp/kippen-mega/tmp/obj/kippen.hex AVR in SYNC at 115200 baud, board 1e.98.01, hardware v15, firmware 2.10 Success. 30920 bytes at 115200 baud in 5.5s, 5536B/s 48% efficient Success, took 7 seconds acer: {1942}

uzi18 commented 7 years ago

Where could be a problem with my big hex? Did You tasted it?

07.02.2017 5:36 AM "dannybackx" notifications@github.com napisał(a):

The stk500v2 (Mega) implementation currently duplicates the method offered previously, also known as the "http post" method. Use e.g. the megaflash script provided. It uses curl to talk to esp-link. You should see something like this : acer: {1941} megaflash testesp ~/src/sketchbook/mega-esp/kippen-mega/tmp/obj/kippen.hex AVR in SYNC at 115200 baud, board 1e.98.01, hardware v15, firmware 2.10 Success. 30920 bytes at 115200 baud in 5.5s, 5536B/s 48% efficient Success, took 7 seconds acer: {1942}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-277899461, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOU5RiKaV6ImfvhMkdJFIa_8pGqLsUks5rZ_TDgaJpZM4G9fKr .

dannybackx commented 7 years ago

I am looking into it.

Lincolnshirenick commented 7 years ago

@dannybackx, I have hardware and a project so would be happy to BETA test potential solutions for the Mega OTA flash problem as this is something that I need.

I'm in the process of developing a project on an Arduino Mega2560 and would like to be able to flash OTA. I have two Megas and as far as I'm aware they are both optiboot but neither will program with the stock ESP-LINK, I've tried every method that has so far been published here except for FernandoGarcias as I'm not keen on the need for all the other tool installs that are required and the loss of some of the ESP-LINK functionality. I've not currently tried yours as it seemed from this thread that it didn't initially work and that your are investigating.

One hardware point, I note that I have to disconnect the TX from the ESP to flash by USB and I'm wondering if the same issue is occurring for the ESP from the USB TX.

uzi18 commented 7 years ago

To work together with usb programmer and esp-link, you need to add rectifier diode in direcion from arduino pin to esp-link on tx. Works like charm.

In my 2560 project we use RPi-usb connection to remote programming but esp-link is more lightweight. I will be glad to resolve this issue.

09.02.2017 10:47 AM "Lincolnshirenick" notifications@github.com napisał(a):

@dannybackx https://github.com/dannybackx, I have hardware and a project so would be happy to BETA test potential solutions for the Mega OTA flash problem as this is something that I need.

I'm in the process of developing a project on an Arduino Mega2560 and would like to be able to flash OTA. I have two Megas and as far as I'm aware they are both optiboot but neither will program with the stock ESP-LINK, I've tried every method that has so far been published here except for FernandoGarcias as I'm not keen on the need for all the other tool installs that are required and the loss of some of the ESP-LINK functionality. I've not currently tried yours as it seemed from this thread that it didn't initially work and that your are investigating.

One hardware point, I note that I have to disconnect the TX from the ESP to flash by USB and I'm wondering if the same issue is occurring for the ESP from the USB TX.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-278594185, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOUwxgyzaQuY30w0TytDZKl-YNHXJbks5rauCTgaJpZM4G9fKr .

Lincolnshirenick commented 7 years ago

@uzi18 I had thought about a diode but my point was more along the lines of if the ESP TX upsets the USB then the USB might also be upsetting the ESP so there would be an argument for fitting a diode for both devices (the USB path has a 1k resistor).

dannybackx commented 7 years ago

@uzi18 @Lincolnshirenick it is my experience also that you can't program the Mega via USB if it's connected to an ESP in a way suitable for esp-link. The solution that I'm working on doesn't have that : it is the serial connection between ESP and Mega that is used to program the Mega. So if you move a setup to a production environment (in my case, to the chicken house in my garden), it should be possible to reprogram the Mega without access to the hardware.

uzi18 commented 7 years ago

Did You checked my hex file?

09.02.2017 7:10 PM "dannybackx" notifications@github.com napisał(a):

@uzi18 https://github.com/uzi18 @Lincolnshirenick https://github.com/Lincolnshirenick it is my experience also that you can't program the Mega via USB if it's connected to an ESP in a way suitable for esp-link. The solution that I'm working on doesn't have that : it is the serial connection between ESP and Mega that is used to program the Mega. So if you move a setup to a production environment (in my case, to the chicken house in my garden), it should be possible to reprogram the Mega without access to the hardware.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-278724504, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOU3vt5k34h1ANZBXKZ7jvEVsn1Js7ks5ra1aFgaJpZM4G9fKr .

dannybackx commented 7 years ago

This is not my day job so it takes a little bit of time :-) The error message is caused by :

  1. timeout too short in the script (easy to bypass)
  2. a command in the hex file that isn't interpreted yet. See the short line below : :10FFE000C6010E949F4CC6010E946C4EA6960FB699 :10FFF000F894DEBF0FBECDBFDF91CF911F910F915F :020000021000EC :10000000FF90EF90DF90CF90BF90AF909F908F9038 :100010007F90089586E590E10E940649882319F0B3 This is not unexpected. The Mega contains more memory so the special command is probably to move to the next piece of address space.

I'll deal with this shortly.

dannybackx commented 7 years ago

LOL, just ignoring that line gets this file to flash correctly.

acer: {1962} megaflash testesp ~/sterownik_ac_plus_dc_fan.hex
AVR in SYNC at 115200 baud, board 1e.98.01, hardware v15, firmware 2.10
Success. 22260 bytes at 115200 baud in 15.7s, 1411B/s 12% efficient
Success, took 17 seconds
acer: {1963} 

This is not a general solution obviously. But the program runs :

Lucjan v.0.1.0.109

I2C: Skanowanie ...
RTC: brak DS1307
DALLAS: Poczatek poszukiwania czujnikow.

 Czas komenda konwersji dla czujnika = 2
DALLAS: Koniec poszukiwania czujnikow.

SD: brak karty
SD: blad karty
SD: blad odczytu danych
IP: konfiguracja sieci...
Wolny RAM:4015
IP: brak EtherShield...
START
dannybackx commented 7 years ago

You can grab a new binary version at http://danny.backx.info/danny/backup/esp-link-danny-20170211161419.tgz and http://danny.backx.info/danny/backup/megaflash . The source code repo at https://github.com/dannybackx/esp-link.git is also up to date.

Note : this is a proof of concept version, the segment address record is basically ignored. Let me know if this works.

uzi18 commented 7 years ago

Ok I will check new version. Maybe we need to send some special command to bootloader on this short line.

11.02.2017 4:19 PM "dannybackx" notifications@github.com napisał(a):

You can grab a new binary version at http://danny.backx.info/danny/ backup/esp-link-danny-20170211161419.tgz and http://danny.backx.info/danny/backup/megaflash . The source code repo at https://github.com/dannybackx/esp-link.git is also up to date.

Note : this is a proof of concept version, the segment address record is basically ignored. Let me know if this works.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-279151412, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOU0J8VZIDdZvzOQ0ywH5Jz1lxAjWtks5rbdFjgaJpZM4G9fKr .

Lincolnshirenick commented 7 years ago

@dannybackx I've flashed an ESP with your bins but I have the same problem with the sync timing out. Just one quick check, I've managed to flash a micro without problem with the standard ESP-LINK, but is this the correct command line for a Mega: avrdude -v patmega2560 -cwiring -Pnet:23 -b115200 -D -U flash:w:mega_code.ino.hex:i -vvvvv

uzi18 commented 7 years ago

Use megaflash provided by Danny not avrdude.

11.02.2017 10:05 PM "Lincolnshirenick" notifications@github.com napisał(a):

@dannybackx https://github.com/dannybackx I've flashed an ESP with your bins but I have the same problem with the sync timing out. Just one quick check, I've managed to flash a micro without problem with the standard ESP-LINK, but is this the correct command line for a Mega: avrdude -v patmega2560 -cwiring -Pnet:23 -b115200 -D -U flash:w:mega_code.ino.hex:i -vvvvv

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeelabs/esp-link/issues/87#issuecomment-279175686, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHOU4x8MlyvNu9E8ohQHL4opICeDMyCks5rbiKagaJpZM4G9fKr .

Lincolnshirenick commented 7 years ago

Thanks uzi18, I've tried it with megaflash but it just sits in a permanant waiting for sync loop with the following output: Resetting AVR with http://192.168.1.239/pgmmega/sync