Skip to content

Commit 0412ef8

Browse files
sandeepmistryfacchinm
authored andcommitted
Spilt the MKR NB IoT 1500 into it's own variant folder
1 parent 253f211 commit 0412ef8

File tree

10 files changed

+964
-21
lines changed

10 files changed

+964
-21
lines changed

boards.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ mkrgsm1400.build.pid=0x8052
220220
mkrgsm1400.bootloader.tool=openocd
221221
mkrgsm1400.bootloader.file=mkrgsm1400/samd21_sam_ba_arduino_mkrgsm1400.bin
222222

223-
# Arduino MKR NB-IoT 1450
223+
# Arduino MKR NB-IoT 1500
224224
# --------------------
225225
mkrnb1500.name=Arduino MKR NB 1500
226226
mkrnb1500.vid.0=0x2341
@@ -238,12 +238,12 @@ mkrnb1500.build.mcu=cortex-m0plus
238238
mkrnb1500.build.f_cpu=48000000L
239239
mkrnb1500.build.usb_product="Arduino MKR NB 1500"
240240
mkrnb1500.build.usb_manufacturer="Arduino LLC"
241-
mkrnb1500.build.board=SAMD_MKRNBIOT1450
241+
mkrnb1500.build.board=SAMD_MKRNBIOT1500
242242
mkrnb1500.build.core=arduino
243-
mkrnb1500.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} -DUSE_BQ24195L_PMIC -DNO_HW_FLOW_CONTROL
243+
mkrnb1500.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} -DUSE_BQ24195L_PMIC
244244
mkrnb1500.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
245245
mkrnb1500.build.openocdscript=openocd_scripts/arduino_zero.cfg
246-
mkrnb1500.build.variant=mkrgsm1400
246+
mkrnb1500.build.variant=mkrnbiot1500
247247
mkrnb1500.build.vid=0x2341
248248
mkrnb1500.build.pid=0x8055
249249
mkrnb1500.bootloader.tool=openocd

variants/mkrgsm1400/variant.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,9 @@ void initVariant() {
230230
pinMode(GSM_RESETN, OUTPUT);
231231
digitalWrite(GSM_RESETN, HIGH);
232232

233+
// set GSM DTR to LOW on start
233234
pinMode(PIN_SERIAL2_DTR, OUTPUT);
234-
235-
#ifdef NO_HW_FLOW_CONTROL
236-
// set PWR pin to HIGH on NB-IoT
237-
digitalWrite(PIN_SERIAL2_DTR, HIGH);
238-
#else
239-
// set GSM DTR to LOW on start
240235
digitalWrite(PIN_SERIAL2_DTR, LOW);
241-
#endif
242236
}
243237

244238
// Serial1
@@ -250,12 +244,7 @@ void SERCOM5_Handler()
250244
}
251245

252246
// SerialGSM
253-
254-
#ifdef NO_HW_FLOW_CONTROL
255-
Uart Serial2(&sercom2, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX);
256-
#else
257247
Uart Serial2(&sercom2, PIN_SERIAL2_RX, PIN_SERIAL2_TX, PAD_SERIAL2_RX, PAD_SERIAL2_TX, PIN_SERIAL2_RTS, PIN_SERIAL2_CTS);
258-
#endif
259248

