Welcome! Log In Create A New Profile

Advanced

Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P

Posted by wickedweed73 
Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 22, 2013 06:09AM
Hi. I've just built the ver 1.5 and I'm trying to upload the Teacup firmware onto the atmega1284P and facing difficulties in uploading the firmware.

Here is what I did:

1) Used an Arduino Duemilanove (atmega328P) as Arduino ISP and burn the bootloader onto my 1284P following instructions here:
[reprap.org]

2) Configured the MCP2200 to have the blinking LEDs using the Microchip configuration utility

3) powered the Gen 7 v1.5 board connected via USB to my windows PC

4) open Teacup_Fimrware.pde in Arduino IDE (v.1.0.4), compiled then clicked on upload

5) somewhere about 80-90% on the progress bar on arduino IDE, I can see the green LED (nearest to the limit switch sockets) blink once every few seconds. The one on the right remains off throughout. Then the progress bar just stays there for the longest time and at the end, I will get these messages:

"avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: ser_send(): write error: sorry no info avail "

Is there anything that I did wrong? I've checked the traces and joints on my board and there is no problems at all. This is my first time trying to program anything atmega/arduino so I am a bit lost.
Your help is very much appreciated! THANKS!
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 23, 2013 12:14AM
Do I have to use a 20mhz crystal when breadboarding to use arduino isp to upload the sanguino bootloader?
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 23, 2013 06:31AM
Quote

5) somewhere about 80-90% on the progress bar on arduino IDE, I can see the green LED (nearest to the limit switch sockets) blink once every few seconds. The one on the right remains off throughout. Then the progress bar just stays there for the longest time and at the end, I will get these messages:

"avrdude: stk500v2_ReceiveMessage(): timeout

Timeout means, there's no communications happening at all. Possible reasons: wrong baud rate, 16 MHz bootloader while running at 20 MHz, no auto-reset, etc.

Quote

Do I have to use a 20mhz crystal when breadboarding to use arduino isp to upload the sanguino bootloader?

Not neccessarily. You can upload a 20 MHz bootloader while running at 16 or even 1 MHz. A bootloader compiled for 16 MHz won't work on an ATmega running at 20 MHz, though. Make sure you grab the right binary/.hex file.

I'm wondering why so many tutorials breadboard the ATmega. Gen7 as well as Sanguinololu and original Arduino all have an ISP connector (6 pins), so you can upload a bootloader there.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 23, 2013 07:25AM
I have the exact same problem. I did use the 20Mhz crystal and uploaded the Gen7 bootloader, but I get the same result.
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 23, 2013 05:03PM
Today I tried to upload the firmware with a programmer. This worked, but I can't connect to the firmware via ReplicatorG. So I guess this actually didn't work too.
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 23, 2013 06:50PM
What I did was to use the Sanguino bootloader, added the following to the boards.txt file and burn the bootloader. What should the baud rate be for uploading the Teacup firmware via USB connection on the Gen 7 board at 20MHZ?

##############################################################

atmega1284p-pu.name=Sanguino W/ ATmega1284p 20mhz

atmega1284p-pu.upload.protocol=stk500
atmega1284p-pu.upload.maximum_size=131072
atmega1284p-pu.upload.speed=57600

atmega1284p-pu.bootloader.low_fuses=0xD6
atmega1284p-pu.bootloader.high_fuses=0xDC
atmega1284p-pu.bootloader.extended_fuses=0xFD
atmega1284p-pu.bootloader.path=atmega
atmega1284p-pu.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
atmega1284p-pu.bootloader.unlock_bits=0x3F
atmega1284p-pu.bootloader.lock_bits=0x0F

atmega1284p-pu.build.mcu=atmega1284p
atmega1284p-pu.build.f_cpu=20000000L
atmega1284p-pu.build.core=arduino
atmega1284p-pu.build.variant=standard

I think I'm just gonna set the Arduino as a ISP Programmer and flash the Gen7 bootloader into the 1284P via the 6 pin ISP connection or do I buy a programmer?
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 23, 2013 07:07PM
115200 baud

Yes, using the arduino as ISP is what I did. but again,
no luck. Is there a way to test if the bootloader works correctly? From the fact that I cant upload a
firmware, I'd say it doesnt work, but I dont know, Im stuck.
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 24, 2013 03:16AM
Traumflug, could you make a guess where we could look for the mistake? I'm an experienced Arduino programmer, and not knowing where to look is horrible winking smiley

