Skip to content

Commit

Permalink
Add Gnat variant
Browse files Browse the repository at this point in the history
  • Loading branch information
GrumpyOldPizza committed Nov 2, 2018
1 parent 8dbb3fc commit ba61b56
Show file tree
Hide file tree
Showing 14 changed files with 791 additions and 3 deletions.
59 changes: 59 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,65 @@ Cicada-L082CZ.menu.opt.o3.build.flags.optimize=-O3
Cicada-L082CZ.menu.opt.o3.build.flags.ldspecs=


# Tlera Gnat
# ---------------------------------------
Gnat-L082CZ.name=Gnat-L082CZ
Gnat-L082CZ.vid.0=0x1209
Gnat-L082CZ.pid.0=0x6662

Gnat-L082CZ.upload.tool=stm32l0_dfu
Gnat-L082CZ.upload.protocol=dfu
Gnat-L082CZ.upload.maximum_size=196608
Gnat-L082CZ.upload.maximum_data_size=20480
Gnat-L082CZ.upload.use_1200bps_touch=true
Gnat-L082CZ.upload.wait_for_upload_port=false
Gnat-L082CZ.upload.native_usb=false

Gnat-L082CZ.build.mcu=cortex-m0plus
Gnat-L082CZ.build.f_cpu=32000000L
Gnat-L082CZ.build.board=STM32L0_GNAT
Gnat-L082CZ.build.arch=stm32l0
Gnat-L082CZ.build.core=arduino
Gnat-L082CZ.build.vid=0x1209
Gnat-L082CZ.build.pid=0x6662
Gnat-L082CZ.build.did=0xffff
Gnat-L082CZ.build.usb_manufacturer="Tlera Corporation"
Gnat-L082CZ.build.usb_product="Gnat"
Gnat-L082CZ.build.extra_flags=-DSTM32L082xx -march=armv6-m -mthumb -mabi=aapcs -mfloat-abi=soft -fsingle-precision-constant {build.usb_flags}
Gnat-L082CZ.build.ldscript=linker_scripts/STM32L082CZ_FLASH.ld
Gnat-L082CZ.build.openocdscript=openocd_scripts/gnat-l082cz.cfg
Gnat-L082CZ.build.variant=Gnat-L082CZ
Gnat-L082CZ.build.variant_system_libs="-L{runtime.platform.path}/system/STM32L0xx/Lib" "-L{runtime.platform.path}/system/CMSIS/Lib" -lstm32l082xx -larm_cortexM0l_math
Gnat-L082CZ.build.variant_system_include="-I{runtime.platform.path}/system/CMSIS/Include" "-I{runtime.platform.path}/system/CMSIS/Device/ST/STM32L0xx/Include" "-I{runtime.platform.path}/system/STM32L0xx/Include"

Gnat-L082CZ.menu.usb.cdc=Serial
Gnat-L082CZ.menu.usb.cdc.build.usb_type=USB_TYPE_CDC
Gnat-L082CZ.menu.usb.cdc_hid=Serial + Keyboard + Mouse
Gnat-L082CZ.menu.usb.cdc_hid.build.usb_type=USB_TYPE_CDC_HID
Gnat-L082CZ.menu.usb.none=No USB
Gnat-L082CZ.menu.usb.none.build.usb_type=USB_TYPE_NONE

Gnat-L082CZ.menu.speed.32=32 MHz
Gnat-L082CZ.menu.speed.32.build.f_cpu=32000000L
Gnat-L082CZ.menu.speed.16=16 MHz (No USB)
Gnat-L082CZ.menu.speed.16.build.f_cpu=16000000L
Gnat-L082CZ.menu.speed.4=4.2 MHz (No USB)
Gnat-L082CZ.menu.speed.4.build.f_cpu=4200000L

Gnat-L082CZ.menu.opt.os=Smallest Code
Gnat-L082CZ.menu.opt.os.build.flags.optimize=-Os
Gnat-L082CZ.menu.opt.os.build.flags.ldspecs=--specs=nano.specs
Gnat-L082CZ.menu.opt.o1=Fast
Gnat-L082CZ.menu.opt.o1.build.flags.optimize=-O1
Gnat-L082CZ.menu.opt.o1.build.flags.ldspecs=
Gnat-L082CZ.menu.opt.o2=Faster
Gnat-L082CZ.menu.opt.o2.build.flags.optimize=-O2
Gnat-L082CZ.menu.opt.o2.build.flags.ldspecs=
Gnat-L082CZ.menu.opt.o3=Fastest
Gnat-L082CZ.menu.opt.o3.build.flags.optimize=-O3
Gnat-L082CZ.menu.opt.o3.build.flags.ldspecs=


# ST B-L072Z-LRWAN1
# ---------------------------------------
B-L072Z-LRWAN1.name=B-L072Z-LRWAN1
Expand Down
6 changes: 6 additions & 0 deletions drivers/linux/49-gnat.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6662", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6662", ENV{MTP_NO_PROBE}="1"
ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6662", ENV{UDISKS_AUTO}="0"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6662", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6662", MODE:="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666"
102 changes: 102 additions & 0 deletions drivers/windows/gnat-cdc-acm.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
;************************************************************
; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation


