Skip to content

Commit 46215cd

Browse files
author
Jim Lindblom
committed
Adding 9DoF Razor IMU M0 to boards and variants
1 parent 87d4ca6 commit 46215cd

File tree

10 files changed

+979
-3
lines changed

10 files changed

+979
-3
lines changed

sparkfun/samd/boards.txt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ samd21_dev.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
3636
samd21_dev.build.openocdscript=openocd_scripts/arduino_zero.cfg
3737
samd21_dev.build.variant=arduino_zero
3838
samd21_dev.build.variant_system_lib=
39+
samd21_dev.build.extra_combine_flags=
3940
samd21_dev.build.vid=0x1B4F
4041
samd21_dev.build.pid=0x8D21
4142
samd21_dev.bootloader.tool=openocd
42-
samd21_dev.bootloader.file=zero/samd21_sam_ba.bin
43+
samd21_dev.bootloader.file=zero/SparkFun_SAMD21_Dev.bin
4344

4445
samd21_mini.name=SparkFun SAMD21 Mini Breakout
4546
samd21_mini.vid.0=0x1B4F
@@ -63,7 +64,37 @@ samd21_mini.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
6364
samd21_mini.build.openocdscript=openocd_scripts/arduino_zero.cfg
6465
samd21_mini.build.variant=SparkFun_SAMD_Mini
6566
samd21_mini.build.variant_system_lib=
67+
samd21_mini.build.extra_combine_flags=
6668
samd21_mini.build.vid=0x1B4F
6769
samd21_mini.build.pid=0x8D21
6870
samd21_mini.bootloader.tool=openocd
69-
samd21_mini.bootloader.file=zero/samd21_sam_ba.bin
71+
samd21_mini.bootloader.file=zero/SparkFun_SAMD21_Dev.bin
72+
73+
samd21_9dof.name=SparkFun 9DoF Razor IMU M0
74+
samd21_9dof.vid.0=0x1B4F
75+
samd21_9dof.pid.0=0x9D0E
76+
samd21_9dof.vid.1=0x1B4F
77+
samd21_9dof.pid.1=0x9D0F
78+
samd21_9dof.upload.tool=bossac
79+
samd21_9dof.upload.protocol=sam-ba
80+
samd21_9dof.upload.maximum_size=262144
81+
samd21_9dof.upload.use_1200bps_touch=true
82+
samd21_9dof.upload.wait_for_upload_port=true
83+
samd21_9dof.upload.native_usb=true
84+
samd21_9dof.build.mcu=cortex-m0plus
85+
samd21_9dof.build.f_cpu=48000000L
86+
samd21_9dof.build.usb_product="SFE 9DOF-D21"
87+
samd21_9dof.build.usb_manufacturer="SparkFun"
88+
samd21_9dof.build.board=SAMD_ZERO
89+
samd21_9dof.build.core=arduino
90+
samd21_9dof.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
91+
samd21_9dof.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
92+
samd21_9dof.build.openocdscript=openocd_scripts/arduino_zero.cfg
93+
samd21_9dof.build.variant=SparkFun_9DoF_M0
94+
samd21_9dof.build.variant_system_lib=
95+
#samd21_9dof.build.extra_combine_flags="{build.variant.path}/lib/invensense_mpl_6.12/liblibmplmpu.a"
96+
samd21_9dof.build.extra_combine_flags=
97+
samd21_9dof.build.vid=0x1B4F
98+
samd21_9dof.build.pid=0x9D0F
99+
samd21_9dof.bootloader.tool=openocd
100+
samd21_9dof.bootloader.file=zero/SparkFun_9DoF_Razor_M0.bin

sparkfun/samd/drivers/sparkfun.inf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ ServiceName="USB RS-232 Emulation Driver"
3434
bossa.name="Bossa Program Port"
3535
samd21Breakout.sketch.name="SparkFun SAMD21 Breakout"
3636
samd21Breakout.bootloader.name="SparkFun SAMD21 Bootloader"
37+
samd21IMU.sketch.name="SparkFun 9DoF Razor IMU M0"
38+
samd21IMU.bootloader.name="SparkFun 9DoF Razor IMU M0 BL"
3739