A short summary:

I uploaded the bootloader via Arduino ISP and got a successfull message. Is there a way I could check this really worked?

I can not upload anything via USB. I let Arduino show me the live communication while uploading, and I would say that it actually does work in the beginning, but the Gen7 board loses interest after a few seconds. Always the first time after a bootloader installation, the Rx/Tx LEDs flash like it does on an Arduino while uploading, but only the first time. After that, I get only a flash every other second. I always have to kill avrdude.exe, because Arduino can't kill it itself.

I tried uploading the firmware via the programmer (the Arduino IDE offers this feature). According to the software, this was also successfull. Unfortunately, I cant connect with repetierHost and ReplicatorG. ReplicatorG gives me a timeout warning. repetierHost is very strange:If I hit power, nothing happens. If I hit the button to move Y for 1mm, the PSU powers up and everything. I also have temperature measurementes (between 22 and 26 degrees), and if I hold the hot end in my hand, the temperature rises. But this could be a huge coincidence...

I would be really happy if someone could just tell me where I could look for the mistake..

Edit: I tried the Gen7 Arduino support 2.0 as well as 2.1. Same result.
Edit2: In the meantime I checked all electrical connections related to communication. All are perfect.

Edited 2 time(s). Last edit at 04/24/2013 03:54AM by GoingForGold.
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
April 24, 2013 07:46AM
Quote

What I did was to use the Sanguino bootloader

Is there a 20 MHz version of this one? The 16 MHz version won't work on 20 MHz.

Quote

I think I'm just gonna set the Arduino as a ISP Programmer and flash the Gen7 bootloader into the 1284P via the 6 pin ISP connection

This should work.

Quote

Is there a way to test if the bootloader works correctly?

If you can upload a firmware, it works.

If it doesn't work, you can upload any other firmware, e.g. SetupTest.ino, to find out wether your ISP works. Any firmware uploaded by a programmer (or ArduinoISP) without bootloader works the same way as when uploaded via the bootloader. Arduino IDE stores the .hex file in the temporary folder (/tmp/buildXXX/ on Linux) and keeps it there for a while. Simply click "Verify" to create it.

Also, the bootloader has zero influence on firmware behaviour.

Quote

I tried uploading the firmware via the programmer (the Arduino IDE offers this feature). According to the software, this was also successfull. Unfortunately, I cant connect with repetierHost and ReplicatorG. ReplicatorG gives me a timeout warning. repetierHost is very strange:If I hit power, nothing happens. If I hit the button to move Y for 1mm, the PSU powers up and everything.

Sounds good! Turning the PSU on only when needed isn't "strange", it's a feature!

In case of communications problems, you can always connect with a serial terminal (HyperTerminal, PuTTY, GtkTerm, CoolTerm, ...) Simply hitting the enter key should be anwered with "ok", M114 should result in a position report, M115 in a firmware feature report. Type blindly or turn on "local echo".

If you can connect with a serial terminal, but not ReplicatorG, it's not a problem of the electronics or the bootloader, but a problem of the protocol between firmware and host. ReplicatorG has a history of being pretty picky about the protocol, so another host might work better. Myself, I use Pronterface.

Quote

Always the first time after a bootloader installation, the Rx/Tx LEDs flash like it does on an Arduino while uploading, but only the first time. After that, I get only a flash every other second.

Sounds like the USB driver locks up somehow. Does it help to turn off the PSU entirely (no standby, yellow LED off) and turn it back on? This resets the MCP2200 as well as the USB connection in the PC. Maybe just disconnecting the USB cable for a second helps, this resets only the driver in the PC.

Some people report you have to assign a COM port number manually on Windows OS. Some say it should be COM1...COM9, others found numbers > 10 to work better.

Hope that helps.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
May 13, 2013 08:21PM
Managed to burn the bootlader over the weekend, uploaded teacup and connect the board to replicatorG.
What I did was use an arduino duemilanve as an isp and n added the gen7 20mhz bootloader file name into the sanguino boards.txt and copied over the .hex file to the sanguino folder.
I havent bought the pololu drivers yet. Is there a way to hook up to a 2M542 driver to test since I already have it?
Re: Gen7 v1.5: Problem with Upoading Firmware onto Atmega1284P
May 14, 2013 08:26AM
Excellent?

You can hook up any stepper driver which works with Step and Dir signals at 5V.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Sorry, only registered users may post in this forum.

Click here to login