Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network reset #14

Closed
ionciubotaru opened this issue Jun 5, 2014 · 16 comments
Closed

network reset #14

ionciubotaru opened this issue Jun 5, 2014 · 16 comments

Comments

@ionciubotaru
Copy link

When I performed a network reset, without loading a new schetch, the watchdog timmer remains enabled at 2s. and the arduino is not booting again (the bootloader waits 5s. for a schetch to upload, but it does't disable watchdog timmer)

I solved this using wdt_enable(WDTO_8S) instead of wdt_enable(WDTO_2S) inside library

I hope you can fix this inside bootloader

@loathingKernel
Copy link

The bootloader disables the watchdog timer here:
https://github.com/codebendercc/Ariadne-Bootloader/blob/master/hardware/ariadne/bootloaders/ariadne/main.c#L35-L38

Disabling the watchdog timer happens at the very start of the program, so most probably nothing should be interfering with it. How old is the version of the bootloader you are using and did you compile it on your own or you used the provided binaries?

@ionciubotaru
Copy link
Author

Thank you for help.
I am using the latest bootloader. Can you send me few instructions howto compile ariadne bootloader on windows7 - I wish to try some changes.

@loathingKernel
Copy link

I have no idea how to compile it on Windows. I have never tried it myself. Try searching for instructions to install avr-gcc on windows and then the makefile might take care of the rest. You will need to change quite a few paths in the makefile too.

Can you provide me with some more information? Like what arduino you are using, what shields, etc, etc.

@ionciubotaru
Copy link
Author

Hi,
I am using a standard arduino board with a ethernet shield R3 (made in china). Sometimes it hangs on power on, sometimes on restart. I found a solution to put a pull-down rezistor on pin 10.

Can you set pin 10 as output and put it low and pin 4 as output and put it high, just at the beginning of bootloader?
Most of the ethernet shields have a SD card also and I think this is the correct setup to ensure the W1500 is the only one listening on SPI.

@ionciubotaru
Copy link
Author

Thank's for help, you did a great work.
Now I really don't know why it hangs while power on. I am using this shield: http://www.arduinostarterskit.com/china-ethernet_w5100_r3_shield_for_arduino_uno_r3_adds_section_micro_sd_card_slot-1849729.html
I have ethernet shield revision 2 and R3 from the same supplier and both have the same problem. After a succesfull boot it works fine for weeks. If you send me your address I can send you one to try

@loathingKernel
Copy link

I do not think that it is needed to send me a shield, at least not yet, most of them are following the Arduino design. I will investigate the situation once I have some time, but if you have any other information that might be useful to me, please post them here.

@ionciubotaru
Copy link
Author

thank's for help, right now It works fine with that pull-down rezistor on D10

@Whocareswhowins
Copy link

I am getting these emails, I do not know why. Of course I do not mind as it is all knowledge. However processing can only handle its own sketches is what I get when I try to use my sketches from the browser. I am now getting into Pi Raspberry.
Arduberry is the new kid on the block. The two combined is well awesome.
Liamthe1st

Sent from my iPhone

On 5 Jun 2014, at 20:55, ionciubotaru notifications@github.com wrote:

thank's for help, right now It works fine with that pull-down rezistor on D10


Reply to this email directly or view it on GitHub.

@ionciubotaru
Copy link
Author

Hi,
After hours of testing I found why the system hangs. I use some periferals on RX/TX pins. When power on they send some garbage on those pins, the bootloader interpret it as new schetch and erase the old schetch and hangs. I fixed it compiling the bootloader without serial interface (I will never program the modules over serial, only over ethernet). Now, good news, the bootloader size decrease below 2k. I modified #define NRWWSTART (0x7000) to #define NRWWSTART (0x7800) in optiboot.h and #define MAX_ADDR 0x7800 in tftp.h, but unfortunately the hex still start at 0x7000. Can you help me to free up 2k of the precious arduino eeprom?

@loathingKernel
Copy link

You have to set the correct fuses in the makefile too. This should help you calculate them, http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega328p

@ionciubotaru
Copy link
Author

Thank's
I set the fuses to "Flash boot section size=2048"
Please tell me if #define MAX_ADDR 0x7800 in tftp.h is correct or should I leave it at 0X7000?

@loathingKernel
Copy link

Well, depends. What is the size of your compiled bootloader? If it below 2kb, then you need set it to 0x7600, which leaves 0x400 or 1024 words or 2048 bytes at the end of the progmem for the bootloader.

@ionciubotaru
Copy link
Author

Yes, the size o compiled bootloader is below 2K
I check standard arduino bootloader (not optiboot) and it starts at 0x7800.
I put 0x7800 on my new bootloader and it works. Why do you wrote 0x7600?
Can I have problems with 0x7800? Sorry for so many questions.

@ionciubotaru
Copy link
Author

Hi,
The modified ariadne bootloader (without serial programming) has 2038 bytes (below 2048). Unfortunately I cannot run a schetch bigger than 28672 bytes. If I upload a smaller schetch it works fine, but a bigger one doesn't work at all. You cand download the sources from www.cometa.ro/download/ariadne.zip. Could you be so kind and help me to fix this issue. I think 2k extra will be helpfull for lots of peoples.

@loathingKernel
Copy link

I disagree with you, the ability to upload through serial is more important than the 2kb of extra space, because it enables the user to change the network configuration of the bootloader easily without the use of an ISP. Also enables easier testing without the need to change bootloader. If in your specific case that is not useful, that is a per-case situation and the 2kb extra can be freed up. If you would be so kind, please send me an email so we can continue this discussion there since it is outside the scope of a bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants