Skip to content

Commit 9b74cbc

Browse files
committed
Initial: add Nano WAN
1 parent 927685c commit 9b74cbc

File tree

117 files changed

+87096
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+87096
-0
lines changed

boards.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,47 @@ nano33ble.bootloader.config=-f target/nrf52.cfg
128128
nano33ble.bootloader.programmer=-f interface/cmsis-dap.cfg
129129
nano33ble.bootloader.file=nano33ble/bootloader.hex
130130

131+
##############################################################
132+
133+
nanowan.name=Arduino Nano WAN
134+
nanowan.build.core=arduino
135+
nanowan.build.crossprefix=arm-none-eabi-
136+
nanowan.build.compiler_path={runtime.tools.arm-none-eabi-gcc.path}/bin/
137+
138+
nanowan.build.variant=MTB_MURATA_ABZ
139+
nanowan.build.mcu=cortex-m0
140+
nanowan.build.extra_flags=
141+
nanowan.build.architecture=cortex-m0
142+
nanowan.build.board=MTB_MURATA_ABZ
143+
nanowan.build.ldscript=linker_script.ld
144+
nanowan.build.vid=0x2341
145+
nanowan.build.pid=0x805C
146+
nanowan.compiler.mbed.arch.define=-DARDUINO_ARCH_STM32L0x
147+
nanowan.compiler.mbed.defines={build.variant.path}/defines.txt
148+
nanowan.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
149+
nanowan.compiler.mbed.cflags={build.variant.path}/cflags.txt
150+
nanowan.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
151+
nanowan.compiler.mbed.includes={build.variant.path}/includes.txt
152+
nanowan.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--print-memory-usage
153+
nanowan.compiler.mbed="{build.variant.path}/libs/libmbed.a"
154+
nanowan.vid.0=0x2341
155+
nanowan.pid.0=0x005C
156+
nanowan.vid.1=0x2341
157+
nanowan.pid.1=0x805C
158+
159+
nanowan.upload.tool=dfu-util
160+
nanowan.upload.protocol=
161+
nanowan.upload.vid=0x0483
162+
nanowan.upload.pid=0xdf11
163+
nanowan.upload.interface=0
164+
nanowan.upload.address=0x08000000
165+
nanowan.upload.maximum_size=196608
166+
nanowan.upload.maximum_data_size=20480
167+
nanowan.upload.use_1200bps_touch=true
168+
nanowan.upload.wait_for_upload_port=false
169+
nanowan.upload.native_usb=true
170+
171+
nanowan.bootloader.tool=openocd
172+
nanowan.bootloader.config=-f target/stm32l0_dual_bank.cfg
173+
nanowan.bootloader.programmer=-f interface/cmsis-dap.cfg
174+
nanowan.bootloader.file=nanowan/bootloader.hex
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2017, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PERIPHERALNAMES_H
31+
#define MBED_PERIPHERALNAMES_H
32+
33+
#include "cmsis.h"
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
typedef enum {
40+
ADC_1 = (int)ADC1_BASE
41+
} ADCName;
42+
43+
typedef enum {
44+
DAC_1 = (int)DAC_BASE
45+
} DACName;
46+
47+
typedef enum {
48+
UART_1 = (int)USART1_BASE,
49+
UART_2 = (int)USART2_BASE,
50+
UART_4 = (int)USART4_BASE,
51+
UART_5 = (int)USART5_BASE,
52+
LPUART_1 = (int)LPUART1_BASE
53+
} UARTName;
54+
55+
#define DEVICE_SPI_COUNT 2
56+
typedef enum {
57+
SPI_1 = (int)SPI1_BASE,
58+
SPI_2 = (int)SPI2_BASE
59+
} SPIName;
60+
61+
typedef enum {
62+
I2C_1 = (int)I2C1_BASE,
63+
I2C_2 = (int)I2C2_BASE,
64+
I2C_3 = (int)I2C3_BASE
65+
} I2CName;
66+
67+
typedef enum {
68+
PWM_1 = (int)LPTIM1_BASE,
69+
PWM_2 = (int)TIM2_BASE,
70+
PWM_3 = (int)TIM3_BASE,
71+
PWM_21 = (int)TIM21_BASE,
72+
PWM_22 = (int)TIM22_BASE
73+
} PWMName;
74+
75+
typedef enum {
76+
USB_FS = (int)USB_BASE,
77+
} USBName;
78+
79+
#ifdef __cplusplus
80+
}
81+
#endif
82+
83+
#endif
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2017, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PINNAMES_H
31+
#define MBED_PINNAMES_H
32+
33+
#include "cmsis.h"
34+
#include "PinNamesTypes.h"
35+
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
40+
typedef enum {
41+
ALT0 = 0x100,
42+
ALT1 = 0x200,
43+
ALT2 = 0x300,
44+
ALT3 = 0x400
45+
} ALTx;
46+
47+
typedef enum {
48+
PA_0 = 0x00,
49+
PA_1 = 0x01,
50+
PA_2 = 0x02,
51+
PA_2_ALT0 = PA_2 | ALT0,
52+
PA_3 = 0x03,
53+
PA_3_ALT0 = PA_3 | ALT0,
54+
PA_4 = 0x04,
55+
PA_5 = 0x05,
56+
PA_6 = 0x06,
57+
PA_7 = 0x07,
58+
PA_8 = 0x08,
59+
PA_9 = 0x09,
60+
PA_10 = 0x0A,
61+
PA_11 = 0x0B,
62+
PA_12 = 0x0C,
63+
PA_13 = 0x0D,
64+
PA_14 = 0x0E,
65+
PA_14_ALT0 = PA_14 | ALT0,
66+
PA_15 = 0x0F,
67+
68+
PB_0 = 0x10,
69+
PB_1 = 0x11,
70+
PB_2 = 0x12,
71+
PB_3 = 0x13,
72+
PB_4 = 0x14,
73+
PB_5 = 0x15,
74+
PB_5_ALT0 = PB_5 | ALT0,
75+
PB_6 = 0x16,
76+
PB_7 = 0x17,
77+
PB_8 = 0x18,
78+
PB_9 = 0x19,
79+
PB_12 = 0x1C,
80+
PB_13 = 0x1D,
81+
PB_14 = 0x1E,
82+
PB_15 = 0x1F,
83+
84+
PC_0 = 0x20,
85+
PC_1 = 0x21,
86+
PC_2 = 0x22,
87+
PC_13 = 0x2D,
88+
89+
// ADC internal channels
90+
ADC_TEMP = 0xF0,
91+
ADC_VREF = 0xF1,
92+
ADC_VBAT = 0xF2,
93+
94+
// STDIO for console print
95+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
96+
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
97+
#else
98+
STDIO_UART_TX = PA_9,
99+
#endif
100+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
101+
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
102+
#else
103+
STDIO_UART_RX = PA_10,
104+
#endif
105+
106+
// Generic signals namings
107+
LED1 = PA_4, // Red
108+
LED2 = PA_5, // Blue
109+
LED3 = PA_0, // Green
110+
USER_BUTTON = PA_3,
111+
BUTTON1 = USER_BUTTON,
112+
SERIAL_TX = STDIO_UART_TX,
113+
SERIAL_RX = STDIO_UART_RX,
114+
USBTX = SERIAL_TX,
115+
USBRX = SERIAL_RX,
116+
I2C_SCL = PB_8,
117+
I2C_SDA = PB_9,
118+
SPI_MOSI = PB_15,
119+
SPI_MISO = PB_14,
120+
SPI_SCK = PB_13,
121+
SD_CS = PB_12,
122+
LCD_A0 = PB_2,
123+
LCD_RESET = PB_5,
124+
LCD_NCS = PB_6,
125+
126+
LORA_SPI_MOSI = PA_7,
127+
LORA_SPI_MISO = PA_6,
128+
LORA_SPI_SCLK = PB_3,
129+
LORA_CS = PA_15,
130+
LORA_RESET = PC_0,
131+
LORA_DIO0 = PB_4,
132+
LORA_DIO1 = PB_1,
133+
LORA_DIO2 = PB_0,
134+
LORA_DIO3 = PC_13,
135+
LORA_ANT_RX = PA_1,
136+
LORA_ANT_TX = PC_2,
137+
LORA_ANT_BOOST = PC_1,
138+
139+
//USB pins
140+
USB_DM = PA_11,
141+
USB_DP = PA_12,
142+
143+
// Flash
144+
FLASH_NCS = PA_8,
145+
POT = PA_2, // ADC2 - input !
146+
147+
// Not connected
148+
NC = (int)0xFFFFFFFF
149+
} PinName;
150+
151+
#ifdef __cplusplus
152+
}
153+
#endif
154+
155+
#endif
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2014, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef MBED_CMSIS_NVIC_H
32+
#define MBED_CMSIS_NVIC_H
33+
34+
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
35+
// MCU Peripherals: 32 vectors = 128 bytes from 0x40 to 0xBF
36+
// Total: 48 vectors = 192 bytes (0xC0) to be reserved in RAM
37+
#define NVIC_NUM_VECTORS 48
38+
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Vectors positioned at start of RAM
39+
40+
#endif

0 commit comments

Comments
 (0)