3840
[DefaultInstall]
3941
CopyINF=sparkfun.inf
@@ -57,14 +59,20 @@ DefaultDestDir=12
5759
[DeviceList]
5860
%samd21Breakout.sketch.name%=DriverInstall, USB\VID_1B4F&PID_8D21&MI_00
5961
%samd21Breakout.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_0D21
62+
%samd21IMU.sketch.name%=DriverInstall, USB\VID_1B4F&PID_9D0F&MI_00
63+
%samd21IMU.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_9D0E
6064

6165
[DeviceList.NTamd64]
6266
%samd21Breakout.sketch.name%=DriverInstall, USB\VID_1B4F&PID_8D21&MI_00
6367
%samd21Breakout.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_0D21
68+
%samd21IMU.sketch.name%=DriverInstall, USB\VID_1B4F&PID_9D0F&MI_00
69+
%samd21IMU.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_9D0E
6470

6571
[DeviceList.NTia64]
6672
%samd21Breakout.sketch.name%=DriverInstall, USB\VID_1B4F&PID_8D21&MI_00
6773
%samd21Breakout.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_0D21
74+
%samd21IMU.sketch.name%=DriverInstall, USB\VID_1B4F&PID_9D0F&MI_00
75+
%samd21IMU.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_9D0E
6876

6977
[DriverInstall]
7078
include=mdmcpq.inf,usb.inf

sparkfun/samd/platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ archive_file_path={build.path}/{archive_file}
9191
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
9292

9393
## Combine gc-sections, archives, and objects
94-
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} -Wl,--start-group -lm "{build.path}/{archive_file}" -Wl,--end-group
94+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} -Wl,--start-group -lm "{build.path}/{archive_file}" {build.extra_combine_flags} -Wl,--end-group
9595

