loathingkernel / ariadne-bootloader Goto Github PK
View Code? Open in Web Editor NEWThis project forked from codebndr/ariadne-bootloader
A little less unfinished TFTP bootloader for Arduino Ethernet or Arduino with Ethernet Shield
This project forked from codebndr/ariadne-bootloader
A little less unfinished TFTP bootloader for Arduino Ethernet or Arduino with Ethernet Shield
Is possible for the bootloader to start the program if the W5100 (W5200, ...) shield is not present? Currently, the program does not start if the card is not present, and is not possible to upload the new program via the serial port.
I'm using an ATMega2560 and a W5500 shield. I can talk to the shield via web server and reset server, and I've configured everything on the EEPROM. But I can't get passed an infinite loop triggering a watchdog reset here. The socket is never opened and always returns "closed".
do {
// Write interrupt
spiWriteReg(REG_S3_IR, S3_W_CB, 0xFF);
// Write mode
spiWriteReg(REG_S3_MR, S3_W_CB, MR_UDP);
// Write TFTP Port
spiWriteWord(REG_S3_PORT0, S3_W_CB, port);
// Open Socket
spiWriteReg(REG_S3_CR, S3_W_CB, CR_OPEN);
while(spiReadReg(REG_S3_CR, S3_R_CB)) {
//wait for command to complete
}
// Read Status
if(spiReadReg(REG_S3_SR, S3_R_CB) != SOCK_UDP)
// Close Socket if it wasn't initialized correctly
spiWriteReg(REG_S3_CR, S3_W_CB, CR_CLOSE);
// If socket correctly opened continue
} while(spiReadReg(REG_S3_SR, S3_R_CB) != SOCK_UDP);
Any ideas on getting past that?
From @PhilFluffy on February 10, 2017 7:33
Hi thanks for reading this, I know its been a while since a release, but this bootloader is so useful to me I hope its not just left in a sunset phase now.
I'm trying to use ariadne with its ethernet reset server alongside my sketch for some home automation equipment (saves massively and avoids laptops up ladders to update my controllers in odd locations). One of the tasks that does is send out a http POST to a remote home-assistant automation server with a JSON formatted string so it can keep the master house gui in sync with all the nodes.
When I enable reset.check in the main loop, the following code stops working
if (jsonclient.connect(Configuration.extJsonServer, Configuration.extJsonServerPort)) {
// Make a HTTP JSON request:
mylocalJsonData = (F("POST /api/states/switch."));
Serial.print (F("inner loop json data is "));Serial.print (String(mylocalJsonData)+ "\n");
} else { Serial.print ("Error :- "+String(jsonclient)+ "\n");}
In the serial log I see this
" Error :- 0"
Error code zero indicating failed connection of course. And it also doesn't send the packets out the interface at all on tcpdump output.
My sketch has 2 other ethernet services which function fine, (udp for ntp client, and ethernet server listening on port 80 http use in my sketch which uses GET requests) so it seems its just the outbound POST from my arduino ethernet tcp as a client affected.
If I comment out reset.check(); in the main loop, the json POST starts working. It has to be a POST to authenticate to the remote server in the JSON headers.
I read a post from a few years ago from Stelios Tsampas where he was discussing how to work around a similar sounding issue, is it documented somewhere and this issue now solved?
http://developers.arduino.narkive.com/m4JMgDNs/remotely-resetting-an-arduino
As a workaround, I already have a authenticated section in my configuration web gui, can I call a reset method from that instead of running a whole daemon on a higher port with a check in the main loop just for the reset? I already have a function that calls the following to do a soft reset after updating network config in eeprom, I could just expand that out if so.
asm volatile (" jmp 0");
Copied from original issue: codebndr#37
There are references to a 'hardware' folder which doesn't exist as well as the boards.txt and platform.txt not being inside the bootloaders folder and seemingly being unused.
The old codebndr version did have this 'hardware' folder and the boards.txt and platform.txt files were located inside in a completely different structure. I can get that version to install no problems in Arduino IDE and Atmel Studio 7. However I can't figure out a way to install this current structure with the given installation instructions.
Any pointers?
From @per1234 on May 8, 2015 1:59
I have created a working implementation of installation of Ariadne to the Arduino IDE via Boards Manager. The URL is:
https://per1234.github.io/Ariadne-Bootloader/package_codebendercc_ariadne-bootloader_index.json
This can be added to Arduino IDE 1.6.4 in File > Preferences > Additional Boards Manager URLs. Then Ariadne Bootloader will appear as one of the options for installation under Tools > Board > Boards Manager...
I would like to create a pull request to add this capability to Ariadne but first I need the installation file to be available. The most common way of doing this seems to be a Github release. My installation file is here:
https://github.com/per1234/Ariadne-Bootloader/releases/download/v1.0.0/ariadne.zip
You can download mine to use or create your own. If you create your own notice that the folder structure has to be changed slightly.
For examples of how others have set this up see:
https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls
Thanks, Per
Copied from original issue: codebndr#20
Dear All,
I've uploaded the ariadne bootloader into my arduino UNO board and want to flash blink program via USB port.
Getting verification error while uploading,
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x0c
avrdude: verification error; content mismatch
What could be the problem ?
Can anyone help me on this issue ?
Here is the log:
_Sketch uses 1,976 bytes (6%) of program storage space. Maximum is 32,256 bytes.
Global variables use 606 bytes (29%) of dynamic memory, leaving 1,442 bytes for local variables. Maximum is 2,048 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM17 -b115200 -D -Uflash:w:C:\Users\WELCOME\AppData\Local\Temp\build7065a3ab365322b10c2da545450ef55d.tmp/Blink_Serial.ino.hex:i
avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM17
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 0.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading input file "C:\Users\WELCOME\AppData\Local\Temp\build7065a3ab365322b10c2da545450ef55d.tmp/Blink_Serial.ino.hex"
avrdude: writing flash (1976 bytes):
Writing | ################################################## | 100% 0.29s
avrdude: 1976 bytes of flash written
avrdude: verifying flash memory against C:\Users\WELCOME\AppData\Local\Temp\build7065a3ab365322b10c2da545450ef55d.tmp/Blink_Serial.ino.hex:
avrdude: load data flash data from input file C:\Users\WELCOME\AppData\Local\Temp\build7065a3ab365322b10c2da545450ef55d.tmp/Blink_Serial.ino.hex:
avrdude: input file C:\Users\WELCOME\AppData\Local\Temp\build7065a3ab365322b10c2da545450ef55d.tmp/Blink_Serial.ino.hex contains 1976 bytes
avrdude: reading on-chip flash data:
Reading | ###########################################An error occurred while uploading the sketch
####### | 100% 0.26s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x0c
avrdude: verification error; content mismatch
avrdude done. Thank you._
Hi everyone.
I have built a modular board to test different combinations of ATmega and Wiznet .
Trying these combinations I have found an issue with TFTP transfers when trying to send the .bin to an ATmega1284P + WizNet5200 board. While it pings correctly, TFTP is timeout
This is the combination I would like to use, and the only one with this issue. which is not present when using other combinations of ATmega and WizNet. I've tried it successfully with the ATmega1284P + WixNet5100, or with the ATmega328 + Wiznet5200
I've tried with TFTP64 to discard windows TFTP client.
Any further ideas?
Hi,
I did first a upload of the bootloader of Ariadne on a Atmega2560 (in fact, a controllino Mega). I did some modifications in spi.h, spi.c for pinout on the eth et rtc (instead of sd).
(I uploaded with an arduinoISP with the http://www.gammon.com.au/forum/?id=11635 scketch)
I could make an upload through tftp and software was working fine but I got some issues to ping the atmega and to reupload through tftp. the device was unreachable... Also I got issue to upload the sketch on serial (via arduino IDE) with another computer (with mine it is still ok...?) : uploading is hanging...
then I tried with the Netload bootloader to check... There I can upload on serial. I can update the network data and I can ping the atmega... However I get a timeout when I try to upload through tftp (I disabled the firewall...)
any idea?
thanks !
From @puhycz on November 11, 2016 15:25
Hello,
I try program this Ariadne-Bootloader to Arduino Mega2560 by ASIX PRESTO Programmer (I have only this programmer).
When I open hex file, there are some alert about Little or Big Endian:
Please help me with settings fuses. Is somewhere specify fuses for ariadne-bootloader?
I try default fuses with SPI prog. enabled, but it is not function ...
Many thanks,
Jan
Copied from original issue: codebndr#36
From @andrebstv on February 20, 2016 13:50
Hi,
I couldn`t help but notice the bootloader is not protected by a WDT. I have a device on the field that from time to time hangs, and as I can see from logs writen on a SD card It does in the bootloader section. (it shows a "reboot" string on the log and then no "Power ON" string which is the very first thing it does on app start).
Ive changed the bootloader code to include proper wdt protection, but I
m unable to compile it... It may sound like a noob error, but it fails on the memcpy_PF... I`ve seen previous ppl having this error but no solution to it.
I do compile on windows, using the WinAVR toolchain.
Where should I change on the makefile so I can compile it? Tried everywhere and still got this error.
Note that I would gladly post the wdt fix once I`ve tested.
Copied from original issue: codebndr#23
Hello, I use your ariadne bootloader with arduino mega 2560 and standard ethernet shield W5100. Now I have problem with upload this project. When I upload by USB cable standard from arduino IDE, it´s ok and function, but by TFTP it is not function - TFTP confirm transmission as success, but after uploads there is only LED still flashing. Smaller project is no problem upload by TFTP an your ariadne bootloader. Do you have some ideas why ?
There is some screenshot and bin and ino files:
https://www.puhy.cz/download/arduino/topeni/swtopeni.ino.ino
https://www.puhy.cz/download/arduino/topeni/topeni.bin
https://www.puhy.cz/download/arduino/topeni/tftp.png
but after this LED is only blinking.When I upload by Arduino IDE and USB cable it is ok and function ...
Many thanks,
Jan
Hi,
I have a Arduino UNO (Arduino as ISP) , a Arduino MEGA2560 (to be programmed with Ariadne bootloader) and W5100 Ethernet shield.
As you have mentioned, I've followed the below link to program the Mega board with Ariadne-Bootloader(.h) using UNO(Arduino as ISP).
http://www.gammon.com.au/forum/?id=11635
Able to program the default Mega bootloader code using gammon's url.
I have converted "ariadne_atmega2560_w5100.hex" bootloader hex file to "ariadne_atmega2560_w5100.h" using MUSHClient and flashed the code into Mega2560 board.
Now I have tried to upload the blink code using USB cable (as usual) but I have got the below error.
Can you please help me on this issue ?
avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM16
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
An error occurred while uploading the sketch
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude done. Thank you.
Regards,
Titus S.
From @loathingKernel on February 1, 2014 12:35
@MarekLew wrote:
Library TFTP wrong use registers REG_S3_RX_RD0, REG_S3_TX_WR0, REG_S3_RX_RSR0.
Trying to modify AriadneBootloader for W5200 and ATmega2560 with progaram> 64KB noticed that the transmission every time it stops at 55KB for the 2K buffer soket.
Analyzed the library and documentation W5100 and W5200.
REG_S3_TX_WR0 is NO PHYSICAL ADDRESS for the third soket and can not be freely modified. Is the number of bytes processed the program. A REG_S3_RX_RSR0 tells you how many bytes have to be read in the buffer.
In a few days try shared corrected code. For now, I have to very modified system and W5200. In the meantime, put 'suggested amendments.
Today I have only smartphone.
When soket is initialized:
spiWriteWord (REG_S3_RX_RD0, 0);
You can not move REG_S3_RX_RD0 of S3_RX_START:
-- If (readPointer == 0) readPointer = S3_RX_START;
or move back
-- If (readPointer == S3_RX_END) readPointer = S3_RX_START;
repleace with like this
++ if ((--packetSize) == 0)break;//end of package
or better
-- for(count = TFTP_PACKET_MAX_SIZE; count--;) {
++ for(count = packetSize; count--;) {
to read the bytes from the physical address, use the mask and shift:
-- SpiWriteWord (REG_S3_RX_RD0, readPointer);
++ SpiWriteWord (REG_S3_RX_RD0, S3_RX_START + (readPointer & 0x7ff));
0x7ff - mask for 2k
And of course analogous not to REG_S3_TX_WR0:
-- writePointer = spiReadWord (REG_S3_TX_WR0 - S3_TX_START);
++ writePointer = spiReadWord (REG_S3_TX_RD0);
-- If (writePointer == S3_TX_END) writePointer = S3_TX_START;
-- SpiWriteWord (REG_S3_TX_WR0, writePointer - S3_TX_START);
++ SpiWriteWord (REG_S3_TX_WR0, S3_TX_START + (writePointer & 0x7ff));
And now at last
uint16_t PacketSize = spiReadWord (REG_S3_RX_RSR0);
contains useful information how much data is left in the buffer.
You can probably remove.
while ((spiReadReg (REG_S3_IR) & IR_RECV)) {
spiWriteReg (REG_S3_IR, IR_RECV);
/ / FIXME: is this right after all? smaller delay but
/ / Still a delay and it still breaks occasionally
delayms (TFTP_PACKET_DELAY);
}
Besides, I've used yet PacketSize I used to check whether the data came in full.
I not use this for W5100 only W5200 and 4K socket.
Sorry for my English, I used a translator.
Copied from original issue: codebndr#11
Hello!
I have a arduino Mega 2560 ans ITHEAD shield with W5100. I use Nick Gammon's guide to compile
bootloader. I changed the bit lock (0x0F) but the program indicates 0xCF. After the debug version send
Main: Ariadne for Arduino Mega2560, Version 0.5 Net: Built-in settings Net: Address: 0xC0.0xA8.0x01.0x80 Net: Subnet: 0xFF.0xFF.0xFF.0x00 Net: Gateway: 0xC0.0xA8.0x01.0xFE Net: MAC: 0xDE.0xAD.0xBE.0xEF.0xFE.0xED Net: Network init done Tftp: Init socket to port 0x0045
but I can't flash any sketches via serial or tftp :
avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer .
I can't ping the arduino too.
Dear All,
I've flashed the ariadne bootloader code into Arduino UNO + Ethernet shield.
Also able to flash the code via USB interface as usal.
But not able to flash via TFTP.
I'd setup the ethernet cable between Linux PC to Arduino UNO+Shield, and able to see the activity on ethernet port LEDs.
And I set up address for PC as 192.168.1.125 and default IP address for Arduino UNO+Shield 192.168.1.128
Not able to ping the IP address 192.168.1.128 from PC and thus got TFTP timedout error when I tried to transfer the binary files. Tried using Linux and Windows PCs
Can anyone please help me on this problem ?
Regards,
Titus S.
the code below seem wrong to me.
ARIADNE_SIGPOS which is the same as EEPROM_IMG_STAT from neteeprom.h, use as status, if the image uploaded by the booloader is OK or not.
While in the below code, it look like it is used as if the ARIADNE boolader itself is been used... in the system, and if not use all the EEPROM (start from offset 0).
byw: the ARIADNE_OFFSET also seem not right. in neteeprom.h, last used eeprom address is 63.
NewEEPROM.h:
#define ARIADNE_SIGPOS (0x02)
#define ARIADNE_SIGVAL (0xEE)
#define ARIADNE_OFFSET (0x40)
#define NO_OFFSET (0x00)
NewEEPROM.cpp:
NewEEPROMClass::NewEEPROMClass(void)
{
if(read(ARIADNE_SIGPOS, 0) == ARIADNE_SIGVAL) _offset = ARIADNE_OFFSET;
else _offset = NO_OFFSET;
}
From @elik745i on March 30, 2017 14:22
I'm getting endless reset after watchdog resets arduino (in the sketch I set it to 8sec as sketch is too big and it gets hangups time to time), and it does not stop even if I press reset button, only if I reflash the sketch. Is thwere any solution for that?
Copied from original issue: codebndr#39
** Sorry in advance for the code blocks with no newlines, I can't seem to get them formatted properly..? **
Hey there,
First off, everyone who has worked with this in the past, big Thanks! :) Also to loathingKernel for your wonderful continuation!
I'm having a look at this bootloader as I would like to use it for programming a couple of units in a remote location.. Which this bootloader should be able to do, which is great :)
However, I'm having a few problems.
Which software are you using for editing and uploading the bootloader to the target?
I've tried Arduino 1.8.3 which seems to be a no go. I've tried to put the "hardware" and "libraries" both under /arduino/ and also in the /arduino path, but also in the "C:/program.../arduino" path but I just get errors that the board.txt file can't be read and similar. I can of course provide more errors when I'm told exactly where the files should be put, but as of right now, when I follow the Readme file, it just doesn't work.
I've also tried Atmel Studio 7 which can compile the code, create an HEX file and upload it to the target. However, I still can't ping the device either on the default IP which ends in .128 or the IP I've set which should be .33
I've edited the net.h file with my network settings, like the following;
/ Network settings /
#define IP_ADDR 192,168,1,33
#define SUB_MASK 255,255,255,0
#define GW_ADDR 192,168,1,1
#define MAC_ADDR 0x55,0xD7,0x53,0x00,0x01,0x0B
But, I can't ping the device on this address. The Gateway address I suppose should be the real network gateway, such as the router, correct?
Also, how do I enable debugging in the source code, so that it outputs data to the Serial port, just like the "ariadne_debug2560_w5100.hex" file does when it is uploaded?
When I upload the bootloader file "ariadne_debug2560_w5100.hex" I do get debug output and the IP address is set to 192.168.1.128 - which by the way is matching my network and it is a free IP. I still can't ping the device though.
The device I'm using is actually an Controllino Maxi. This device is based off the Atmega2560 with a WizNet 5100 chip. The following are the pin connections which is hardwired and can't be changed in any way.
Arduino 52 / PB1 - WizNet SCK
Arduino 51 / PB2 - WizNet MOSI
Arduino 50 / PB3 - WizNet MISO
Arduino xx / PJ3 - WizNet SS/CS
I've thought that maybe the PJ3 should be configured in the spi.h file as the chipselect, but not sure if that does anything? I've tried changing both #define SS and #define ETH_SS to PINJ3, but no change in response from the unit on the network.
Something I've noticed is that the PINB7, defined as LED in spi.h, the led is not flashing or blinking, just solid on.
Also, I don't see any traffic on WireShark that could be the bootloader. But I guess thats only when inbound traffic is active. The bootloader isn't transmitting anything without an incomming call, right?
Pinout for the Controllino, Ethernet chip just right of center on the pinout sheet, below SD card connector..
http://controllino.biz/wp-content/uploads/2017/05/CONTROLLINO-MAXI-Pinout.pdf
I think that is all for the moment, would it possible to help me out in any way? :)
Edit..
If I run the debug version of the hex file "ariadne_debug2560_w5100.hex" available within the Git download I get the following output on the serial line;
Main: Ariadne for Arduino Mega2560, Version 0.5
Net: Built-in settings
Net: Address: 0xC0.0xA8.0x01.0x80
Net: Subnet: 0xFF.0xFF.0xFF.0x00
Net: Gateway: 0xC0.0xA8.0x01.0xFE
Net: MAC: 0xDE.0xAD.0xBE.0xEF.0xFE.0xED
Net: Network init done
Tftp: Init socket to port 0x0045
Many thanks in advance!
// Christopher
From @flintec on October 21, 2016 8:24
i get a error from the arduino when im flashing using the tftp client take a look at this.
this is the output fom the serial port.
ˆC¡*¥¹é Ariadne for Arduino Uno, Version 0.5
Net: EEPROM settings
Net: Address: 0xC0.0xA8.0x01.0x78
Net: Subnet: 0xFF.0xFF.0xFF.0x00
Net: Gateway: 0xC0.0xA8.0x01.0x01
Net: MAC: 0x12.0x34.0x56.0x78.0x9A.0xBC
Net: Network init done
Tftp: Init socket to port 0x0045
Tftp: TFTP server init done
Tftp: DataPort: 0xB779
Tftp: Processing packet of size 0x001E
Tftp: Set up return address
Tftp: This is block 0x426C with opcode 0x0002 and data length 0x0012
Tftp: Write request
Tftp: Init socket to port 0xB779
Tftp: Changed to port 0xB779
Tftp: Sent ACK
Tftp: Response sent
Tftp: Init socket to port 0x0045
Tftp: TFTP server init done
Tftp: DataPort: 0xB779
Tftp: Processing packet of size 0x001E
Tftp: Set up return address
Tftp: This is block 0x426C with opcode 0x0002 and data length 0x0012
Tftp: Write request
Tftp: Init socket to port 0xB779
Tftp: Changed to port 0xB779
Tftp: Sent ACK
Tftp: Response sent
Tftp: Init socket to port 0x0045
Tftp: TFTP server init done
Tftp: DataPort: 0xB779
Tftp: Processing packet of size 0x001F
Tftp: Set up return address
Tftp: This is block 0x0000 with opcode 0x0005 and data length 0x0013
Tftp: Error
Tftp: Response sent
Tftp: Processing packet of size 0x8613
Tftp: Overflow
Tftp: Set up return address
Tftp: This is block 0x979A with opcode 0x6D2C and data length 0xBCD4
Tftp: Invalid opcode 0x0000
Tftp: Init socket to port 0xB779
Tftp: Response sent
Tftp: Init socket to port 0x0045
Tftp: TFTP server init done
Tftp: DataPort: 0xB779
any ideas?
Copied from original issue: codebndr#35
Greetings;
I don't know how to contact the author to ask a question:
Before I go flashing stuff, will this bootloader still work the regular way on my ArduinoIDE, so I can work on a duplicate board to finetune my programs?
Cheers;
Hello,
I am trying to reset my device using the watchdog to enter the bootloader, the device resets, however, after the reset, the appication code is loaded, instead of the bootloader.
As per Atmel datasheet, if BOOTRST is programmed, then the code loaded after both WDT reset and external reset should be the bootloader.
When I set the reset pin to low instead of doing a WDT reset, then the bootloader is loaded before the application.
I have loaded the bootloader properly and the BOOTRST fuse is programmed, see the output below
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/developer/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : stk500v2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 111010262908
AVR Part : ATmega2560
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : STK500V2
Description : Atmel STK500 Version 2.x firmware
Programmer Model: AVRISP mkII
Hardware Version: 0
Firmware Version Master : 1.41
Vtarget : 3.3 V
SCK period : 8.00 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "iplace_controller_boot.hex"
avrdude: writing flash (257926 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 257926 bytes of flash written
avrdude: verifying flash memory against iplace_controller_boot.hex:
avrdude: load data flash data from input file iplace_controller_boot.hex:
avrdude: input file iplace_controller_boot.hex contains 257926 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 257926 bytes of flash verified
avrdude: reading input file "0x0F"
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0F:
avrdude: load data lock data from input file 0x0F:
avrdude: input file 0x0F contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)
avrdude done. Thank you.
And this is the code I am using to trigger a WDT reset:
NetEEPROM.writeImgBad();
wdt_disable();
wdt_enable(WDTO_120MS);
while(1);
Thanks for your help
Hello!
There was a problem with the firmware over the network through NAT. The TFTP server generates random ports during data transfer and there is no way to forward them. Is it possible to make a port permanent?
From @loathingKernel on November 6, 2012 12:59
Since most ethernet shields have an SD card socket this might would be useful to have.
I am just leaving it here to see how many people are interested in having this feature integrated to
Ariadne.
It has been done before so, probably, i will be using the existing solution if it fits nicely with the rest of the code.
Copied from original issue: codebndr#3
From @elik745i on March 24, 2017 15:46
EEPROM.put and get requests does not work with newEEPROM library, can anyone fix it? or suggest the way forward...
Copied from original issue: codebndr#38
I managed to get this bootloader installed but the reset server example sketch does not seem to work. I get no webpage served on port 80 (by typing in just the IP in the browser) which according to the sketch should serve sensor values.
The reset servers seems to respond at IP:8080/password/reset and I can then upload a sketch. So at least part of it works.
Also, how would I go about including the reset server function in a normal sketch? Do I need to include all the code in the ResetServer example (all #includes and the reset.check() in the main loop)?
Eventually I'd like to use an external watchdog timer to perform resets as well. Is this compatible with the bootloader?
On a seperate note, uploading a sketch.bin of the same name does not seem to work. e.g. if the server is running blink.bin, I cannot simply change the blink frequency in the code, recompile and upload with "tftp> put blink.bin"
If I rename blink.bin to blink5.bin and use "put blink5.bin" the code is accepted by the bootloader.
README.md says:
Now to actually upload the binary file all you have to do is reset the board and in the next 5 seconds run the following command.
but the bootloader timeout is actually 20 seconds. Was it intentional to make the bootloader timeout so long? 20 seconds seems a bit longer than necessary.
Hi, I have mega2560 + W5100 ethernet shield.
And I testing some sketches for personal project.
After I burning your bootloader throug Arduino ISP my mega+w5100 cant connetct to my network.
I'v setted correct IP and gateway trugh WriteNetworkSettings sketch, and verifing it with ReadNetworkSettings .
There is the output of this sketch
--- Network Settings ---
MAC: 0x0.0xAA.0xBB.0xCC.0xDE.0x2
Address: 192.168.31.135
Gateway: 192.168.31.1
Subnet: 255.255.255.0
--- Tftp Settings ---
Data Port: 46969
(Default)
--- Reset Server Settings ---
Password: 123123123
Length: 9
(all is correct, 192.168.31.1 is my gateway(router))
there is testing sketch that also dont want to connect to lan
//zoomkat 2-13-12
//DNS and DHCP-based web client test code
//for use with IDE 1.0
//open serial monitor and send an e to test
//and to see test result
//for use with W5100 based ethernet shields
//browser equivelant URL:
// http://web.comporium.net/~shb/arduino.txt
//note that the below bug fix may be required
// http://code.google.com/p/arduino/issues/detail?id=605
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
char serverName[] = "web.comporium.net"; // zoomkat's test web page server
EthernetClient client;
//////////////////////
void setup(){
Serial.begin(9600);
Serial.println("DNS and DHCP-based web client test 2/13/12"); // so I can keep track of what is loaded
Serial.println("Send an e in serial monitor to test"); // what to do to test
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
// print your local IP address:
Serial.print("Arduino IP address: ");
for (byte thisByte = 0; thisByte < 4; thisByte++) {
// print the value of each byte of the IP address:
Serial.print(Ethernet.localIP()[thisByte], DEC);
Serial.print(".");
}
Serial.println();
Serial.println();
}
void loop(){
// check for serial input
if (Serial.available() > 0) //if something in serial buffer
{
byte inChar; // sets inChar as a byte
inChar = Serial.read(); //gets byte from buffer
if(inChar == 'e') // checks to see byte is an e
{
sendGET(); // call sendGET function below when byte is an e
}
}
}
//////////////////////////
void sendGET() //client function to send/receive GET request data.
{
if (client.connect(serverName, 80)) { //starts client connection, checks for connection
Serial.println("connected");
client.println("GET /~shb/arduino.txt HTTP/1.0"); //download text
client.println(); //end of get request
}
else {
Serial.println("connection failed"); //error message if no client connect
Serial.println();
}
while(client.connected() && !client.available()) delay(1); //waits for data
while (client.connected() || client.available()) { //connected or data available
char c = client.read(); //gets byte from ethernet buffer
Serial.print(c); //prints byte to serial monitor
}
Serial.println();
Serial.println("disconnecting.");
Serial.println("==================");
Serial.println();
client.stop(); //stop client
}
How can I fix problem or restore previous condition of mega and w5100 ? Thank you, sory for my english
P.S.
I'v tried connect my w5100 to another board, arduino uno with same scetch. And that not work to, send me same "Failed to configure Ethernet using DHCP".
From @DarkSector on July 11, 2015 19:41
Can we get support for ENC28J60 ethernet chip? This project is a very cool way to push sketches. How can we use it on 28j60 instead of W5100?
Copied from original issue: codebndr#21
From @whitesn on August 18, 2016 6:26
Hello, so I am able to burn the bootloader and upload the "ReadNetworkSettings" sketch using Serial USB Comm.
I am also able to ping the default IP when the Arduino is powered and connected (192.168.1.128)
Then I tried to upload the sample "blink" ( utilities\tests\blink\atmega328_blink9.bin ) by resetting the Arduino Board (LED13 now blinks quickly), then type "tftp -i 192.168.1.128 PUT atmega328_blink9.bin" (I already cd'd to the folder). After some times, it says "Connect request failed".
Previously, after uploading the sample "ReadNetworkSetting", the Arduino will be able to run the sketch after about 10 seconds after reset (the upload period).
But if I did attempt to TFTP the sketch (atmega328_blink9.bin), my Arduino is now not able to load the previous sketch and will keep blinking quickly (even after resetting, and waiting for 10 seconds). The previously uploaded sketch is now gone, but I am still able to upload sketches via serial. What should I do?.. (Windows 10 64bit, Arduino 1.6.7)
Copied from original issue: codebndr#34
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.