260249
void SERCOM2_Handler()
261250
{

variants/mkrgsm1400/variant.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,7 @@
6767
#define GSM_RTS (28u)
6868
#define GSM_CTS (29u)
6969
#define GSM_RESETN (31u)
70-
71-
#ifndef NO_HW_FLOW_CONTROL
7270
#define GSM_DTR (35u)
73-
#else
74-
#define GSM_DTR (-1)
75-
#endif
7671

7772
// LEDs
7873
// ----
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: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
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+
__text_start__ = .;
69+
70+
KEEP(*(.sketch_boot))
71+
72+
. = ALIGN(0x2000);
73+
KEEP(*(.isr_vector))
74+
*(.text*)
75+
76+
KEEP(*(.init))
77+
KEEP(*(.fini))
78+
79+
/* .ctors */
80+
*crtbegin.o(.ctors)
81+
*crtbegin?.o(.ctors)
82+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
83+
*(SORT(.ctors.*))
84+
*(.ctors)
85+
86+
87+
/* .dtors */
88+
*crtbegin.o(.dtors)
89+
*crtbegin?.o(.dtors)
90+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
91+
*(SORT(.dtors.*))
92+
*(.dtors)
93+
94+
*(.rodata*)
95+
96+
KEEP(*(.eh_frame*))
97+
} > FLASH
98+
99+
.ARM.extab :
100+
{
101+
*(.ARM.extab* .gnu.linkonce.armextab.*)
102+
} > FLASH
103+
104+
__exidx_start = .;
105+
.ARM.exidx :
106+
{
107+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
108+
} > FLASH
109+
__exidx_end = .;
110+
111+
/* To copy multiple ROM to RAM sections,
112+
* uncomment .copy.table section and,
113+
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
114+
/*
115+
.copy.table :
116+
{
117+
. = ALIGN(4);
118+
__copy_table_start__ = .;
119+
LONG (__etext)
120+
LONG (__data_start__)
121+
LONG (__data_end__ - __data_start__)
122+
LONG (__etext2)
123+
LONG (__data2_start__)
124+
LONG (__data2_end__ - __data2_start__)
125+
__copy_table_end__ = .;
126+
} > FLASH
127+
*/
128+
129+
/* To clear multiple BSS sections,
130+
* uncomment .zero.table section and,
131+
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
132+
/*
133+
.zero.table :
134+
{
135+
. = ALIGN(4);
136+
__zero_table_start__ = .;
137+
LONG (__bss_start__)
138+
LONG (__bss_end__ - __bss_start__)
139+
LONG (__bss2_start__)
140+
LONG (__bss2_end__ - __bss2_start__)
141+
__zero_table_end__ = .;
142+
} > FLASH
143+
*/
144+
145+
__etext = .;
146+
147+
.data : AT (__etext)
148+
{
149+
__data_start__ = .;
150+
*(vtable)
151+
*(.data*)
152+
153+
. = ALIGN(4);
154+
/* preinit data */
155+
PROVIDE_HIDDEN (__preinit_array_start = .);
156+
KEEP(*(.preinit_array))
157+
PROVIDE_HIDDEN (__preinit_array_end = .);
158+
159+
. = ALIGN(4);
160+
/* init data */
161+
PROVIDE_HIDDEN (__init_array_start = .);
162+
KEEP(*(SORT(.init_array.*)))
163+
KEEP(*(.init_array))
164+
PROVIDE_HIDDEN (__init_array_end = .);
165+
166+
167+
. = ALIGN(4);
168+
/* finit data */
169+
PROVIDE_HIDDEN (__fini_array_start = .);
170+
KEEP(*(SORT(.fini_array.*)))
171+
KEEP(*(.fini_array))
172+
PROVIDE_HIDDEN (__fini_array_end = .);
173+
174+
KEEP(*(.jcr*))
175+
. = ALIGN(16);
176+
/* All data end */
177+
__data_end__ = .;
178+
179+
} > RAM
180+
181+
.bss :
182+
{
183+
. = ALIGN(4);
184+
__bss_start__ = .;
185+
*(.bss*)
186+
*(COMMON)
187+
. = ALIGN(4);
188+
__bss_end__ = .;
189+
} > RAM
190+
191+
.heap (COPY):
192+
{
193+
__end__ = .;
194+
PROVIDE(end = .);
195+
*(.heap*)
196+
__HeapLimit = .;
197+
} > RAM
198+
199+
/* .stack_dummy section doesn't contains any symbols. It is only
200+
* used for linker to calculate size of stack sections, and assign
201+
* values to stack symbols later */
202+
.stack_dummy (COPY):
203+
{
204+
*(.stack*)
205+
} > RAM
206+
207+
/* Set stack top to end of RAM, and stack limit move down by
208+
* size of stack_dummy section */
209+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
210+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
211+
PROVIDE(__stack = __StackTop);
212+
213+
__ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ;
214+
215+
/* Check if data + heap + stack exceeds RAM limit */
216+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
217+
}

0 commit comments

Comments
 (0)