Skip to content

Commit 13aeffe

Browse files
committed
Merge pull request #7 from gvdw/master
Added STK500RFR2 bootloader directory, updated avr toolchain script for linux
2 parents 3e1be02 + 64698dc commit 13aeffe

37 files changed

+9775
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,36 @@ pinoccio-firmware
44
Firmware files, including bootloaders and app hex files for the ATmega16U2 and the Atmega256RFR2 MCUs
55

66
As of 8/25/2013, you *MUST* create your own toolchain (avr-gcc, avrdude, etc.) because the Atmega256RFR2 is a fairly new chip and Arduino binaries of these are from 2011 era.
7-
install-avr-gcc.sh will help you in grabbing and building the newest avr-gcc, avrdude, etc.
7+
8+
install-avr-gcc.sh (for OS X) will help you in grabbing and building the newest avr-gcc, avrdude, etc.
9+
install-avr-gcc-linux.sh has been tested on debian 6.x 'squeeze' and should also work on the current stable 7.x 'wheezy'
10+
11+
--
12+
13+
There are a few pieces to the puzzle that need to fit together to make it all play nicely..
14+
15+
1) Install Arduino 1.5.4 beta
16+
2) Run this repo's install script to compile and install the avr toolchain (your OS needs gcc, make, binutils etc).
17+
18+
When using /usr/local/avr as the PREFIX install dir (default) the pinoccio-arduino-library repo has some symlinks in it to the OS X default install location in /Applications. So it may make your life easier if you replace the linux script's prefix with the one from the other script (for OS X). Otherwise, redirect the symlinks manually (they're in pinoccio-arduino-library/examples/Shell/Default/build/core).
19+
20+
3) Replace Arduino IDE's avr-gcc and avrdude components with symlinks to the ones installed by the install script in #2:
21+
22+
arduino-1.5.4/hardware/tools/avr/bin/avrdude --> PREFIX/bin/avrdude
23+
arduino-1.5.4/hardware/tools/avr/bin/avrdude.conf --> PREFIX/etc/avrdude.conf
24+
arduino-1.5.4/hardware/tools/avr/bin/avr/bin/ --> PREFIX/bin/
25+
26+
4) Install Pinoccio support into the arduino IDE. 'git clone https://github.com/Pinoccio/pinoccio-arduino-library.git' somewhere convenient (inside your home tree is good). You can then create a symlink to it in your arduino user libraries folder which should be ~/Arduino/libraries (IDE creates this automagically and puts a readme in it):
27+
28+
~/Arduino/libraries/Pinoccio/ -> pinoccio-arduino-library
29+
30+
5) Link the hardware library from the pinoccio-firmware repo into the Arduino IDE:
31+
32+
arduino-1.5.4/hardware/pinoccio/ -> pinoccio-firmware/hardware/pinoccio/
33+
34+
6) Download the stable release of arduino 1.0.5 and copy the libraries/SPI and libraries/Wire directories into the corresponding location of 1.5.4. For some reason those libraries disappear in the new version of arduino??
35+
36+
You should then be able to open one of the Pinoccio examples using Open->libraries->Pinoccio->[example] and compile it. Make sure your Board is set to Pinoccio and the Port is set to your serial port.
37+
38+
You may still need to "#include <SPI.h>" and "#include <Wire.h>" at the top of your sketch. Not sure why the underlying header files (via Scout.h) can't include them...
39+
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
################################################################################
2+
# Automatically-generated file. Do not edit!
3+
################################################################################
4+
5+
SHELL := cmd.exe
6+
RM := rm -rf
7+
8+
USER_OBJS :=
9+
10+
LIBS :=
11+
PROJ :=
12+
13+
O_SRCS :=
14+
C_SRCS :=
15+
S_SRCS :=
16+
S_UPPER_SRCS :=
17+
OBJ_SRCS :=
18+
ASM_SRCS :=
19+
PREPROCESSING_SRCS :=
20+
OBJS :=
21+
OBJS_AS_ARGS :=
22+
C_DEPS :=
23+
C_DEPS_AS_ARGS :=
24+
EXECUTABLES :=
25+
OUTPUT_FILE_PATH :=
26+
OUTPUT_FILE_PATH_AS_ARGS :=
27+
AVR_APP_PATH :=$$$AVR_APP_PATH$$$
28+
QUOTE := "
29+
ADDITIONAL_DEPENDENCIES:=
30+
OUTPUT_FILE_DEP:=
31+
LIB_DEP:=
32+
33+
# Every subdirectory with source files must be described here
34+
SUBDIRS := \
35+
../src/ \
36+
../src/ASF/ \
37+
../src/ASF/common/ \
38+
../src/ASF/common/boards/ \
39+
../src/ASF/common/boards/user_board/ \
40+
../src/ASF/common/utils/ \
41+
../src/ASF/common/utils/interrupt/ \
42+
../src/ASF/common/utils/make/ \
43+
../src/ASF/mega/ \
44+
../src/ASF/mega/utils/ \
45+
../src/ASF/mega/utils/assembler/ \
46+
../src/ASF/mega/utils/preprocessor/ \
47+
../src/config/
48+
49+
50+
# Add inputs and outputs from these tool invocations to the build variables
51+
C_SRCS += \
52+
../src/main.c \
53+
../src/ASF/common/boards/user_board/init.c
54+
55+
56+
PREPROCESSING_SRCS +=
57+
58+
59+
ASM_SRCS +=
60+
61+
62+
OBJS += \
63+
src/main.o \
64+
src/ASF/common/boards/user_board/init.o
65+
66+
OBJS_AS_ARGS += \
67+
src/main.o \
68+
src/ASF/common/boards/user_board/init.o
69+
70+
C_DEPS += \
71+
src/main.d \
72+
src/ASF/common/boards/user_board/init.d
73+
74+
C_DEPS_AS_ARGS += \
75+
src/main.d \
76+
src/ASF/common/boards/user_board/init.d
77+
78+
OUTPUT_FILE_PATH +=STK500RFR2.elf
79+
80+
OUTPUT_FILE_PATH_AS_ARGS +=STK500RFR2.elf
81+
82+
ADDITIONAL_DEPENDENCIES:=
83+
84+
OUTPUT_FILE_DEP:= ./makedep.mk
85+
86+
LIB_DEP+=
87+
88+
# AVR32/GNU C Compiler
89+
90+
91+
92+
93+
94+
src/%.o: ../src/%.c
95+
@echo Building file: $<
96+
@echo Invoking: AVR/GNU C Compiler : 3.4.2
97+
$(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -DBOARD=USER_BOARD -I"../src" -I"../src/ASF/common/boards" -I"../src/ASF/common/boards/user_board" -I"../src/ASF/common/utils" -I"../src/ASF/mega/utils" -I"../src/ASF/mega/utils/preprocessor" -I"../src/config" -O1 -fdata-sections -ffunction-sections -fdata-sections -g3 -Wall -mmcu=atmega256rfr2 -c -std=gnu99 -fno-strict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
98+
@echo Finished building: $<
99+
100+
101+
src/ASF/common/boards/user_board/%.o: ../src/ASF/common/boards/user_board/%.c
102+
@echo Building file: $<
103+
@echo Invoking: AVR/GNU C Compiler : 3.4.2
104+
$(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -DBOARD=USER_BOARD -I"../src" -I"../src/ASF/common/boards" -I"../src/ASF/common/boards/user_board" -I"../src/ASF/common/utils" -I"../src/ASF/mega/utils" -I"../src/ASF/mega/utils/preprocessor" -I"../src/config" -O1 -fdata-sections -ffunction-sections -fdata-sections -g3 -Wall -mmcu=atmega256rfr2 -c -std=gnu99 -fno-strict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
105+
@echo Finished building: $<
106+
107+
108+
109+
110+
# AVR32/GNU Preprocessing Assembler
111+
112+
113+
114+
# AVR32/GNU Assembler
115+
116+
117+
118+
119+
ifneq ($(MAKECMDGOALS),clean)
120+
ifneq ($(strip $(C_DEPS)),)
121+
-include $(C_DEPS)
122+
endif
123+
endif
124+
125+
# Add inputs and outputs from these tool invocations to the build variables
126+
127+
# All Target
128+
all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)
129+
130+
$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP)
131+
@echo Building target: $@
132+
@echo Invoking: AVR/GNU Linker : 3.4.2
133+
$(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="STK500RFR2.map" -Wl,--start-group -Wl,--end-group -Wl,--gc-sections -Wl,-section-start=.text=0x3e000 -mmcu=atmega256rfr2 -Wl,--relax
134+
@echo Finished building target: $@
135+
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "STK500RFR2.elf" "STK500RFR2.hex"
136+
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "STK500RFR2.elf" "STK500RFR2.eep" || exit 0
137+
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "STK500RFR2.elf" > "STK500RFR2.lss"
138+
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "STK500RFR2.elf" "STK500RFR2.srec"
139+
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.1002\avr8-gnu-toolchain\bin\avr-size.exe" "STK500RFR2.elf"
140+
141+
142+
143+
144+
145+
146+
147+
# Other Targets
148+
clean:
149+
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
150+
-$(RM) $(C_DEPS_AS_ARGS)
151+
rm -rf "STK500RFR2.elf" "STK500RFR2.a" "STK500RFR2.hex" "STK500RFR2.lss" "STK500RFR2.eep" "STK500RFR2.map" "STK500RFR2.srec"
152+

0 commit comments

Comments
 (0)