[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
LayoutFile=layout.inf
CatalogFile=%MFGFILENAME%.cat
DriverVer=11/15/2007,5.1.2600.0

[Manufacturer]
%MFGNAME%=DeviceList, NTamd64

[DestinationDirs]
DefaultDestDir=12


;------------------------------------------------------------------------------
; Windows 2000/XP/Vista-32bit Sections
;------------------------------------------------------------------------------

[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,,,0x20

[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys

;------------------------------------------------------------------------------
; Vista-64bit Sections
;------------------------------------------------------------------------------

[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg

[DriverCopyFiles.NTamd64]
usbser.sys,,,0x20

[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64

[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys


;------------------------------------------------------------------------------
; Vendor and Product ID Definitions
;------------------------------------------------------------------------------
; When developing your USB device, the VID and PID used in the PC side
; application program and the firmware on the microcontroller must match.
; Modify the below line to use your VID and PID. Use the format as shown below.
; Note: One INF file can be used for multiple devices with different VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_1209&PID_6662&MI_00, USB\VID_1209&PID_6662&MI_01

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_1209&PID_6662&MI_00, USB\VID_1209&PID_6662&MI_01

;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
;Modify these strings to customize your device
;------------------------------------------------------------------------------
[Strings]
MFGNAME="Tlera Corporation"
DESCRIPTION="Cicada Virtual Serial Port"
SERVICE="USB Serial Driver"
13 changes: 13 additions & 0 deletions libraries/GNSS/src/GNSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ void GNSSClass::begin(Uart &uart, GNSSmode mode, GNSSrate rate)
(gnss_satellites_callback_t)&GNSSClass::satellitesCallback,
};

#if defined(STM32L0_CONFIG_PIN_GNSS_BACKUP)
stm32l0_gpio_pin_configure(STM32L0_CONFIG_PIN_GNSS_BACKUP, (STM32L0_GPIO_PARK_NONE | STM32L0_GPIO_PUPD_PULLUP | STM32L0_GPIO_OSPEED_LOW | STM32L0_GPIO_OTYPE_PUSHPULL | STM32L0_GPIO_MODE_OUTPUT));
stm32l0_gpio_pin_write(STM32L0_CONFIG_PIN_GNSS_BACKUP, 1);
#endif /* defined(STM32L0_CONFIG_PIN_GNSS_BACKUP) */

#if defined(STM32L0_CONFIG_PIN_GNSS_ENABLE)
stm32l0_gpio_pin_configure(STM32L0_CONFIG_PIN_GNSS_RX, (STM32L0_GPIO_PARK_NONE | STM32L0_GPIO_PUPD_PULLDOWN | STM32L0_GPIO_OSPEED_LOW | STM32L0_GPIO_OTYPE_PUSHPULL | STM32L0_GPIO_MODE_INPUT));
stm32l0_gpio_pin_configure(STM32L0_CONFIG_PIN_GNSS_TX, (STM32L0_GPIO_PARK_NONE | STM32L0_GPIO_PUPD_PULLUP | STM32L0_GPIO_OSPEED_LOW | STM32L0_GPIO_OTYPE_PUSHPULL | STM32L0_GPIO_MODE_OUTPUT));
Expand Down Expand Up @@ -379,12 +384,20 @@ void GNSSClass::end()
_uart->end();

_uart = NULL;

#if defined(STM32L0_CONFIG_PIN_GNSS_BACKUP)
stm32l0_gpio_pin_configure(STM32L0_CONFIG_PIN_GNSS_BACKUP, (STM32L0_GPIO_PARK_NONE | STM32L0_GPIO_MODE_ANALOG));
#endif /* defined(STM32L0_CONFIG_PIN_GNSS_BACKUP) */
}
}

bool GNSSClass::setAntenna(GNSSantenna antenna)
{
#if defined(STM32L0_CONFIG_GNSS_ANT_SWITCH)
return (_uart && gnss_set_antenna(antenna));
#else /* STM32L0_CONFIG_GNSS_ANT_SWITCH */
return false;
#endif /* STM32L0_CONFIG_GNSS_ANT_SWITCH */
}

bool GNSSClass::setPPS(unsigned int width)
Expand Down
Binary file modified system/STM32L0xx/Lib/libstm32l052xx.a
Binary file not shown.
Binary file modified system/STM32L0xx/Lib/libstm32l072xx.a
Binary file not shown.
Binary file modified system/STM32L0xx/Lib/libstm32l082xx.a
Binary file not shown.
6 changes: 3 additions & 3 deletions variants/Cicada-L082CZ/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* WITH THE SOFTWARE.
*/

#ifndef _VARIANT_CRICKET_STM32L082CZ_
#define _VARIANT_CRICKET_STM32L082CZ_
#ifndef _VARIANT_CICADA_STM32L082CZ_
#define _VARIANT_CICADA_STM32L082CZ_

/*----------------------------------------------------------------------------
* Definitions
Expand Down Expand Up @@ -198,4 +198,4 @@ extern Uart Serial3;
// Alias Serial to SerialUSB
#define Serial SerialUSB

#endif /* _VARIANT_CRICKET_STM32L082CZ_ */
#endif /* _VARIANT_CICADA_STM32L082CZ_ */
1 change: 1 addition & 0 deletions variants/Cricket-L082CZ/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define STM32L0_CONFIG_PIN_GNSS_PPS STM32L0_GPIO_PIN_PB7
#define STM32L0_CONFIG_PIN_GNSS_RX STM32L0_GPIO_PIN_PA10_USART1_RX
#define STM32L0_CONFIG_PIN_GNSS_TX STM32L0_GPIO_PIN_PA9_USART1_TX
#define STM32L0_CONFIG_GNSS_ANT_SWITCH 1

#define STM32L0_CONFIG_SFLASH_DATA_START (256 * 1024)

Expand Down
Loading

0 comments on commit ba61b56

Please sign in to comment.