9696
## Create output (bin file)
9797
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Arduino Zero OpenOCD script.
3+
#
4+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
# See the GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
# Define 'reset' command
22+
define reset
23+
24+
info reg
25+
26+
break main
27+
28+
# End of 'reset' command
29+
end
30+
31+
target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log"
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
/* Linker script to configure memory regions.
20+
* Need modifying for a specific board.
21+
* FLASH.ORIGIN: starting address of flash
22+
* FLASH.LENGTH: length of flash
23+
* RAM.ORIGIN: starting address of RAM bank 0
24+
* RAM.LENGTH: length of RAM bank 0
25+
*/
26+
MEMORY
27+
{
28+
FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */
29+
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
30+
}
31+
32+
/* Linker script to place sections and symbol values. Should be used together
33+
* with other linker script that defines memory regions FLASH and RAM.
34+
* It references following symbols, which must be defined in code:
35+
* Reset_Handler : Entry of reset handler
36+
*
37+
* It defines following symbols, which code can use without definition:
38+
* __exidx_start
39+
* __exidx_end
40+
* __copy_table_start__
41+
* __copy_table_end__
42+
* __zero_table_start__
43+
* __zero_table_end__
44+
* __etext
45+
* __data_start__
46+
* __preinit_array_start
47+
* __preinit_array_end
48+
* __init_array_start
49+
* __init_array_end
50+
* __fini_array_start
51+
* __fini_array_end
52+
* __data_end__
53+
* __bss_start__
54+
* __bss_end__
55+
* __end__
56+
* end
57+
* __HeapLimit
58+
* __StackLimit
59+
* __StackTop
60+
* __stack
61+
*/
62+
ENTRY(Reset_Handler)
63+
64+
SECTIONS
65+
{
66+
.text :
67+
{
68+
KEEP(*(.isr_vector))
69+
*(.text*)
70+
71+
KEEP(*(.init))
72+
KEEP(*(.fini))
73+
74+
/* .ctors */
75+
*crtbegin.o(.ctors)
76+
*crtbegin?.o(.ctors)
77+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
78+
*(SORT(.ctors.*))
79+
*(.ctors)
80+
81+
/* .dtors */
82+
*crtbegin.o(.dtors)
83+
*crtbegin?.o(.dtors)
84+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
85+
*(SORT(.dtors.*))
86+
*(.dtors)
87+
88+
*(.rodata*)
89+
90+
KEEP(*(.eh_frame*))
91+
} > FLASH
92+
93+
.ARM.extab :
94+
{
95+
*(.ARM.extab* .gnu.linkonce.armextab.*)
96+
} > FLASH
97+
98+
__exidx_start = .;
99+
.ARM.exidx :
100+
{
101+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
102+
} > FLASH
103+
__exidx_end = .;
104+
105+
/* To copy multiple ROM to RAM sections,
106+
* uncomment .copy.table section and,
107+
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
108+
/*
109+
.copy.table :
110+
{
111+
. = ALIGN(4);
112+
__copy_table_start__ = .;
113+
LONG (__etext)
114+
LONG (__data_start__)
115+
LONG (__data_end__ - __data_start__)
116+
LONG (__etext2)
117+
LONG (__data2_start__)
118+
LONG (__data2_end__ - __data2_start__)
119+
__copy_table_end__ = .;
120+
} > FLASH
121+
*/
122+
123+
/* To clear multiple BSS sections,
124+
* uncomment .zero.table section and,
125+
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
126+
/*
127+
.zero.table :
128+
{
129+
. = ALIGN(4);
130+
__zero_table_start__ = .;
131+
LONG (__bss_start__)
132+
LONG (__bss_end__ - __bss_start__)
133+
LONG (__bss2_start__)
134+
LONG (__bss2_end__ - __bss2_start__)
135+
__zero_table_end__ = .;
136+
} > FLASH
137+
*/
138+
139+
__etext = .;
140+
141+
.data : AT (__etext)
142+
{
143+
__data_start__ = .;
144+
*(vtable)
145+
*(.data*)
146+
147+
. = ALIGN(4);
148+
/* preinit data */
149+
PROVIDE_HIDDEN (__preinit_array_start = .);
150+
KEEP(*(.preinit_array))
151+
PROVIDE_HIDDEN (__preinit_array_end = .);
152+
153+
. = ALIGN(4);
154+
/* init data */
155+
PROVIDE_HIDDEN (__init_array_start = .);
156+
KEEP(*(SORT(.init_array.*)))
157+
KEEP(*(.init_array))
158+
PROVIDE_HIDDEN (__init_array_end = .);
159+
160+
161+
. = ALIGN(4);
162+
/* finit data */
163+
PROVIDE_HIDDEN (__fini_array_start = .);
164+
KEEP(*(SORT(.fini_array.*)))
165+
KEEP(*(.fini_array))
166+
PROVIDE_HIDDEN (__fini_array_end = .);
167+
168+
KEEP(*(.jcr*))
169+
. = ALIGN(4);
170+
/* All data end */
171+
__data_end__ = .;
172+
173+
} > RAM
174+
175+
.bss :
176+
{
177+
. = ALIGN(4);
178+
__bss_start__ = .;
179+
*(.bss*)
180+
*(COMMON)
181+
. = ALIGN(4);
182+
__bss_end__ = .;
183+
} > RAM
184+
185+
.heap (COPY):
186+
{
187+
__end__ = .;
188+
PROVIDE(end = .);
189+
*(.heap*)
190+
__HeapLimit = .;
191+
} > RAM
192+
193+
/* .stack_dummy section doesn't contains any symbols. It is only
194+
* used for linker to calculate size of stack sections, and assign
195+
* values to stack symbols later */
196+
.stack_dummy (COPY):
197+
{
198+
*(.stack*)
199+
} > RAM
200+
201+
/* Set stack top to end of RAM, and stack limit move down by
202+
* size of stack_dummy section */
203+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
204+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
205+
PROVIDE(__stack = __StackTop);
206+
207+
__ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ;
208+
209+
/* Check if data + heap + stack exceeds RAM limit */
210+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
211+
}

0 commit comments

Comments
 (0)