Go Down

Topic: 57600 optiboot problem (Read 2169 times) previous topic - next topic

darlin

Hi,
Lately, I have connected serial radio link to the arduino uno. This radio serial is working 57600 and is working fine for remote control of the sketch. Now, I would like to make next steeps and enable send of the skech by radio link. I googled a a lite bit  and find out that uno bootloader is working 115200 so the decrease the '-BAUD_RATE of the bootloader should be helped. Also, I read that the best places of the speed changes is Makefile.
So I set in Makefile:


Quote
atmega328_pro8: TARGET = atmega328_pro_8MHz
atmega328_pro8: MCU_TARGET = atmega328p
atmega328_pro8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=57600'
atmega328_pro8: AVR_FREQ = 8000000L
atmega328_pro8: LDSECTION  = --section-start=.text=0x7e00
atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.hex
atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.lst

atmega328_pro8_isp: atmega328_pro8
atmega328_pro8_isp: TARGET = atmega328_pro_8MHz
atmega328_pro8_isp: MCU_TARGET = atmega328p
atmega328_pro8_isp: HFUSE = DE # 512 byte boot
atmega328_pro8_isp: LFUSE = FF # Low power xtal (16MHz) 16KCK/14CK+65ms
atmega328_pro8_isp: EFUSE = 05 # 2.7V brownout
atmega328_pro8_isp: isp



Set in board.txt:
Quote
uno.name=Arduino Uno
uno.upload.protocol=stk500
uno.upload.maximum_size=32256
uno.upload.speed=57600
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino


and made omake in the optiboot directory
Quote
F:\2_Darek\robot\arduino-0022\hardware\arduino\bootloaders\optiboot>..\..\..\tools\avr\utils\bin\make OS=windows ENV=ard
uino atmega328
../../../tools/avr/bin/avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-calls -mmcu=atmega
328p -DF_CPU=16000000L  '-DLED_START_FLASHES=3' '-DBAUD_RATE=57600'   -c -o optiboot.o optiboot.c
../../../tools/avr/bin/avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-calls -mmcu=atmega
328p -DF_CPU=16000000L  '-DLED_START_FLASHES=3' '-DBAUD_RATE=57600' -Wl,--section-start=.text=0x7e00 -Wl,--section-start
=.version=0x7ffe -Wl,--relax -Wl,--gc-sections -nostartfiles -nostdlib -o optiboot_atmega328_2.elf optiboot.o
../../../tools/avr/bin/avr-size optiboot_atmega328_2.elf
  text    data     bss     dec     hex filename
   500       0       0     500     1f4 optiboot_atmega328_2.elf
../../../tools/avr/bin/avr-objcopy -j .text -j .data -j .version --set-section-flags .version=alloc,load -O ihex optiboo
t_atmega328_2.elf optiboot_atmega328_2.hex
..\..\..\tools\avr\bin\avr-objdump -h -S optiboot_atmega328_2.elf > optiboot_atmega328_2.lst
rm optiboot.o optiboot_atmega328_2.elf



Quote
after that I prepared arduino ISP related to the  article. This working fine, and I haven't to added any reset resistor.

All I checked by recopiling bootloader for the same parameters and is working.

But when I decrease speed on the Makefile to the  '-DBAUD_RATE=57600'  and recompile, I can't send any skech to the arduino. I received:




darlin

Quote

Binary sketch size: 1018 bytes (of a 32256 byte maximum)
F:\2_Darek\robot\arduino-0022\hardware/tools/avr/bin/avrdude -CF:\2_Darek\robot\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P\\.\COM7 -b57600 -D -Uflash:w:C:\DOCUME~1\Jula\USTAWI~1\Temp\build7637095556676527949.tmp\Blink.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/  Pole? znajomym

        System wide configuration file is "F:\2_Darek\robot\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

        Using Port            : \\.\COM7
        Using Programmer      : stk500v1
        Overriding Baud Rate  : 57600
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: Recv:
        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     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

        Programmer Type : STK500
        Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
        Hardware Version: 3
        Firmware Version: 4.4368076
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [86]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [87]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [89]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
        Vtarget         : 200922638.8 V
        Varef           : 229372.8 V
        Oscillator      : 1.608 Hz
        SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00]   [20]
avrdude: Recv:
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x42
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.

avrdude: Send: Q [51]   [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done.  Thank you.




Where the worrying annouced is:
Vtarget         : 200922638.8 V
        Varef           : 229372.8 V
        Oscillator      : 1.608 Hz
        SCK period      : 0.1 us


Whats wrong I do it?

I used IDE arduino-0022 and optiboot 4.4.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy