diff --git a/hardware/atmel/sam/boards.txt b/hardware/atmel/sam/boards.txt new file mode 100644 index 000000000..88d2a83a5 --- /dev/null +++ b/hardware/atmel/sam/boards.txt @@ -0,0 +1,91 @@ +############################################################## + +sam3n_ek.name=Atmel SAM3N-EK +sam3n_ek.upload.tool=bossac +sam3n_ek.upload.protocol=sam-ba +sam3n_ek.upload.maximum_size=49152 +sam3n_ek.upload.speed=115200 +sam3n_ek.build.mcu=cortex-m3 +sam3n_ek.build.f_cpu=48000000L +sam3n_ek.build.core=arduino:sam +sam3n_ek.build.extra_flags=-D__SAM3N4C__ -mthumb +sam3n_ek.build.ldscript=linker_scripts/gcc/flash.ld +sam3n_ek.build.variant=sam3n_ek +sam3n_ek.build.variant_system_lib=libsam_sam3n4c_gcc_rel.a + +############################################################## + +sam3s_ek.name=Atmel SAM3S-EK +sam3s_ek.upload.tool=bossac +sam3s_ek.upload.protocol=sam-ba +sam3s_ek.upload.maximum_size=49152 +sam3s_ek.upload.speed=115200 +sam3s_ek.build.mcu=cortex-m3 +sam3s_ek.build.f_cpu=64000000L +sam3s_ek.build.core=arduino:sam +sam3s_ek.build.extra_flags=-D__SAM3S4C__ -mthumb +sam3s_ek.build.ldscript=linker_scripts/gcc/flash.ld +sam3s_ek.build.variant=sam3s_ek +sam3s_ek.build.variant_system_lib=libsam_sam3s4c_gcc_rel.a + +############################################################## + +sam3s_ek2.name=Atmel SAM3S-EK2 +sam3s_ek2.upload.tool=bossac +sam3s_ek2.upload.protocol=sam-ba +sam3s_ek2.upload.maximum_size=49152 +sam3s_ek2.upload.speed=115200 +sam3s_ek2.build.mcu=cortex-m3 +sam3s_ek2.build.f_cpu=64000000L +sam3s_ek2.build.core=arduino:sam +sam3s_ek2.build.extra_flags=-D__SAM3SD8C__ -mthumb +sam3s_ek2.build.ldscript=linker_scripts/gcc/flash.ld +sam3s_ek2.build.variant=sam3s_ek2 +sam3s_ek2.build.variant_system_lib=libsam_sam3sd8c_gcc_rel.a + +############################################################## + +sam3u_ek.name=Atmel SAM3U-EK +sam3u_ek.upload.tool=bossac +sam3u_ek.upload.protocol=sam-ba +sam3u_ek.upload.maximum_size=49152 +sam3u_ek.upload.speed=115200 +sam3u_ek.build.mcu=cortex-m3 +sam3u_ek.build.f_cpu=96000000L +sam3u_ek.build.core=arduino:sam +sam3u_ek.build.extra_flags=-D__SAM3U4E__ -mthumb +sam3u_ek.build.ldscript=linker_scripts/gcc/flash.ld +sam3u_ek.build.variant=sam3u_ek +sam3u_ek.build.variant_system_lib=libsam_sam3u4e_gcc_rel.a + +############################################################## + +sam3x_ek.name=Atmel SAM3X-EK +sam3x_ek.upload.tool=bossac +sam3x_ek.upload.protocol=sam-ba +sam3x_ek.upload.maximum_size=49152 +sam3x_ek.upload.speed=115200 +sam3x_ek.build.mcu=cortex-m3 +sam3x_ek.build.f_cpu=84000000L +sam3x_ek.build.core=arduino:sam +sam3x_ek.build.extra_flags=-D__SAM3X8H__ -mthumb +sam3x_ek.build.ldscript=linker_scripts/gcc/flash.ld +sam3x_ek.build.variant=sam3x_ek +sam3x_ek.build.variant_system_lib=libsam_sam3x8h_gcc_rel.a + +############################################################## + +sam4s_ek.name=Atmel SAM4S-EK +sam4s_ek.upload.tool=bossac +sam4s_ek.upload.protocol=sam-ba +sam4s_ek.upload.maximum_size=49152 +sam4s_ek.upload.speed=115200 +sam4s_ek.build.mcu=cortex-m3 +sam4s_ek.build.f_cpu=120000000L +sam4s_ek.build.core=arduino:sam +sam4s_ek.build.extra_flags=-D__SAM4S16C__ -mthumb +sam4s_ek.build.ldscript=linker_scripts/gcc/flash.ld +sam4s_ek.build.variant=sam4s_ek +sam4s_ek.build.variant_system_lib=libsam_sam4s16c_gcc_rel.a + + diff --git a/hardware/atmel/sam/platform.txt b/hardware/atmel/sam/platform.txt new file mode 100644 index 000000000..6f72ada2d --- /dev/null +++ b/hardware/atmel/sam/platform.txt @@ -0,0 +1,61 @@ + +# SAM3 compile variables +# --------------------- + +name=Atmel SAM3 +compiler.path={runtime.ide.path}/hardware/tools/g++_arm_none_eabi/bin/ +compiler.c.cmd=arm-none-eabi-gcc +compiler.c.flags=-c -g -Os -w -mlong-calls -ffunction-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf +compiler.c.elf.cmd=arm-none-eabi-gcc +compiler.c.elf.flags=-Os -Wl,--gc-sections +compiler.S.flags=-c -g -assembler-with-cpp +compiler.cpp.cmd=arm-none-eabi-g++ +compiler.cpp.flags=-c -g -Os -w -mlong-calls -ffunction-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf +compiler.ar.cmd=arm-none-eabi-ar +compiler.ar.flags=rcs +compiler.objcopy.cmd=arm-none-eabi-objcopy +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 +compiler.elf2hex.flags=-O binary +compiler.elf2hex.cmd=arm-none-eabi-objcopy +compiler.ldflags= +compiler.size.cmd=arm-none-eabi-size +compiler.define=-DARDUINO= + +compiler.libsam.c.flags=-I{build.system.path}/libsam -I{build.system.path}/CMSIS/CMSIS/Include/ -I{build.system.path}/CMSIS/Device/ATMEL/ + +# SAM3 compile patterns +# --------------------- + +## Compile c files +recipe.c.o.pattern={compiler.path}{compiler.c.cmd} {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{software}={runtime.ide.version} {build.extra_flags} {compiler.libsam.c.flags} {includes} {source_file} -o {object_file} + +## Compile c++ files +recipe.cpp.o.pattern={compiler.path}{compiler.cpp.cmd} {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{software}={runtime.ide.version} {build.extra_flags} {compiler.libsam.c.flags} {includes} {source_file} -o {object_file} + +## Create archives +recipe.ar.pattern={compiler.path}{compiler.ar.cmd} {compiler.ar.flags} {build.path}/{archive_file} {object_file} + +## Combine gc-sections, archives, and objects +recipe.c.combine.pattern={compiler.path}{compiler.c.elf.cmd} {compiler.c.elf.flags} -mcpu={build.mcu} -T{build.variant.path}/{build.ldscript} -Wl,-Map,{build.path}/{build.project_name}.map -o {build.path}/{build.project_name}.elf -L{build.path} -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} {build.variant.path}/{build.variant_system_lib} {build.path}/{archive_file} -Wl,--end-group + +## Create eeprom +recipe.objcopy.eep.pattern= + +## Create hex +recipe.objcopy.hex.pattern={compiler.path}{compiler.elf2hex.cmd} {compiler.elf2hex.flags} {build.path}/{build.project_name}.elf {build.path}/{build.project_name}.bin + +## Compute size +recipe.size.pattern={compiler.path}{compiler.size.cmd} -A {build.path}/{build.project_name}.elf +recipe.size.regex=\.text\s+([0-9]+).* + + +# SAM3 Uploader tools +# ------------------- + +tools.bossac.cmd=bossac +tools.bossac.path={runtime.ide.path}/hardware/tools + +tools.bossac.upload.params.verbose=-i -d +tools.bossac.upload.params.quiet= +tools.bossac.upload.pattern={path}/{cmd} {upload.verbose} --port={serial.port.file} -e -w -v -b {build.path}/{build.project_name}.bin + diff --git a/hardware/atmel/sam/programmers.txt b/hardware/atmel/sam/programmers.txt new file mode 100644 index 000000000..371e5ae82 --- /dev/null +++ b/hardware/atmel/sam/programmers.txt @@ -0,0 +1,18 @@ +samba.name=SAM-BA +samba.communication=serial +samba.protocol=sam-ba +samba.speed=19200 + +sambausb.name=SAM-BA +sambausb.communication=usb +sambausb.protocol=sam-ba + +arduinosamba.name=Arduino as SAM-BA +arduinosamba.communication=serial +arduinosamba.protocol=sam-ba +arduinosamba.speed=19200 + +arduinosambausb.name=Arduino as SAM-BA USB +arduinosambausb.communication=usb +arduinosambausb.protocol=sam-ba + diff --git a/hardware/atmel/sam/sam.bat b/hardware/atmel/sam/sam.bat new file mode 100644 index 000000000..624e9a829 --- /dev/null +++ b/hardware/atmel/sam/sam.bat @@ -0,0 +1,9 @@ +set Path=%ARM_GCC_TOOLCHAIN% +export Path + +start "libsam" /d"..\..\arduino\sam\system\libsam\build_gcc" /max "cd" +start "libarduino" /d"..\..\arduino\sam\cores\sam\build_gcc" /max "cd" +start "libvariant sam3s-ek" /d"variants\sam3s_ek\build_gcc" /max "cd" +start "libvariant sam3u-ek" /d"variants\sam3u_ek\build_gcc" /max "cd" +start "libvariant sam3x-ek" /d"variants\sam3x_ek\build_gcc" /max "cd" +start "test" /d"..\..\arduino\sam\cores\sam\validation\build_gcc" /max "cd" \ No newline at end of file