Welcome! Log In Create A New Profile

Advanced

Sanguinololu with at1284p

Posted by joaoabs 
Sanguinololu with at1284p
June 21, 2016 09:07AM
Hello,

I'm struggling with this one for a couple of days, and decided to come here and ask for some tips...

I'm trying to upload a Marlin firmware to a sanguinololu but without success...

I'm working with both a raspberry PI3 (arduino for ARM) and a normal PC with Linux LXLE (64-bit Ubuntu based) and the results are the same. I've also tried different AT1284p chips, just to cover the remote possibility that the new one is damaged.

What I've done so far:
  • Bought new AT1284p chip
  • Installed it in the sanguinololu board
  • With the great tips from [dustsreprap.blogspot.pt] I was able to install sanguino in the arduino IDE 1.6.9 (actually based on [github.com])
  • With an arduino UNO acting as ISP, burned the bootloader to the AT1284p
  • To test it, uploaded an example sketch (examples/communications/ASCII table) with the "normal" programer - AVRISP mkll. Everything goes fine.
  • Success, with the Serial Monitor I can see the ascii table "arriving"
  • Then, with the exact same board options, I compile and try to upload the Marlin Firmware to it, and it gets stuck between 4% and 40%. The most common error is "avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62"

What can I be doing wrong??

Thanks, Joao Silva


root@nostromo:~# /home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/bin/avrdude -C/home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/etc/avrdude.conf -v -patmega1284p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:/tmp/build7541ecec97c971a10b8d6f10b8688134.tmp/Marlin.ino.hex:i 

    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 19:04:16
     Copyright (c) 2000-2005 Brian Dean, [www.bdmicro.com]
     Copyright (c) 2007-2009 Joerg Wunsch

     System wide configuration file is "/home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/etc/avrdude.conf"
     User configuration file is "/root/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/ttyUSB0
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200
     AVR Part                      : ATmega1284P
     Chip Erase delay              : 55000 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   128    0 no       4096    8      0  9000  9000 0xff 0xff
       flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
       lock           0     0     0    0 no          1    0      0  9000  9000 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
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

     Programmer Type : Arduino
     Description     : Arduino
     Hardware Version: 3
     Firmware Version: 5.0
     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 = 0x1e9705
    avrdude: safemode: lfuse reads as 0
    avrdude: safemode: hfuse reads as 0
    avrdude: safemode: efuse reads as 0
    avrdude: reading input file "/tmp/build7541ecec97c971a10b8d6f10b8688134.tmp/Marlin.ino.hex"
    avrdude: writing flash (98234 bytes):

    Writing | ##                                                 | 4% 0.46s
    avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
    Writing | ###                                                | 5%    0.55savrdude: stk500_recv(): programmer is not responding
Re: Sanguinololu with at1284p
June 21, 2016 10:05AM
Answering my own question as I kept trying until I got it smiling smiley

With an arduino UNO acting as ISP, I burned again the bootloader to the AT1284p. I configured the arduino IDE to be verbose in the upload (file / preferences / "show verbose output during" - tick upload).

I then copied the burn bootloader command that was (YMMV):

/home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/bin/avrdude -C/home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:/root/.arduino15/packages/Sanguino/hardware/avr/1.0.0/bootloaders/optiboot/optiboot_atmega1284p.hex:i -Ulock:w:0x0F:m

This command doesn't mention any fuses, so considering the burn fuses command from [reprap.org],

avrdude -p atmega1284p -c stk500v1 -b 19200 -V -e -U lfuse:w:0xD6:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m -U flash:w:ATmegaBOOT_168_atmega1284p.hex:i

I merged both commands, by adding the fuse flags to the initial command, resulting it in (ran it from the command line):

/home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/bin/avrdude -C/home/jabss/Desktop/arduino-1.6.9/hardware/tools/avr/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:/root/.arduino15/packages/Sanguino/hardware/avr/1.0.0/bootloaders/optiboot/optiboot_atmega1284p.hex:i -Ulock:w:0x0F:m -V -e -U lfuse:w:0xD6:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m

I'm now able to upload a complete Marlin Firmware with no problem.

Now the question is if the fuses from [reprap.org] are correct, (LF=D6 / HF=DA / EF=FD) as it seems people from this forum are reporting to be using different ones.

Hope this helps people in the same situation as myself.

Cheers,
Joao
Sorry, only registered users may post in this forum.

Click here to login