W dniu piątek, 23 stycznia 2015 11:28:54 UTC+1 użytkownik Tomas Kopal napisał:
> If you are using jtag and you are able to program the chip without
> errors, I would guess that all should be ok (given you are using the
> right parameters for flashing). ISP programming should be also OK.
> Problematic is mostly programming via bootloader and serial
> communication, then you rely on the bootloader to implement programming
> of all memories, which some do not do due to space constraints.
>
> But you are giving too little information here. Are you using JTAG for
> master? Slave? Both? What software, avrdude?
I get sources from:
https://github.com/OpenHR20/OpenHR20
I compile HR20:
# ./compile_hr20.sh
-------- begin --------
Cleaning project:
rm -f hr20.hex
rm -f hr20.eep
rm -f hr20.bin
rm -f hr20.cof
rm -f hr20.elf
rm -f hr20.map
rm -f hr20.sym
rm -f hr20.lss
rm -f hr20.txt
rm -f obj/motor.o obj/controller.o obj/watch.o obj/com.o obj/wireless.o obj/rfm.o obj/cmac.o
rm -f obj/motor.lst obj/controller.lst obj/watch.lst obj/com.lst obj/wireless.lst obj/rfm.lst obj/cmac.lst
rm -f obj/xtea-asm.o
rm -f obj/xtea-asm.lst
rm -f motor.s controller.s watch.s com.s wireless.s rfm.s cmac.s
rm -f motor.d controller.d watch.d com.d wireless.d rfm.d cmac.d
rm -f motor.i controller.i watch.i com.i wireless.i rfm.i cmac.i
rm -f obj/rtc.o obj/main.o obj/keyboard.o obj/adc.o obj/eeprom.o obj/menu.o obj/lcd.o obj/rs232_485_hw.o
rm -f obj/rtc.lst obj/main.lst obj/keyboard.lst obj/adc.lst obj/eeprom.lst obj/menu.lst obj/lcd.lst obj/rs232_485_hw.lst
rm -f rtc.s main.s keyboard.s adc.s eeprom.s menu.s lcd.s rs232_485_hw.s
rm -f rtc.d main.d keyboard.d adc.d eeprom.d menu.d lcd.d rs232_485_hw.d
rm -f rtc.i main.i keyboard.i adc.i eeprom.i menu.i lcd.i rs232_485_hw.i
rm -rf .dep
-------- end --------
-------- begin --------
avr-gcc (GCC) 4.9.2 20141224 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: motor.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/motor.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/motor.o.d motor.c -o obj/motor.o
motor.c: In function 'MOTOR_updateCalibration':
motor.c:120:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
MOTOR_ManuCalibration=-1; // automatic calibration
^
motor.c:124:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
MOTOR_ManuCalibration=0; // not calibrated
^
motor.c: In function 'MOTOR_timer_stop':
motor.c:337:21: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
if (MOTOR_ManuCalibration==0) {
^
motor.c:339:29: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
MOTOR_ManuCalibration = a;
^
Compiling C: controller.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/controller.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/controller.o.d controller.c -o obj/controller.o
Compiling C: watch.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/watch.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/watch.o.d watch.c -o obj/watch.o
Compiling C: com.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/com.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/com.o.d com.c -o obj/com.o
Compiling C: wireless.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/wireless.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/wireless.o.d wireless.c -o obj/wireless.o
Compiling C: rfm.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/rfm.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/rfm.o.d rfm.c -o obj/rfm.o
In file included from rfm.c:3:0:
../common/rfm.c: In function 'rfm_spi16':
../common/rfm.c:81:11: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
ret <<= 1;
^
Compiling C: cmac.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/cmac.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/cmac.o.d cmac.c -o obj/cmac.o
In file included from cmac.c:3:0:
../common/cmac.c: In function 'cmac_calc':
../common/cmac.c:70:18: warning: 'Kx' may be used uninitialized in this function [-Wmaybe-uninitialized]
uint8_t* Kx;
^
Assembling: xtea-asm.S
avr-gcc -c -mmcu=atmega169p -I. -x assembler-with-cpp -DF_CPU=4000000 -Wa,-adhlns=obj/xtea-asm.lst,-gstabs,--listing-cont-lines=100 xtea-asm.S -o obj/xtea-asm.o
Compiling C: rtc.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/rtc.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/rtc.o.d rtc.c -o obj/rtc.o
In file included from rtc.c:3:0:
../common/rtc.c: In function 'RTC_timer_set':
../common/rtc.c:600:19: warning: 'next' may be used uninitialized in this function [-Wmaybe-uninitialized]
OCR2A = next;
^
../common/rtc.c: In function '__vector_4':
../common/rtc.c:694:19: warning: 'next' may be used uninitialized in this function [-Wmaybe-uninitialized]
OCR2A = next;
^
Compiling C: main.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/main.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/main.o.d main.c -o obj/main.o
Compiling C: keyboard.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/keyboard.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/keyboard.o.d keyboard.c -o obj/keyboard.o
Compiling C: adc.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/adc.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/adc.o.d adc.c -o obj/adc.o
adc.c: In function 'task_ADC':
adc.c:243:26: warning: 'ad' may be used uninitialized in this function [-Wmaybe-uninitialized]
dummy_adc=ad;
^
Compiling C: eeprom.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/eeprom.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/eeprom.o.d eeprom.c -o obj/eeprom.o
Compiling C: menu.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/menu.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/menu.o.d menu.c -o obj/menu.o
menu.c: In function 'menu_view':
menu.c:613:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
if (MOTOR_ManuCalibration==-1) LCD_PrintChar(LCD_CHAR_d,2,LCD_MODE_ON);
^
menu.c: At top level:
menu.c:475:13: warning: 'clr_show3' defined but not used [-Wunused-function]
static void clr_show3(uint8_t seg1, uint8_t seg2, uint8_t seg3) {
^
Compiling C: lcd.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/lcd.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/lcd.o.d lcd.c -o obj/lcd.o
Compiling C: rs232_485_hw.c
avr-gcc -c -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/rs232_485_hw.lst -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/rs232_485_hw.o.d rs232_485_hw.c -o obj/rs232_485_hw.o
Linking: hr20.elf
avr-gcc -mmcu=atmega169p -I. -gdwarf-2 -DF_CPU=4000000UL -DRFM=1 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 -DRFM_DEVICE_ADDRESS=10 -DRFM_WIRE_MARIOJTAG=1 -DMOTOR_COMPENSATE_BATTERY=1 -DREMOTE_SETTING_ONLY=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/motor.o -std=gnu99 -ffreestanding -Wl,--relax -fdata-sections -MMD -MP -MF .dep/hr20.elf.d obj/motor.o obj/controller.o obj/watch.o obj/com.o obj/wireless.o obj/rfm.o obj/cmac.o obj/xtea-asm.o obj/rtc.o obj/main.o obj/keyboard.o obj/adc.o obj/eeprom.o obj/menu.o obj/lcd.o obj/rs232_485_hw.o --output hr20.elf -Wl,-Map=hr20.map,--cref -lm
Creating load file for Flash: hr20.hex
avr-objcopy -O ihex -R .eeprom -R .fuse hr20.elf hr20.hex
Creating load file for EEPROM: hr20.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex hr20.elf hr20.eep || exit 0
creating Binary for use with bootloader
avr-objcopy hr20.elf -S -R .eeprom -R .fuse -O binary hr20.bin
Creating Extended Listing: hr20.lss
avr-objdump -h -S -z hr20.elf > hr20.lss
rm -f hr20.txt
avr-size --mcu=atmega169p --format=avr hr20.elf >> hr20.txt
Size after:
AVR Memory Usage
----------------
Device: atmega169p
Program: 16026 bytes (97.8% Full)
(.text + .data + .bootloader)
Data: 693 bytes (67.7% Full)
(.data + .bss + .noinit)
EEPROM: 408 bytes (79.7% Full)
(.eeprom)
-------- end --------
Compile a master and I get errors:
# ./compile_arduino.sh
-------- begin --------
Cleaning project:
rm -f master.hex
rm -f master.eep
rm -f master.bin
rm -f master.cof
rm -f master.elf
rm -f master.map
rm -f master.sym
rm -f master.lss
rm -f master.txt
rm -f obj/main.o obj/rs232_485_hw.o obj/com.o obj/rfm.o obj/rtc.o obj/cmac.o obj/eeprom.o obj/wireless.o obj/queue.o
rm -f obj/main.lst obj/rs232_485_hw.lst obj/com.lst obj/rfm.lst obj/rtc.lst obj/cmac.lst obj/eeprom.lst obj/wireless.lst obj/queue.lst
rm -f obj/xtea-asm.o
rm -f obj/xtea-asm.lst
rm -f main.s rs232_485_hw.s com.s rfm.s rtc.s cmac.s eeprom.s wireless.s queue.s
rm -f main.d rs232_485_hw.d com.d rfm.d rtc.d cmac.d eeprom.d wireless.d queue.d
rm -f main.i rs232_485_hw.i com.i rfm.i rtc.i cmac.i eeprom.i wireless.i queue.i
rm -rf .dep
-------- end --------
-------- begin --------
avr-gcc (GCC) 4.9.2 20141224 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: main.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=10000000UL -DNANODE=0 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/main.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/main.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 main.c -o obj/main.o
main.c:70:2: warning: #warning task variable manipulation is not protected to interrupt, fix it [-Wcpp]
#warning task variable manipulation is not protected to interrupt, fix it
^
In file included from eeprom.h:40:0,
from main.c:50:
main.c: In function 'main':
rfm_config.h:133:34: error: 'GICR' undeclared (first use in this function)
#define RFM_INT_EN_NOCALL() (GICR |= _BV(INT2))
^
rfm_config.h:137:23: note: in expansion of macro 'RFM_INT_EN_NOCALL'
#define RFM_INT_EN() (RFM_INT_EN_NOCALL(), RFM_INT_vect())
^
main.c:92:5: note: in expansion of macro 'RFM_INT_EN'
RFM_INT_EN();
^
rfm_config.h:133:34: note: each undeclared identifier is reported only once for each function it appears in
#define RFM_INT_EN_NOCALL() (GICR |= _BV(INT2))
^
rfm_config.h:137:23: note: in expansion of macro 'RFM_INT_EN_NOCALL'
#define RFM_INT_EN() (RFM_INT_EN_NOCALL(), RFM_INT_vect())
^
main.c:92:5: note: in expansion of macro 'RFM_INT_EN'
RFM_INT_EN();
^
In file included from /usr/avr/include/avr/io.h:99:0,
from main.c:37:
rfm_config.h:133:46: error: 'INT2' undeclared (first use in this function)
#define RFM_INT_EN_NOCALL() (GICR |= _BV(INT2))
^
rfm_config.h:137:23: note: in expansion of macro 'RFM_INT_EN_NOCALL'
#define RFM_INT_EN() (RFM_INT_EN_NOCALL(), RFM_INT_vect())
^
main.c:92:5: note: in expansion of macro 'RFM_INT_EN'
RFM_INT_EN();
^
In file included from eeprom.h:40:0,
from main.c:50:
rfm_config.h:137:42: warning: left-hand operand of comma expression has no effect [-Wunused-value]
#define RFM_INT_EN() (RFM_INT_EN_NOCALL(), RFM_INT_vect())
^
main.c:92:5: note: in expansion of macro 'RFM_INT_EN'
RFM_INT_EN();
^
main.c: In function 'init':
main.c:257:2: error: 'DDRA' undeclared (first use in this function)
DDRA = _BV(PA2); //Green LED for Sync
^
In file included from /usr/avr/include/avr/io.h:99:0,
from main.c:37:
main.c:257:13: error: 'PA2' undeclared (first use in this function)
DDRA = _BV(PA2); //Green LED for Sync
^
main.c:261:5: error: 'PORTA' undeclared (first use in this function)
PORTA = 0xff;
^
main.c:289:7: error: 'MCUCSR' undeclared (first use in this function)
MCUCSR |= _BV(ISC2); // rising edge interrupt
^
In file included from /usr/avr/include/avr/io.h:99:0,
from main.c:37:
main.c:289:21: error: 'ISC2' undeclared (first use in this function)
MCUCSR |= _BV(ISC2); // rising edge interrupt
^
Makefile:606: polecenia dla obiektu 'obj/main.o' nie powiodły się
make: *** [obj/main.o] Błąd 1
I append "nanode=1" at the beginning of "Makefile"
# ./compile_arduino.sh
-------- begin --------
Cleaning project:
rm -f master.hex
rm -f master.eep
rm -f master.bin
rm -f master.cof
rm -f master.elf
rm -f master.map
rm -f master.sym
rm -f master.lss
rm -f master.txt
rm -f obj/main.o obj/rs232_485_hw.o obj/com.o obj/rfm.o obj/rtc.o obj/cmac.o obj/eeprom.o obj/wireless.o obj/queue.o
rm -f obj/main.lst obj/rs232_485_hw.lst obj/com.lst obj/rfm.lst obj/rtc.lst obj/cmac.lst obj/eeprom.lst obj/wireless.lst obj/queue.lst
rm -f obj/xtea-asm.o
rm -f obj/xtea-asm.lst
rm -f main.s rs232_485_hw.s com.s rfm.s rtc.s cmac.s eeprom.s wireless.s queue.s
rm -f main.d rs232_485_hw.d com.d rfm.d rtc.d cmac.d eeprom.d wireless.d queue.d
rm -f main.i rs232_485_hw.i com.i rfm.i rtc.i cmac.i eeprom.i wireless.i queue.i
rm -rf .dep
-------- end --------
-------- begin --------
avr-gcc (GCC) 4.9.2 20141224 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling C: main.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/main.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/main.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 main.c -o obj/main.o
main.c:70:2: warning: #warning task variable manipulation is not protected to interrupt, fix it [-Wcpp]
#warning task variable manipulation is not protected to interrupt, fix it
^
Compiling C: rs232_485_hw.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/rs232_485_hw.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/rs232_485_hw.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 rs232_485_hw.c -o obj/rs232_485_hw.o
Compiling C: com.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/com.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/com.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 com.c -o obj/com.o
Compiling C: rfm.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/rfm.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/rfm.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 rfm.c -o obj/rfm.o
In file included from ../common/rfm.c:39:0,
from rfm.c:3:
../common/rfm.c: In function '__vector_2':
../common/../common/rfm.h:320:55: warning: value computed is not used [-Wunused-value]
#define RFM_READ_FIFO() (RFM_SPI_16(0xB000) & 0xFF)
^
../common/rfm.c:278:13: note: in expansion of macro 'RFM_READ_FIFO'
RFM_READ_FIFO();
^
In file included from rfm.c:3:0:
../common/rfm.c: In function 'rfm_spi16':
../common/rfm.c:81:11: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
ret <<= 1;
^
Compiling C: rtc.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/rtc.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/rtc.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 rtc.c -o obj/rtc.o
In file included from rtc.c:3:0:
../common/rtc.c: In function 'RTC_timer_set':
../common/rtc.c:596:26: warning: 'next' may be used uninitialized in this function [-Wmaybe-uninitialized]
RTC_next_compare = next;
^
../common/rtc.c: In function '__vector_11':
../common/rtc.c:734:30: warning: 'next' may be used uninitialized in this function [-Wmaybe-uninitialized]
RTC_next_compare = next;
^
Compiling C: cmac.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/cmac.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/cmac.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 cmac.c -o obj/cmac.o
In file included from cmac.c:3:0:
../common/cmac.c: In function 'cmac_calc':
../common/cmac.c:70:18: warning: 'Kx' may be used uninitialized in this function [-Wmaybe-uninitialized]
uint8_t* Kx;
^
Compiling C: eeprom.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/eeprom.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/eeprom.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 eeprom.c -o obj/eeprom.o
Compiling C: wireless.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/wireless.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/wireless.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 wireless.c -o obj/wireless.o
Compiling C: queue.c
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/queue.lst -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/queue.o.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 queue.c -o obj/queue.o
Assembling: xtea-asm.S
avr-gcc -c -mmcu=atmega328p -I. -x assembler-with-cpp -DF_CPU=16000000 -Wa,-adhlns=obj/xtea-asm.lst,-gstabs,--listing-cont-lines=100 -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 xtea-asm.S -o obj/xtea-asm.o
Linking: master.elf
avr-gcc -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -DNANODE=1 -DJEENODE=0 -Os -mcall-prologues -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=obj/main.o -std=gnu99 -ffreestanding -fdata-sections -Wundef -MMD -MP -MF .dep/master.elf.d -DMCU=atmega328p -DATMEGA32_DEV_BOARD=0 -DRFM_TUNING=1 -DRFM_FREQ=868 -DRFM_BAUD_RATE=9600 -DSECURITY_KEY_0=0x01 -DSECURITY_KEY_1=0x23 -DSECURITY_KEY_2=0x45 -DSECURITY_KEY_3=0x67 -DSECURITY_KEY_4=0x89 -DSECURITY_KEY_5=0x01 -DSECURITY_KEY_6=0x23 -DSECURITY_KEY_7=0x45 obj/main.o obj/rs232_485_hw.o obj/com.o obj/rfm.o obj/rtc.o obj/cmac.o obj/eeprom.o obj/wireless.o obj/queue.o obj/xtea-asm.o --output master.elf -Wl,-Map=master.map,--cref -lm
Creating load file for Flash: master.hex
avr-objcopy -O ihex -R .eeprom master.elf master.hex
Creating load file for EEPROM: master.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex master.elf master.eep || exit 0
creating Binary for use with bootloader
avr-objcopy master.elf -S -R .eeprom -R .fuse -O binary master.bin
Creating Extended Listing: master.lss
avr-objdump -h -S -z master.elf > master.lss
rm -f master.txt
avr-size --mcu=atmega328p --format=avr master.elf >> master.txt
Size after:
AVR Memory Usage
----------------
Device: atmega328p
Program: 7504 bytes (22.9% Full)
(.text + .data + .bootloader)
Data: 1191 bytes (58.2% Full)
(.data + .bss + .noinit)
EEPROM: 104 bytes (10.2% Full)
(.eeprom)
-------- end --------
I flash HR20 using JTAG (like
http://allegro.pl/show_item.php?item=4937235781)
I flash in AVR Studio 4 because avrdude causes errors "jtagmkI_read_byte(): timeout/error communicating with programmer (resp Ç)"
In AVR studio 4 there are no errors.
I flash my master Arduino NANO clone (like
http://allegro.pl/arduino-nano-v3-0-i4970846956.html) in avrdude using USBASP. No errors.
I get E4 on HR20, and in serial console i get:
N0?
RTC?
(01)?
(02)?
(03)?
(04)?
(05)?
(06)?
(07)?
(08)?
(09)?
(0a)?
(0b)?
(0c)?
(0d)?
(0e)?
(0f)?
(10)?
(11)?
(12)?
(13)?
(14)?
(15)?
(16)?
(17)?
(18)?
(19)?
(1a)?
(1b)?
(1c)?
(1d)?
N1?
Why do they still can not connect?
I connected the HR20 and master as described on
https://piontecsmumble.wordpress.com/
I'm sorry for my very very bad English.
Kind regards from Poland.
Przemek