├── README.md ├── boards.txt ├── cores └── stm32l4 │ ├── Arduino.h │ ├── CDC.cpp │ ├── Client.h │ ├── FS.cpp │ ├── FS.h │ ├── HID.cpp │ ├── HardwareSerial.h │ ├── IPAddress.cpp │ ├── IPAddress.h │ ├── Makefile │ ├── Print.cpp │ ├── Print.h │ ├── Printable.h │ ├── RingBuffer.cpp │ ├── RingBuffer.h │ ├── STM32.cpp │ ├── STM32.h │ ├── Server.h │ ├── Stream.cpp │ ├── Stream.h │ ├── USBAPI.h │ ├── USBCore.cpp │ ├── Uart.cpp │ ├── Uart.h │ ├── Udp.h │ ├── WCharacter.h │ ├── WMath.cpp │ ├── WMath.h │ ├── WString.cpp │ ├── WString.h │ ├── abi.cpp │ ├── avr │ ├── dtostrf.c │ ├── dtostrf.h │ ├── eeprom.c │ ├── eeprom.h │ ├── fdevopen.c │ ├── interrupt.h │ ├── io.h │ └── pgmspace.h │ ├── binary.h │ ├── hooks.c │ ├── itoa.c │ ├── itoa.h │ ├── main.cpp │ ├── new.cpp │ ├── stm32l4_wiring.c │ ├── stm32l4_wiring.h │ ├── stm32l4_wiring_analog.c │ ├── stm32l4_wiring_digital.c │ ├── stm32l4_wiring_interrupts.c │ ├── stm32l4_wiring_private.h │ ├── stm32l4_wiring_pulse.c │ ├── stm32l4_wiring_shift.c │ └── stm32l4_wiring_tone.c ├── drivers ├── linux │ ├── 49-butterfly.rules │ ├── 49-dragonfly.rules │ ├── 49-ladybug.rules │ └── 49-nucleo.rules └── windows │ ├── butterfly-cdc-acm.inf │ ├── dpinst.xml │ ├── dpinst_amd64.exe │ ├── dpinst_x86.exe │ ├── dragonfly-cdc-acm.inf │ └── ladybug-cdc-acm.inf ├── libraries ├── EEPROM │ ├── README.md │ ├── examples │ │ ├── eeprom_clear │ │ │ └── eeprom_clear.ino │ │ ├── eeprom_crc │ │ │ └── eeprom_crc.ino │ │ ├── eeprom_get │ │ │ └── eeprom_get.ino │ │ ├── eeprom_iteration │ │ │ └── eeprom_iteration.ino │ │ ├── eeprom_put │ │ │ └── eeprom_put.ino │ │ ├── eeprom_read │ │ │ └── eeprom_read.ino │ │ ├── eeprom_update │ │ │ └── eeprom_update.ino │ │ └── eeprom_write │ │ │ └── eeprom_write.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ └── EEPROM.h ├── I2S │ ├── examples │ │ ├── InputSerialPlotter │ │ │ └── InputSerialPlotter.ino │ │ └── SimpleTone │ │ │ └── SimpleTone.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── I2S.cpp │ │ └── I2S.h ├── RTC │ ├── examples │ │ ├── Epoch │ │ │ └── Epoch.ino │ │ ├── SimpleRTC │ │ │ └── SimpleRTC.ino │ │ └── SimpleRTCAlarm │ │ │ └── SimpleRTCAlarm.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── RTC.cpp │ │ ├── RTC.h │ │ └── RTCZero.h ├── SPI │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── SPI.cpp │ │ └── SPI.h ├── Servo │ ├── README.adoc │ ├── examples │ │ ├── Knob │ │ │ └── Knob.ino │ │ └── Sweep │ │ │ └── Sweep.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── Servo.cpp │ │ └── Servo.h └── Wire │ ├── keywords.txt │ ├── library.properties │ └── src │ ├── Wire.cpp │ └── Wire.h ├── platform.txt ├── programmers.txt ├── system ├── CMSIS │ ├── Device │ │ └── ST │ │ │ └── STM32L4xx │ │ │ ├── Include │ │ │ ├── stm32l431xx.h │ │ │ ├── stm32l432xx.h │ │ │ ├── stm32l433xx.h │ │ │ ├── stm32l442xx.h │ │ │ ├── stm32l443xx.h │ │ │ ├── stm32l451xx.h │ │ │ ├── stm32l452xx.h │ │ │ ├── stm32l462xx.h │ │ │ ├── stm32l471xx.h │ │ │ ├── stm32l475xx.h │ │ │ ├── stm32l476xx.h │ │ │ ├── stm32l485xx.h │ │ │ ├── stm32l486xx.h │ │ │ ├── stm32l496xx.h │ │ │ ├── stm32l4a6xx.h │ │ │ ├── stm32l4xx.h │ │ │ └── system_stm32l4xx.h │ │ │ └── Source │ │ │ └── system_stm32l4xx.c │ ├── Include │ │ ├── arm_common_tables.h │ │ ├── arm_const_structs.h │ │ ├── arm_math.h │ │ ├── cmsis_armcc.h │ │ ├── cmsis_armcc_V6.h │ │ ├── cmsis_gcc.h │ │ ├── core_cm0.h │ │ ├── core_cm0plus.h │ │ ├── core_cm3.h │ │ ├── core_cm4.h │ │ ├── core_cm7.h │ │ ├── core_cmFunc.h │ │ ├── core_cmInstr.h │ │ ├── core_cmSimd.h │ │ ├── core_sc000.h │ │ └── core_sc300.h │ └── Lib │ │ └── libarm_cortexM4lf_math.a └── STM32L4xx │ ├── Include │ ├── armv7m.h │ ├── armv7m_atomic.h │ ├── armv7m_bitband.h │ ├── armv7m_orchid.h │ ├── armv7m_pendsv.h │ ├── armv7m_svcall.h │ ├── armv7m_systick.h │ ├── armv7m_timer.h │ ├── dosfs_api.h │ ├── dosfs_config.h │ ├── dosfs_core.h │ ├── dosfs_device.h │ ├── dosfs_port.h │ ├── dosfs_sflash.h │ ├── stm32l4_adc.h │ ├── stm32l4_dac.h │ ├── stm32l4_dma.h │ ├── stm32l4_exti.h │ ├── stm32l4_flash.h │ ├── stm32l4_gpio.h │ ├── stm32l4_i2c.h │ ├── stm32l4_iap.h │ ├── stm32l4_iwdg.h │ ├── stm32l4_nvic.h │ ├── stm32l4_qspi.h │ ├── stm32l4_rtc.h │ ├── stm32l4_sai.h │ ├── stm32l4_sdmmc.h │ ├── stm32l4_sdspi.h │ ├── stm32l4_servo.h │ ├── stm32l4_spi.h │ ├── stm32l4_system.h │ ├── stm32l4_timer.h │ ├── stm32l4_uart.h │ ├── stm32l4_usbd_cdc.h │ ├── stm32l4_usbd_dap.h │ └── stm32l4_usbd_hid.h │ ├── Lib │ ├── boot_stm32l432.o │ ├── boot_stm32l433.o │ ├── boot_stm32l452.o │ ├── boot_stm32l476.o │ ├── boot_stm32l496.o │ ├── libstm32l432.a │ ├── libstm32l433.a │ ├── libstm32l452.a │ ├── libstm32l476.a │ └── libstm32l496.a │ └── Source │ ├── DAP │ ├── DAP.c │ ├── DAP.h │ ├── DAP_config.h │ └── SW_DP.c │ ├── Makefile │ ├── USB │ ├── Class │ │ ├── CDC │ │ │ ├── Inc │ │ │ │ └── usbd_cdc.h │ │ │ └── Src │ │ │ │ └── usbd_cdc.c │ │ ├── HID │ │ │ ├── Inc │ │ │ │ └── usbd_hid.h │ │ │ └── Src │ │ │ │ └── usbd_hid.c │ │ ├── MSC │ │ │ ├── Inc │ │ │ │ ├── usbd_msc.h │ │ │ │ ├── usbd_msc_bot.h │ │ │ │ ├── usbd_msc_data.h │ │ │ │ └── usbd_msc_scsi.h │ │ │ └── Src │ │ │ │ ├── usbd_msc.c │ │ │ │ ├── usbd_msc_bot.c │ │ │ │ ├── usbd_msc_data.c │ │ │ │ └── usbd_msc_scsi.c │ │ └── WEBUSB │ │ │ ├── Inc │ │ │ └── usbd_webusb.h │ │ │ └── Src │ │ │ └── usbd_webusb.c │ ├── Core │ │ ├── Inc │ │ │ ├── usbd_core.h │ │ │ ├── usbd_ctlreq.h │ │ │ ├── usbd_def.h │ │ │ └── usbd_ioreq.h │ │ └── Src │ │ │ ├── usbd_core.c │ │ │ ├── usbd_ctlreq.c │ │ │ └── usbd_ioreq.c │ ├── HAL │ │ ├── Inc │ │ │ ├── Legacy │ │ │ │ └── stm32_hal_legacy.h │ │ │ ├── stm32l4xx_hal.h │ │ │ ├── stm32l4xx_hal_conf.h │ │ │ ├── stm32l4xx_hal_def.h │ │ │ ├── stm32l4xx_hal_pcd.h │ │ │ ├── stm32l4xx_hal_pcd_ex.h │ │ │ ├── stm32l4xx_hal_pwr.h │ │ │ ├── stm32l4xx_hal_pwr_ex.h │ │ │ ├── stm32l4xx_hal_rcc.h │ │ │ ├── stm32l4xx_hal_rcc_ex.h │ │ │ └── stm32l4xx_ll_usb.h │ │ └── Src │ │ │ ├── stm32l4xx_hal_pcd.c │ │ │ ├── stm32l4xx_hal_pcd_ex.c │ │ │ └── stm32l4xx_ll_usb.c │ ├── usbd_cdc_msc.c │ ├── usbd_cdc_msc.h │ ├── usbd_conf.c │ ├── usbd_conf.h │ ├── usbd_desc.c │ └── usbd_desc.h │ ├── armv7m_atomic.c │ ├── armv7m_core.c │ ├── armv7m_orchid.c │ ├── armv7m_pendsv.c │ ├── armv7m_rtlib.S │ ├── armv7m_svcall.c │ ├── armv7m_systick.c │ ├── armv7m_timer.c │ ├── boot_stm32l4xx.c │ ├── dosfs_core.c │ ├── dosfs_device.c │ ├── dosfs_sflash.c │ ├── dosfs_storage.c │ ├── startup_stm32l432xx.S │ ├── startup_stm32l433xx.S │ ├── startup_stm32l452xx.S │ ├── startup_stm32l476xx.S │ ├── startup_stm32l496xx.S │ ├── stm32l4_adc.c │ ├── stm32l4_clib.c │ ├── stm32l4_dac.c │ ├── stm32l4_dma.c │ ├── stm32l4_exti.c │ ├── stm32l4_flash.c │ ├── stm32l4_gpio.c │ ├── stm32l4_i2c.c │ ├── stm32l4_iwdg.c │ ├── stm32l4_nvic.c │ ├── stm32l4_qspi.c │ ├── stm32l4_rtc.c │ ├── stm32l4_sai.c │ ├── stm32l4_sdmmc.c │ ├── stm32l4_sdspi.c │ ├── stm32l4_servo.c │ ├── stm32l4_spi.c │ ├── stm32l4_system.c │ ├── stm32l4_timer.c │ ├── stm32l4_uart.c │ ├── stm32l4_usbd_cdc.c │ ├── stm32l4_usbd_dap.c │ └── stm32l4_usbd_hid.c ├── tools ├── linux │ ├── dfu-prefix │ ├── dfu-suffix │ ├── dfu-util │ ├── openocd │ │ ├── bin │ │ │ ├── openocd │ │ │ └── openocd.bin │ │ └── lib │ │ │ ├── libhidapi-hidraw.so │ │ │ ├── libhidapi-hidraw.so.0 │ │ │ ├── libhidapi-hidraw.so.0.0.0 │ │ │ ├── libhidapi-libusb.so │ │ │ ├── libhidapi-libusb.so.0 │ │ │ ├── libhidapi-libusb.so.0.0.0 │ │ │ ├── libjaylink.so │ │ │ ├── libjaylink.so.0 │ │ │ ├── libjaylink.so.0.0.0 │ │ │ ├── libusb-1.0.so │ │ │ ├── libusb-1.0.so.0 │ │ │ └── libusb-1.0.so.0.1.0 │ └── stm32l4-upload ├── macosx │ ├── dfu-prefix │ ├── dfu-suffix │ ├── dfu-util │ ├── openocd │ │ ├── bin │ │ │ ├── openocd │ │ │ └── openocd.bin │ │ └── lib │ │ │ ├── libhidapi.0.dylib │ │ │ ├── libhidapi.dylib │ │ │ ├── libjaylink.0.dylib │ │ │ ├── libjaylink.dylib │ │ │ ├── libusb-1.0.0.dylib │ │ │ └── libusb-1.0.dylib │ └── stm32l4-upload ├── share │ └── openocd │ │ └── scripts │ │ ├── board │ │ ├── st_nucleo_f0.cfg │ │ ├── st_nucleo_f103rb.cfg │ │ ├── st_nucleo_f3.cfg │ │ ├── st_nucleo_f4.cfg │ │ ├── st_nucleo_l1.cfg │ │ ├── st_nucleo_l476rg.cfg │ │ ├── stm320518_eval.cfg │ │ ├── stm320518_eval_stlink.cfg │ │ ├── stm32100b_eval.cfg │ │ ├── stm3210b_eval.cfg │ │ ├── stm3210c_eval.cfg │ │ ├── stm3210e_eval.cfg │ │ ├── stm3220g_eval.cfg │ │ ├── stm3220g_eval_stlink.cfg │ │ ├── stm3241g_eval.cfg │ │ ├── stm3241g_eval_stlink.cfg │ │ ├── stm32429i_eval.cfg │ │ ├── stm32429i_eval_stlink.cfg │ │ ├── stm32439i_eval.cfg │ │ ├── stm32439i_eval_stlink.cfg │ │ ├── stm327x6g_eval.cfg │ │ ├── stm32f0discovery.cfg │ │ ├── stm32f334discovery.cfg │ │ ├── stm32f3discovery.cfg │ │ ├── stm32f429disc1.cfg │ │ ├── stm32f429discovery.cfg │ │ ├── stm32f469discovery.cfg │ │ ├── stm32f4discovery.cfg │ │ ├── stm32f7discovery.cfg │ │ ├── stm32l0discovery.cfg │ │ ├── stm32l4discovery.cfg │ │ ├── stm32ldiscovery.cfg │ │ └── stm32vldiscovery.cfg │ │ ├── chip │ │ └── st │ │ │ └── stm32 │ │ │ ├── stm32.tcl │ │ │ ├── stm32_rcc.tcl │ │ │ └── stm32_regs.tcl │ │ ├── cpu │ │ └── arm │ │ │ └── cortex_m3.tcl │ │ ├── interface │ │ ├── cmsis-dap.cfg │ │ ├── stlink-v1.cfg │ │ ├── stlink-v2-1.cfg │ │ └── stlink-v2.cfg │ │ ├── mem_helper.tcl │ │ └── target │ │ ├── stm32_stlink.cfg │ │ ├── stm32f0x.cfg │ │ ├── stm32f0x_stlink.cfg │ │ ├── stm32f1x.cfg │ │ ├── stm32f1x_stlink.cfg │ │ ├── stm32f2x.cfg │ │ ├── stm32f2x_stlink.cfg │ │ ├── stm32f3x.cfg │ │ ├── stm32f3x_stlink.cfg │ │ ├── stm32f4x.cfg │ │ ├── stm32f4x_stlink.cfg │ │ ├── stm32f7x.cfg │ │ ├── stm32l0.cfg │ │ ├── stm32l1.cfg │ │ ├── stm32l1x_dual_bank.cfg │ │ ├── stm32l4x.cfg │ │ ├── stm32lx_stlink.cfg │ │ └── swj-dp.tcl └── windows │ ├── dfu-prefix.exe │ ├── dfu-suffix.exe │ ├── dfu-util.exe │ ├── libwinpthread-1.dll │ ├── openocd │ └── bin │ │ ├── libgcc_s_sjlj-1.dll │ │ ├── libhidapi-0.dll │ │ ├── libjaylink-0.dll │ │ ├── libusb-1.0.dll │ │ ├── libwinpthread-1.dll │ │ └── openocd.exe │ └── stm32l4-upload.bat └── variants ├── STM32L432KC-Ladybug ├── linker_scripts │ └── STM32L432KC_FLASH.ld ├── openocd_scripts │ └── stm32l432kc_ladybug.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L432KC-NUCLEO ├── linker_scripts │ └── STM32L432KC_FLASH.ld ├── openocd_scripts │ └── stm32l432kc_nucleo.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L433CC-Butterfly ├── linker_scripts │ └── STM32L433CC_FLASH.ld ├── openocd_scripts │ └── stm32l433cc_butterfly.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L433CC-Proffieboard ├── linker_scripts │ └── STM32L433CC_FLASH.ld ├── openocd_scripts │ └── stm32l433cc_butterfly.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L433CC-ProffieboardV2 ├── linker_scripts │ └── STM32L433CC_FLASH.ld ├── openocd_scripts │ └── stm32l433cc_butterfly.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L452RE-ProffieboardV3 ├── linker_scripts │ └── STM32L452RE_FLASH.ld ├── openocd_scripts │ └── stm32l452re.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L476RE-Dragonfly ├── linker_scripts │ └── STM32L476RE_FLASH.ld ├── openocd_scripts │ └── stm32l476re_dragonfly.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h ├── STM32L476RG-NUCLEO ├── linker_scripts │ └── STM32L476RG_FLASH.ld ├── openocd_scripts │ └── stm32l476rg_nucleo.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h └── STM32L496RG-Dragonfly ├── linker_scripts └── STM32L496RG_FLASH.ld ├── openocd_scripts └── stm32l496rg_dragonfly.cfg ├── pins_arduino.h ├── variant.cpp └── variant.h /README.md: -------------------------------------------------------------------------------- 1 | # Arduino Plugin for [Proffieboard](https://fredrik.hubbe.net/lightsaber/v6/) 2 | 3 | ## Installing 4 | 5 | See the [ProffieOS Documentation](https://pod.hubbe.net/proffieboard-setup.html) 6 | 7 | ## Alternative installation method for developers 8 | 9 | 1. ```cd ```, where `````` is your Arduino Sketch folder: 10 | * OS X: ```~/Documents/Arduino``` 11 | * Linux: ```~/Arduino``` 12 | * Windows: ```~/Documents/Arduino``` 13 | 2. Create a folder named ```hardware```, if it does not exist, and change directories to it 14 | 3. Clone this repo: ```git clone https://github.com/profezzorn/arduino-proffieboard.git profezzorn/stm32l4``` 15 | 4. Restart the Arduino IDE 16 | 5. Make sure you install any drivers you need from the instructions at the top. 17 | 18 | ## Credits 19 | 20 | This core is based on the [Arduino STM32L4 Core](https://github.com/GrumpyOldPizza/arduino-STM32L4). For now, the boards from the original core are still supported by this core. 21 | -------------------------------------------------------------------------------- /cores/stm32l4/Client.h: -------------------------------------------------------------------------------- 1 | /* 2 | Client.h - Base class that provides Client 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef client_h 21 | #define client_h 22 | #include "Print.h" 23 | #include "Stream.h" 24 | #include "IPAddress.h" 25 | 26 | class Client : public Stream { 27 | 28 | public: 29 | virtual int connect(IPAddress ip, uint16_t port) =0; 30 | virtual int connect(const char *host, uint16_t port) =0; 31 | virtual size_t write(uint8_t) =0; 32 | virtual size_t write(const uint8_t *buf, size_t size) =0; 33 | virtual int available() = 0; 34 | virtual int read() = 0; 35 | virtual int read(uint8_t *buf, size_t size) = 0; 36 | virtual int peek() = 0; 37 | virtual void flush() = 0; 38 | virtual void stop() = 0; 39 | virtual uint8_t connected() = 0; 40 | virtual operator bool() = 0; 41 | protected: 42 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /cores/stm32l4/HardwareSerial.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | #ifndef HardwareSerial_h 20 | #define HardwareSerial_h 21 | 22 | #include 23 | 24 | #include "Stream.h" 25 | 26 | #define HARDSER_PARITY_NONE (0x0000ul) 27 | #define HARDSER_PARITY_ODD (0x0001ul) 28 | #define HARDSER_PARITY_EVEN (0x0002ul) 29 | #define HARDSER_PARITY_MASK (0x000Ful) 30 | 31 | #define HARDSER_STOP_BIT_1 (0x0000ul) 32 | #define HARDSER_STOP_BIT_1_5 (0x0010ul) 33 | #define HARDSER_STOP_BIT_2 (0x0020ul) 34 | #define HARDSER_STOP_BIT_MASK (0x00F0ul) 35 | 36 | #define HARDSER_DATA_7 (0x0000ul) 37 | #define HARDSER_DATA_8 (0x0100ul) 38 | #define HARDSER_DATA_9 (0x0200ul) 39 | #define HARDSER_DATA_MASK (0x0F00ul) 40 | 41 | #define SERIAL_7N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_7) 42 | #define SERIAL_8N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_8) 43 | #define SERIAL_9N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_9) 44 | #define SERIAL_7N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_7) 45 | #define SERIAL_8N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_8) 46 | #define SERIAL_9N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_9) 47 | #define SERIAL_7E1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_EVEN | HARDSER_DATA_7) 48 | #define SERIAL_8E1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_EVEN | HARDSER_DATA_8) 49 | #define SERIAL_7E2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_EVEN | HARDSER_DATA_7) 50 | #define SERIAL_8E2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_EVEN | HARDSER_DATA_8) 51 | #define SERIAL_7O1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_ODD | HARDSER_DATA_7) 52 | #define SERIAL_8O1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_ODD | HARDSER_DATA_8) 53 | #define SERIAL_7O2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_ODD | HARDSER_DATA_7) 54 | #define SERIAL_8O2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_ODD | HARDSER_DATA_8) 55 | 56 | class HardwareSerial : public Stream 57 | { 58 | public: 59 | virtual void begin(unsigned long); 60 | virtual void begin(unsigned long baudrate, uint16_t config); 61 | virtual void end(); 62 | virtual int available(void) = 0; 63 | virtual int peek(void) = 0; 64 | virtual int read(void) = 0; 65 | virtual void flush(void) = 0; 66 | virtual size_t write(uint8_t) = 0; 67 | using Print::write; // pull in write(str) and write(buf, size) from Print 68 | virtual operator bool() = 0; 69 | }; 70 | 71 | extern void (*serialEventCallback)(void); 72 | extern void serialEventDispatch(void); 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /cores/stm32l4/IPAddress.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | IPAddress.cpp - Base class that provides IPAddress 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | IPAddress::IPAddress() 24 | { 25 | _address.dword = 0; 26 | } 27 | 28 | IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) 29 | { 30 | _address.bytes[0] = first_octet; 31 | _address.bytes[1] = second_octet; 32 | _address.bytes[2] = third_octet; 33 | _address.bytes[3] = fourth_octet; 34 | } 35 | 36 | IPAddress::IPAddress(uint32_t address) 37 | { 38 | _address.dword = address; 39 | } 40 | 41 | IPAddress::IPAddress(const uint8_t *address) 42 | { 43 | memcpy(_address.bytes, address, sizeof(_address.bytes)); 44 | } 45 | 46 | bool IPAddress::fromString(const char *address) 47 | { 48 | // TODO: add support for "a", "a.b", "a.b.c" formats 49 | 50 | uint16_t acc = 0; // Accumulator 51 | uint8_t dots = 0; 52 | 53 | while (*address) 54 | { 55 | char c = *address++; 56 | if (c >= '0' && c <= '9') 57 | { 58 | acc = acc * 10 + (c - '0'); 59 | if (acc > 255) { 60 | // Value out of [0..255] range 61 | return false; 62 | } 63 | } 64 | else if (c == '.') 65 | { 66 | if (dots == 3) { 67 | // Too much dots (there must be 3 dots) 68 | return false; 69 | } 70 | _address.bytes[dots++] = acc; 71 | acc = 0; 72 | } 73 | else 74 | { 75 | // Invalid char 76 | return false; 77 | } 78 | } 79 | 80 | if (dots != 3) { 81 | // Too few dots (there must be 3 dots) 82 | return false; 83 | } 84 | _address.bytes[3] = acc; 85 | return true; 86 | } 87 | 88 | IPAddress& IPAddress::operator=(const uint8_t *address) 89 | { 90 | memcpy(_address.bytes, address, sizeof(_address.bytes)); 91 | return *this; 92 | } 93 | 94 | IPAddress& IPAddress::operator=(uint32_t address) 95 | { 96 | _address.dword = address; 97 | return *this; 98 | } 99 | 100 | bool IPAddress::operator==(const uint8_t* addr) const 101 | { 102 | return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; 103 | } 104 | 105 | size_t IPAddress::printTo(Print& p) const 106 | { 107 | size_t n = 0; 108 | for (int i =0; i < 3; i++) 109 | { 110 | n += p.print(_address.bytes[i], DEC); 111 | n += p.print('.'); 112 | } 113 | n += p.print(_address.bytes[3], DEC); 114 | return n; 115 | } 116 | 117 | -------------------------------------------------------------------------------- /cores/stm32l4/IPAddress.h: -------------------------------------------------------------------------------- 1 | /* 2 | IPAddress.h - Base class that provides IPAddress 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef IPAddress_h 21 | #define IPAddress_h 22 | 23 | #include 24 | #include "Printable.h" 25 | #include "WString.h" 26 | 27 | // A class to make it easier to handle and pass around IP addresses 28 | 29 | class IPAddress : public Printable { 30 | private: 31 | union { 32 | uint8_t bytes[4]; // IPv4 address 33 | uint32_t dword; 34 | } _address; 35 | 36 | // Access the raw byte array containing the address. Because this returns a pointer 37 | // to the internal structure rather than a copy of the address this function should only 38 | // be used when you know that the usage of the returned uint8_t* will be transient and not 39 | // stored. 40 | uint8_t* raw_address() { return _address.bytes; }; 41 | 42 | public: 43 | // Constructors 44 | IPAddress(); 45 | IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); 46 | IPAddress(uint32_t address); 47 | IPAddress(const uint8_t *address); 48 | 49 | bool fromString(const char *address); 50 | bool fromString(const String &address) { return fromString(address.c_str()); } 51 | 52 | // Overloaded cast operator to allow IPAddress objects to be used where a pointer 53 | // to a four-byte uint8_t array is expected 54 | operator uint32_t() const { return _address.dword; }; 55 | bool operator==(const IPAddress& addr) const { return _address.dword == addr._address.dword; }; 56 | bool operator==(const uint8_t* addr) const; 57 | 58 | // Overloaded index operator to allow getting and setting individual octets of the address 59 | uint8_t operator[](int index) const { return _address.bytes[index]; }; 60 | uint8_t& operator[](int index) { return _address.bytes[index]; }; 61 | 62 | // Overloaded copy operators to allow initialisation of IPAddress objects from other types 63 | IPAddress& operator=(const uint8_t *address); 64 | IPAddress& operator=(uint32_t address); 65 | 66 | virtual size_t printTo(Print& p) const; 67 | 68 | friend class EthernetClass; 69 | friend class UDP; 70 | friend class Client; 71 | friend class Server; 72 | friend class DhcpClass; 73 | friend class DNSClient; 74 | }; 75 | 76 | const IPAddress INADDR_NONE(0,0,0,0); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /cores/stm32l4/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef Print_h 20 | #define Print_h 21 | 22 | #include 23 | #include // for size_t 24 | 25 | #include "WString.h" 26 | #include "Printable.h" 27 | 28 | #define DEC 10 29 | #define HEX 16 30 | #define OCT 8 31 | #define BIN 2 32 | 33 | class Print 34 | { 35 | private: 36 | int write_error; 37 | size_t printNumber(unsigned long, uint8_t); 38 | size_t printFloat(double, uint8_t); 39 | protected: 40 | void setWriteError(int err = 1) { write_error = err; } 41 | public: 42 | Print() : write_error(0) {} 43 | 44 | int getWriteError() { return write_error; } 45 | void clearWriteError() { setWriteError(0); } 46 | 47 | virtual size_t write(uint8_t) = 0; 48 | size_t write(const char *str) { 49 | if (str == NULL) return 0; 50 | return write((const uint8_t *)str, strlen(str)); 51 | } 52 | virtual size_t write(const uint8_t *buffer, size_t size); 53 | size_t write(const char *buffer, size_t size) { 54 | return write((const uint8_t *)buffer, size); 55 | } 56 | 57 | size_t print(const __FlashStringHelper *); 58 | size_t print(const String &); 59 | size_t print(const char[]); 60 | size_t print(char); 61 | size_t print(unsigned char, int = DEC); 62 | size_t print(int, int = DEC); 63 | size_t print(unsigned int, int = DEC); 64 | size_t print(long, int = DEC); 65 | size_t print(unsigned long, int = DEC); 66 | size_t print(double, int = 2); 67 | size_t print(const Printable&); 68 | 69 | size_t println(const __FlashStringHelper *); 70 | size_t println(const String &s); 71 | size_t println(const char[]); 72 | size_t println(char); 73 | size_t println(unsigned char, int = DEC); 74 | size_t println(int, int = DEC); 75 | size_t println(unsigned int, int = DEC); 76 | size_t println(long, int = DEC); 77 | size_t println(unsigned long, int = DEC); 78 | size_t println(double, int = 2); 79 | size_t println(const Printable&); 80 | size_t println(void); 81 | }; 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /cores/stm32l4/Printable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef Printable_h 20 | #define Printable_h 21 | 22 | #include 23 | 24 | class Print; 25 | 26 | /** The Printable class provides a way for new classes to allow themselves to be printed. 27 | By deriving from Printable and implementing the printTo method, it will then be possible 28 | for users to print out instances of this class by passing them into the usual 29 | Print::print and Print::println methods. 30 | */ 31 | 32 | class Printable 33 | { 34 | public: 35 | virtual size_t printTo(Print& p) const = 0; 36 | }; 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /cores/stm32l4/RingBuffer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #include "RingBuffer.h" 20 | #include 21 | 22 | RingBuffer::RingBuffer( void ) 23 | { 24 | memset( _aucBuffer, 0, SERIAL_BUFFER_SIZE ) ; 25 | clear(); 26 | } 27 | 28 | void RingBuffer::store_char( uint8_t c ) 29 | { 30 | int i = nextIndex(_iHead); 31 | 32 | // if we should be storing the received character into the location 33 | // just before the tail (meaning that the head would advance to the 34 | // current location of the tail), we're about to overflow the buffer 35 | // and so we don't write the character or advance the head. 36 | if ( i != _iTail ) 37 | { 38 | _aucBuffer[_iHead] = c ; 39 | _iHead = i ; 40 | } 41 | } 42 | 43 | void RingBuffer::clear() 44 | { 45 | _iHead = 0; 46 | _iTail = 0; 47 | } 48 | 49 | int RingBuffer::read_char() 50 | { 51 | if(_iTail == _iHead) 52 | return -1; 53 | 54 | uint8_t value = _aucBuffer[_iTail]; 55 | _iTail = nextIndex(_iTail); 56 | 57 | return value; 58 | } 59 | 60 | int RingBuffer::available() 61 | { 62 | int delta = _iHead - _iTail; 63 | 64 | if(delta < 0) 65 | return SERIAL_BUFFER_SIZE + delta; 66 | else 67 | return delta; 68 | } 69 | 70 | int RingBuffer::peek() 71 | { 72 | if(_iTail == _iHead) 73 | return -1; 74 | 75 | return _aucBuffer[_iTail]; 76 | } 77 | 78 | int RingBuffer::nextIndex(int index) 79 | { 80 | return (uint32_t)(index + 1) % SERIAL_BUFFER_SIZE; 81 | } 82 | 83 | bool RingBuffer::isFull() 84 | { 85 | return (nextIndex(_iHead) == _iTail); 86 | } 87 | -------------------------------------------------------------------------------- /cores/stm32l4/RingBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef _RING_BUFFER_ 20 | #define _RING_BUFFER_ 21 | 22 | #include 23 | 24 | // Define constants and variables for buffering incoming serial data. We're 25 | // using a ring buffer (I think), in which head is the index of the location 26 | // to which to write the next incoming character and tail is the index of the 27 | // location from which to read. 28 | #define SERIAL_BUFFER_SIZE 64 29 | 30 | class RingBuffer 31 | { 32 | public: 33 | uint8_t _aucBuffer[SERIAL_BUFFER_SIZE] ; 34 | int _iHead ; 35 | int _iTail ; 36 | 37 | public: 38 | RingBuffer( void ) ; 39 | void store_char( uint8_t c ) ; 40 | void clear(); 41 | int read_char(); 42 | int available(); 43 | int peek(); 44 | bool isFull(); 45 | 46 | private: 47 | int nextIndex(int index); 48 | } ; 49 | 50 | #endif /* _RING_BUFFER_ */ 51 | -------------------------------------------------------------------------------- /cores/stm32l4/STM32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #ifndef STM32_H 30 | #define STM32_H 31 | 32 | #include 33 | 34 | #define RESET_POWERON 0 35 | #define RESET_EXTERNAL 1 36 | #define RESET_SOFTWARE 2 37 | #define RESET_WATCHDOG 3 38 | #define RESET_BROWNOUT 4 39 | #define RESET_FIREWALL 5 40 | #define RESET_OTHER 6 41 | #define RESET_STANDBY 7 42 | 43 | #define WAKEUP_WKUP1 0x00000001 44 | #define WAKEUP_WKUP2 0x00000002 45 | #define WAKEUP_WKUP3 0x00000004 46 | #define WAKEUP_WKUP4 0x00000008 47 | #define WAKEUP_WKUP5 0x00000010 48 | #define WAKEUP_WATCHDOG 0x00000100 49 | #define WAKEUP_ALARM 0x00000200 50 | #define WAKEUP_SYNC 0x00000400 51 | #define WAKEUP_TIMEOUT 0x00000800 52 | 53 | #define FLASHSTART ((uint32_t)(&__FlashBase)) 54 | #define FLASHEND ((uint32_t)(&__FlashLimit)) 55 | 56 | class STM32Class { 57 | public: 58 | uint64_t getSerial(); 59 | void getUID(uint32_t uid[3]); 60 | 61 | float getVBAT(); 62 | float getVREF(); 63 | float getTemperature(); 64 | 65 | uint32_t resetCause(); 66 | uint32_t wakeupReason(); 67 | 68 | void sleep(); 69 | bool stop(uint32_t timeout = 0); 70 | void standby(uint32_t timeout = 0); 71 | void standby(uint32_t pin, uint32_t mode, uint32_t timeout = 0); 72 | void shutdown(uint32_t timeout = 0); 73 | void shutdown(uint32_t pin, uint32_t mode, uint32_t timeout = 0); 74 | void reset(); 75 | 76 | void wdtEnable(uint32_t timeout); 77 | void wdtReset(); 78 | 79 | bool flashErase(uint32_t address, uint32_t count); 80 | bool flashProgram(uint32_t address, const void *data, uint32_t count); 81 | 82 | void lsco(bool enable); 83 | }; 84 | 85 | extern STM32Class STM32; 86 | 87 | #endif // STM32_H 88 | -------------------------------------------------------------------------------- /cores/stm32l4/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server : public Print { 26 | public: 27 | virtual void begin() =0; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /cores/stm32l4/WMath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | extern "C" { 20 | #include "stdlib.h" 21 | #include "stdint.h" 22 | } 23 | #include "WMath.h" 24 | 25 | extern void randomSeed( uint32_t dwSeed ) 26 | { 27 | if ( dwSeed != 0 ) 28 | { 29 | srand( dwSeed ) ; 30 | } 31 | } 32 | 33 | extern long random( long howbig ) 34 | { 35 | if ( howbig == 0 ) 36 | { 37 | return 0 ; 38 | } 39 | 40 | return rand() % howbig; 41 | } 42 | 43 | extern long random( long howsmall, long howbig ) 44 | { 45 | if (howsmall >= howbig) 46 | { 47 | return howsmall; 48 | } 49 | 50 | long diff = howbig - howsmall; 51 | 52 | return random(diff) + howsmall; 53 | } 54 | 55 | extern long map(long x, long in_min, long in_max, long out_min, long out_max) 56 | { 57 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 58 | } 59 | 60 | extern uint16_t makeWord( uint16_t w ) 61 | { 62 | return w ; 63 | } 64 | 65 | extern uint16_t makeWord( uint8_t h, uint8_t l ) 66 | { 67 | return (h << 8) | l ; 68 | } 69 | -------------------------------------------------------------------------------- /cores/stm32l4/WMath.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef _WIRING_MATH_ 20 | #define _WIRING_MATH_ 21 | 22 | extern long random( long ) ; 23 | extern long random( long, long ) ; 24 | extern void randomSeed( uint32_t dwSeed ) ; 25 | extern long map( long, long, long, long, long ) ; 26 | 27 | extern uint16_t makeWord( uint16_t w ) ; 28 | extern uint16_t makeWord( uint8_t h, uint8_t l ) ; 29 | 30 | #define word(...) makeWord(__VA_ARGS__) 31 | 32 | 33 | #endif /* _WIRING_MATH_ */ 34 | -------------------------------------------------------------------------------- /cores/stm32l4/abi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 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 | #include 20 | 21 | extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); 22 | extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); 23 | 24 | void __cxa_pure_virtual(void) { 25 | // We might want to write some diagnostics to uart in this case 26 | //std::terminate(); 27 | while (1) 28 | ; 29 | } 30 | 31 | void __cxa_deleted_virtual(void) { 32 | // We might want to write some diagnostics to uart in this case 33 | //std::terminate(); 34 | while (1) 35 | ; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /cores/stm32l4/avr/dtostrf.c: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2015 Arduino LLC. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | 22 | char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { 23 | asm(".global _printf_float"); 24 | 25 | char fmt[20]; 26 | sprintf(fmt, "%%%d.%df", width, prec); 27 | sprintf(sout, fmt, val); 28 | return sout; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /cores/stm32l4/avr/dtostrf.h: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2015 Arduino LLC. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | char *dtostrf(double val, signed char width, unsigned char prec, char *sout); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /cores/stm32l4/avr/eeprom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #ifndef _AVR_EEPROM_H_ 30 | #define _AVR_EEPROM_H_ 1 31 | 32 | #include 33 | #include 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | uint8_t eeprom_read_byte(const uint8_t *address) __attribute__ ((pure)); 40 | uint16_t eeprom_read_word(const uint16_t *address) __attribute__ ((pure)); 41 | uint32_t eeprom_read_dword(const uint32_t *address) __attribute__ ((pure)); 42 | float eeprom_read_float(const float *address) __attribute__ ((pure)); 43 | void eeprom_read_block(void *data, const void *address, uint32_t count); 44 | void eeprom_write_byte(uint8_t *address, uint8_t data); 45 | void eeprom_write_word(uint16_t *address, uint16_t data); 46 | void eeprom_write_dword(uint32_t *address, uint32_t data); 47 | void eeprom_write_float(float *address, float data); 48 | void eeprom_write_block(const void *data, void *address, uint32_t count); 49 | int eeprom_is_ready(void); 50 | #define eeprom_busy_wait() do {} while (!eeprom_is_ready()) 51 | 52 | static inline void eeprom_update_byte(uint8_t *address, uint8_t data) 53 | { 54 | eeprom_write_byte(address, data); 55 | } 56 | 57 | static inline void eeprom_update_word(uint16_t *address, uint16_t data) 58 | { 59 | eeprom_write_word(address, data); 60 | } 61 | 62 | static inline void eeprom_update_dword(uint32_t *address, uint32_t data) 63 | { 64 | eeprom_write_dword(address, data); 65 | } 66 | 67 | static inline void eeprom_update_float(float *address, float data) 68 | { 69 | eeprom_write_float(address, data); 70 | } 71 | 72 | static inline void eeprom_update_block(const void *data, void *address, uint32_t count) 73 | { 74 | eeprom_write_block(data, address, count); 75 | } 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* !_AVR_EEPROM_H_ */ 82 | -------------------------------------------------------------------------------- /cores/stm32l4/avr/fdevopen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | extern int (*stm32l4_stdio_put)(char, FILE*); 36 | extern int (*stm32l4_stdio_get)(FILE*); 37 | 38 | FILE * fdevopen(int(*put)(char, FILE *), int(*get)(FILE *)) 39 | { 40 | if (put != NULL) 41 | { 42 | stm32l4_stdio_put = (void*)put; 43 | 44 | return stdout; 45 | } 46 | 47 | if (get != NULL) 48 | { 49 | stm32l4_stdio_get = get; 50 | 51 | return stdin; 52 | } 53 | 54 | return NULL; 55 | } 56 | -------------------------------------------------------------------------------- /cores/stm32l4/avr/interrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LCC. 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 | /* 20 | Empty file. 21 | This file is here to allow compatibility with sketches (made for AVR) 22 | that includes 23 | */ 24 | -------------------------------------------------------------------------------- /cores/stm32l4/avr/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | io.h - Definitions for compatibility with AVR io macros 3 | 4 | Copyright (c) 2016 Arduino LLC 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE 23 | */ 24 | 25 | #ifndef _IO_H_ 26 | #define _IO_H_ 27 | 28 | #define RAMSTART 0x20000000 29 | #define RAMSIZE (96 * 1024) 30 | #define RAMEND (RAMSTART + RAMSIZE - 1) 31 | 32 | #define E2END 0x3ff 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /cores/stm32l4/hooks.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | /** 20 | * Empty yield() hook. 21 | * 22 | * This function is intended to be used by library writers to build 23 | * libraries or sketches that supports cooperative threads. 24 | * 25 | * Its defined as a weak symbol and it can be redefined to implement a 26 | * real cooperative scheduler. 27 | */ 28 | static void __empty() { 29 | // Empty 30 | } 31 | void yield(void) __attribute__ ((weak, alias("__empty"))); 32 | -------------------------------------------------------------------------------- /cores/stm32l4/itoa.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | extern "C"{ 23 | #endif 24 | 25 | //extern void itoa( int n, char s[] ) ; 26 | 27 | extern char* itoa( int value, char *string, int radix ) ; 28 | extern char* ltoa( long value, char *string, int radix ) ; 29 | extern char* utoa( unsigned value, char *string, int radix ) ; 30 | extern char* ultoa( unsigned long value, char *string, int radix ) ; 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /cores/stm32l4/new.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #include 20 | 21 | void *operator new(size_t size) { 22 | return malloc(size); 23 | } 24 | 25 | void *operator new[](size_t size) { 26 | return malloc(size); 27 | } 28 | 29 | void operator delete(void * ptr) { 30 | free(ptr); 31 | } 32 | 33 | void operator delete[](void * ptr) { 34 | free(ptr); 35 | } 36 | 37 | 38 | #if __cpp_sized_deallocation 39 | 40 | void operator delete(void* ptr, std::size_t) _GLIBCXX_USE_NOEXCEPT { 41 | free(ptr); 42 | } 43 | 44 | void operator delete[](void* ptr, std::size_t) _GLIBCXX_USE_NOEXCEPT { 45 | free(ptr); 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /cores/stm32l4/stm32l4_wiring_interrupts.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #include "Arduino.h" 30 | #include "stm32l4_wiring_private.h" 31 | 32 | #include 33 | 34 | void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode) 35 | { 36 | if (!(g_APinDescription[pin].attr & PIN_ATTR_EXTI)) 37 | return; 38 | 39 | switch (mode) { 40 | 41 | case CHANGE: 42 | stm32l4_exti_notify(&stm32l4_exti, g_APinDescription[pin].pin, EXTI_CONTROL_BOTH_EDGES, (stm32l4_exti_callback_t)callback, NULL); 43 | break; 44 | 45 | case FALLING: 46 | stm32l4_exti_notify(&stm32l4_exti, g_APinDescription[pin].pin, EXTI_CONTROL_FALLING_EDGE, (stm32l4_exti_callback_t)callback, NULL); 47 | break; 48 | 49 | case RISING: 50 | stm32l4_exti_notify(&stm32l4_exti, g_APinDescription[pin].pin, EXTI_CONTROL_RISING_EDGE, (stm32l4_exti_callback_t)callback, NULL); 51 | break; 52 | } 53 | } 54 | 55 | void detachInterrupt(uint32_t pin) 56 | { 57 | if (!(g_APinDescription[pin].attr & PIN_ATTR_EXTI)) 58 | return; 59 | 60 | stm32l4_exti_notify(&stm32l4_exti, g_APinDescription[pin].pin, EXTI_CONTROL_DISABLE, NULL, NULL); 61 | } 62 | 63 | -------------------------------------------------------------------------------- /cores/stm32l4/stm32l4_wiring_pulse.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 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 | #include "Arduino.h" 20 | #include "stm32l4_wiring_private.h" 21 | #include 22 | 23 | static inline __attribute__((optimize("O3"),always_inline)) uint32_t countPulseInline(const volatile uint32_t *port, uint32_t bit, uint32_t stateMask, unsigned long maxloops) 24 | { 25 | uint32_t micros; 26 | 27 | // wait for any previous pulse to end 28 | while ((*port & bit) == stateMask) 29 | { 30 | if (--maxloops == 0) 31 | { 32 | return 0; 33 | } 34 | } 35 | 36 | // wait for the pulse to start 37 | while ((*port & bit) != stateMask) 38 | { 39 | if (--maxloops == 0) 40 | { 41 | return 0; 42 | } 43 | } 44 | 45 | micros = armv7m_systick_micros(); 46 | 47 | // wait for the pulse to stop 48 | while ((*port & bit) == stateMask) 49 | { 50 | if (--maxloops == 0) 51 | { 52 | return 0; 53 | } 54 | } 55 | 56 | return (uint32_t)armv7m_systick_micros() - micros; 57 | } 58 | 59 | /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH 60 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 61 | * to 3 minutes in length, but must be called at least a few dozen microseconds 62 | * before the start of the pulse. */ 63 | uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout) 64 | { 65 | if (g_APinDescription[pin].GPIO == NULL) 66 | { 67 | return 0; 68 | } 69 | 70 | // cache the port and bit of the pin in order to speed up the 71 | // pulse width measuring loop and achieve finer resolution. calling 72 | // digitalRead() instead yields much coarser resolution. 73 | GPIO_TypeDef *GPIO = g_APinDescription[pin].GPIO; 74 | uint32_t bit = g_APinDescription[pin].bit; 75 | uint32_t stateMask = state ? bit : 0; 76 | 77 | // convert the timeout from microseconds to a number of times through 78 | // the initial loop; it takes (roughly) 8 clock cycles per iteration. 79 | uint32_t maxloops = microsecondsToClockCycles(timeout) / 8; 80 | 81 | return countPulseInline(&GPIO->IDR, bit, stateMask, maxloops); 82 | } 83 | 84 | -------------------------------------------------------------------------------- /cores/stm32l4/stm32l4_wiring_shift.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #include "Arduino.h" 30 | #include "stm32l4_wiring_private.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C"{ 34 | #endif 35 | 36 | uint32_t shiftIn( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder ) 37 | { 38 | uint8_t value = 0 ; 39 | uint8_t i ; 40 | 41 | for ( i=0 ; i < 8 ; ++i ) 42 | { 43 | digitalWrite( ulClockPin, HIGH ) ; 44 | 45 | if ( ulBitOrder == LSBFIRST ) 46 | { 47 | value |= digitalRead( ulDataPin ) << i ; 48 | } 49 | else 50 | { 51 | value |= digitalRead( ulDataPin ) << (7 - i) ; 52 | } 53 | 54 | digitalWrite( ulClockPin, LOW ) ; 55 | } 56 | 57 | return value ; 58 | } 59 | 60 | void shiftOut( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder, uint32_t ulVal ) 61 | { 62 | uint8_t i ; 63 | 64 | for ( i=0 ; i < 8 ; i++ ) 65 | { 66 | if ( ulBitOrder == LSBFIRST ) 67 | { 68 | digitalWrite( ulDataPin, !!(ulVal & (1 << i)) ) ; 69 | } 70 | else 71 | { 72 | digitalWrite( ulDataPin, !!(ulVal & (1 << (7 - i))) ) ; 73 | } 74 | 75 | digitalWrite( ulClockPin, HIGH ) ; 76 | digitalWrite( ulClockPin, LOW ) ; 77 | } 78 | } 79 | 80 | #ifdef __cplusplus 81 | } // extern "C" 82 | #endif 83 | -------------------------------------------------------------------------------- /drivers/linux/49-butterfly.rules: -------------------------------------------------------------------------------- 1 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6668", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6668", ENV{MTP_NO_PROBE}="1" 3 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6668", ENV{UDISKS_AUTO}="0" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6668", MODE:="0666" 5 | KERNEL=="ttyACM*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6668", MODE:="0666" 6 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666" 7 | -------------------------------------------------------------------------------- /drivers/linux/49-dragonfly.rules: -------------------------------------------------------------------------------- 1 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6666", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6666", ENV{MTP_NO_PROBE}="1" 3 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6666", ENV{UDISKS_AUTO}="0" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6666", MODE:="0666" 5 | KERNEL=="ttyACM*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6666", MODE:="0666" 6 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6667", ENV{ID_MM_DEVICE_IGNORE}="1" 7 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6667", ENV{MTP_NO_PROBE}="1" 8 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6667", ENV{UDISKS_AUTO}="0" 9 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6667", MODE:="0666" 10 | KERNEL=="ttyACM*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6667", MODE:="0666" 11 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666" 12 | -------------------------------------------------------------------------------- /drivers/linux/49-ladybug.rules: -------------------------------------------------------------------------------- 1 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6669", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6669", ENV{MTP_NO_PROBE}="1" 3 | ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6669", ENV{UDISKS_AUTO}="0" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6669", MODE:="0666" 5 | KERNEL=="ttyACM*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6669", MODE:="0666" 6 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666" 7 | -------------------------------------------------------------------------------- /drivers/linux/49-nucleo.rules: -------------------------------------------------------------------------------- 1 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", ENV{MTP_NO_PROBE}="1" 3 | ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", ENV{UDISKS_AUTO}="0" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE:="0666" 5 | KERNEL=="ttyACM*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE:="0666" 6 | -------------------------------------------------------------------------------- /drivers/windows/dpinst.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /drivers/windows/dpinst_amd64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/drivers/windows/dpinst_amd64.exe -------------------------------------------------------------------------------- /drivers/windows/dpinst_x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/drivers/windows/dpinst_x86.exe -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM Clear 3 | * 4 | * Sets all of the bytes of the EEPROM to 0. 5 | * Please see eeprom_iteration for a more in depth 6 | * look at how to traverse the EEPROM. 7 | * 8 | * This example code is in the public domain. 9 | */ 10 | 11 | #include 12 | 13 | void setup() { 14 | // initialize the LED pin as an output. 15 | pinMode(13, OUTPUT); 16 | 17 | /*** 18 | Iterate through each byte of the EEPROM storage. 19 | 20 | Larger AVR processors have larger EEPROM sizes, E.g: 21 | - Arduno Duemilanove: 512b EEPROM storage. 22 | - Arduino Uno: 1kb EEPROM storage. 23 | - Arduino Mega: 4kb EEPROM storage. 24 | 25 | Rather than hard-coding the length, you should use the pre-provided length function. 26 | This will make your code portable to all AVR processors. 27 | ***/ 28 | 29 | for (int i = 0 ; i < EEPROM.length() ; i++) { 30 | EEPROM.write(i, 0); 31 | } 32 | 33 | // turn the LED on when we're done 34 | digitalWrite(13, HIGH); 35 | } 36 | 37 | void loop() { 38 | /** Empty loop. **/ 39 | } 40 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_crc/eeprom_crc.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | Written by Christopher Andrews. 3 | CRC algorithm generated by pycrc, MIT licence ( https://github.com/tpircher/pycrc ). 4 | 5 | A CRC is a simple way of checking whether data has changed or become corrupted. 6 | This example calculates a CRC value directly on the EEPROM values. 7 | The purpose of this example is to highlight how the EEPROM object can be used just like an array. 8 | ***/ 9 | 10 | #include 11 | #include 12 | 13 | void setup() { 14 | 15 | //Start serial 16 | Serial.begin(9600); 17 | while (!Serial) { 18 | ; // wait for serial port to connect. Needed for native USB port only 19 | } 20 | 21 | //Print length of data to run CRC on. 22 | Serial.print("EEPROM length: "); 23 | Serial.println(EEPROM.length()); 24 | 25 | //Print the result of calling eeprom_crc() 26 | Serial.print("CRC32 of EEPROM data: 0x"); 27 | Serial.println(eeprom_crc(), HEX); 28 | Serial.print("\n\nDone!"); 29 | } 30 | 31 | void loop() { 32 | /* Empty loop */ 33 | } 34 | 35 | unsigned long eeprom_crc(void) { 36 | 37 | const unsigned long crc_table[16] = { 38 | 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 39 | 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, 40 | 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 41 | 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c 42 | }; 43 | 44 | unsigned long crc = ~0L; 45 | 46 | for (int index = 0 ; index < EEPROM.length() ; ++index) { 47 | crc = crc_table[(crc ^ EEPROM[index]) & 0x0f] ^ (crc >> 4); 48 | crc = crc_table[(crc ^ (EEPROM[index] >> 4)) & 0x0f] ^ (crc >> 4); 49 | crc = ~crc; 50 | } 51 | return crc; 52 | } 53 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_get/eeprom_get.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | eeprom_get example. 3 | 4 | This shows how to use the EEPROM.get() method. 5 | 6 | To pre-set the EEPROM data, run the example sketch eeprom_put. 7 | This sketch will run without it, however, the values shown 8 | will be shown from what ever is already on the EEPROM. 9 | 10 | This may cause the serial object to print out a large string 11 | of garbage if there is no null character inside one of the strings 12 | loaded. 13 | 14 | Written by Christopher Andrews 2015 15 | Released under MIT licence. 16 | ***/ 17 | 18 | #include 19 | 20 | void setup() { 21 | 22 | float f = 0.00f; //Variable to store data read from EEPROM. 23 | int eeAddress = 0; //EEPROM address to start reading from 24 | 25 | Serial.begin(9600); 26 | while (!Serial) { 27 | ; // wait for serial port to connect. Needed for native USB port only 28 | } 29 | Serial.print("Read float from EEPROM: "); 30 | 31 | //Get the float data from the EEPROM at position 'eeAddress' 32 | EEPROM.get(eeAddress, f); 33 | Serial.println(f, 3); //This may print 'ovf, nan' if the data inside the EEPROM is not a valid float. 34 | 35 | /*** 36 | As get also returns a reference to 'f', you can use it inline. 37 | E.g: Serial.print( EEPROM.get( eeAddress, f ) ); 38 | ***/ 39 | 40 | /*** 41 | Get can be used with custom structures too. 42 | I have separated this into an extra function. 43 | ***/ 44 | 45 | secondTest(); //Run the next test. 46 | } 47 | 48 | struct MyObject { 49 | float field1; 50 | byte field2; 51 | char name[10]; 52 | }; 53 | 54 | void secondTest() { 55 | int eeAddress = sizeof(float); //Move address to the next byte after float 'f'. 56 | 57 | MyObject customVar; //Variable to store custom object read from EEPROM. 58 | EEPROM.get(eeAddress, customVar); 59 | 60 | Serial.println("Read custom object from EEPROM: "); 61 | Serial.println(customVar.field1); 62 | Serial.println(customVar.field2); 63 | Serial.println(customVar.name); 64 | } 65 | 66 | void loop() { 67 | /* Empty loop */ 68 | } 69 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | eeprom_iteration example. 3 | 4 | A set of example snippets highlighting the 5 | simplest methods for traversing the EEPROM. 6 | 7 | Running this sketch is not necessary, this is 8 | simply highlighting certain programming methods. 9 | 10 | Written by Christopher Andrews 2015 11 | Released under MIT licence. 12 | ***/ 13 | 14 | #include 15 | 16 | void setup() { 17 | 18 | /*** 19 | Iterate the EEPROM using a for loop. 20 | ***/ 21 | 22 | for (int index = 0 ; index < EEPROM.length() ; index++) { 23 | 24 | //Add one to each cell in the EEPROM 25 | EEPROM[ index ] += 1; 26 | } 27 | 28 | /*** 29 | Iterate the EEPROM using a while loop. 30 | ***/ 31 | 32 | int index = 0; 33 | 34 | while (index < EEPROM.length()) { 35 | 36 | //Add one to each cell in the EEPROM 37 | EEPROM[ index ] += 1; 38 | index++; 39 | } 40 | 41 | /*** 42 | Iterate the EEPROM using a do-while loop. 43 | ***/ 44 | 45 | int idx = 0; //Used 'idx' to avoid name conflict with 'index' above. 46 | 47 | do { 48 | 49 | //Add one to each cell in the EEPROM 50 | EEPROM[ idx ] += 1; 51 | idx++; 52 | } while (idx < EEPROM.length()); 53 | 54 | 55 | } //End of setup function. 56 | 57 | void loop() {} -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_put/eeprom_put.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | eeprom_put example. 3 | 4 | This shows how to use the EEPROM.put() method. 5 | Also, this sketch will pre-set the EEPROM data for the 6 | example sketch eeprom_get. 7 | 8 | Note, unlike the single byte version EEPROM.write(), 9 | the put method will use update semantics. As in a byte 10 | will only be written to the EEPROM if the data is actually 11 | different. 12 | 13 | Written by Christopher Andrews 2015 14 | Released under MIT licence. 15 | ***/ 16 | 17 | #include 18 | 19 | struct MyObject { 20 | float field1; 21 | byte field2; 22 | char name[10]; 23 | }; 24 | 25 | void setup() { 26 | 27 | Serial.begin(9600); 28 | while (!Serial) { 29 | ; // wait for serial port to connect. Needed for native USB port only 30 | } 31 | 32 | float f = 123.456f; //Variable to store in EEPROM. 33 | int eeAddress = 0; //Location we want the data to be put. 34 | 35 | 36 | //One simple call, with the address first and the object second. 37 | EEPROM.put(eeAddress, f); 38 | 39 | Serial.println("Written float data type!"); 40 | 41 | /** Put is designed for use with custom structures also. **/ 42 | 43 | //Data to store. 44 | MyObject customVar = { 45 | 3.14f, 46 | 65, 47 | "Working!" 48 | }; 49 | 50 | eeAddress += sizeof(float); //Move address to the next byte after float 'f'. 51 | 52 | EEPROM.put(eeAddress, customVar); 53 | Serial.print("Written custom data type! \n\nView the example sketch eeprom_get to see how you can retrieve the values!"); 54 | } 55 | 56 | void loop() { 57 | /* Empty loop */ 58 | } 59 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_read/eeprom_read.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM Read 3 | * 4 | * Reads the value of each byte of the EEPROM and prints it 5 | * to the computer. 6 | * This example code is in the public domain. 7 | */ 8 | 9 | #include 10 | 11 | // start reading from the first byte (address 0) of the EEPROM 12 | int address = 0; 13 | byte value; 14 | 15 | void setup() { 16 | // initialize serial and wait for port to open: 17 | Serial.begin(9600); 18 | while (!Serial) { 19 | ; // wait for serial port to connect. Needed for native USB port only 20 | } 21 | } 22 | 23 | void loop() { 24 | // read a byte from the current address of the EEPROM 25 | value = EEPROM.read(address); 26 | 27 | Serial.print(address); 28 | Serial.print("\t"); 29 | Serial.print(value, DEC); 30 | Serial.println(); 31 | 32 | /*** 33 | Advance to the next address, when at the end restart at the beginning. 34 | 35 | Larger AVR processors have larger EEPROM sizes, E.g: 36 | - Arduno Duemilanove: 512b EEPROM storage. 37 | - Arduino Uno: 1kb EEPROM storage. 38 | - Arduino Mega: 4kb EEPROM storage. 39 | 40 | Rather than hard-coding the length, you should use the pre-provided length function. 41 | This will make your code portable to all AVR processors. 42 | ***/ 43 | address = address + 1; 44 | if (address == EEPROM.length()) { 45 | address = 0; 46 | } 47 | 48 | /*** 49 | As the EEPROM sizes are powers of two, wrapping (preventing overflow) of an 50 | EEPROM address is also doable by a bitwise and of the length - 1. 51 | 52 | ++address &= EEPROM.length() - 1; 53 | ***/ 54 | 55 | delay(500); 56 | } 57 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_update/eeprom_update.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | EEPROM Update method 3 | 4 | Stores values read from analog input 0 into the EEPROM. 5 | These values will stay in the EEPROM when the board is 6 | turned off and may be retrieved later by another sketch. 7 | 8 | If a value has not changed in the EEPROM, it is not overwritten 9 | which would reduce the life span of the EEPROM unnecessarily. 10 | 11 | Released using MIT licence. 12 | ***/ 13 | 14 | #include 15 | 16 | /** the current address in the EEPROM (i.e. which byte we're going to write to next) **/ 17 | int address = 0; 18 | 19 | void setup() { 20 | /** EMpty setup **/ 21 | } 22 | 23 | void loop() { 24 | /*** 25 | need to divide by 4 because analog inputs range from 26 | 0 to 1023 and each byte of the EEPROM can only hold a 27 | value from 0 to 255. 28 | ***/ 29 | int val = analogRead(0) / 4; 30 | 31 | /*** 32 | Update the particular EEPROM cell. 33 | these values will remain there when the board is 34 | turned off. 35 | ***/ 36 | EEPROM.update(address, val); 37 | 38 | /*** 39 | The function EEPROM.update(address, val) is equivalent to the following: 40 | 41 | if( EEPROM.read(address) != val ){ 42 | EEPROM.write(address, val); 43 | } 44 | ***/ 45 | 46 | 47 | /*** 48 | Advance to the next address, when at the end restart at the beginning. 49 | 50 | Larger AVR processors have larger EEPROM sizes, E.g: 51 | - Arduno Duemilanove: 512b EEPROM storage. 52 | - Arduino Uno: 1kb EEPROM storage. 53 | - Arduino Mega: 4kb EEPROM storage. 54 | 55 | Rather than hard-coding the length, you should use the pre-provided length function. 56 | This will make your code portable to all AVR processors. 57 | ***/ 58 | address = address + 1; 59 | if (address == EEPROM.length()) { 60 | address = 0; 61 | } 62 | 63 | /*** 64 | As the EEPROM sizes are powers of two, wrapping (preventing overflow) of an 65 | EEPROM address is also doable by a bitwise and of the length - 1. 66 | 67 | ++address &= EEPROM.length() - 1; 68 | ***/ 69 | 70 | delay(100); 71 | } 72 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_write/eeprom_write.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM Write 3 | * 4 | * Stores values read from analog input 0 into the EEPROM. 5 | * These values will stay in the EEPROM when the board is 6 | * turned off and may be retrieved later by another sketch. 7 | */ 8 | 9 | #include 10 | 11 | /** the current address in the EEPROM (i.e. which byte we're going to write to next) **/ 12 | int addr = 0; 13 | 14 | void setup() { 15 | /** Empty setup. **/ 16 | } 17 | 18 | void loop() { 19 | /*** 20 | Need to divide by 4 because analog inputs range from 21 | 0 to 1023 and each byte of the EEPROM can only hold a 22 | value from 0 to 255. 23 | ***/ 24 | 25 | int val = analogRead(0) / 4; 26 | 27 | /*** 28 | Write the value to the appropriate byte of the EEPROM. 29 | these values will remain there when the board is 30 | turned off. 31 | ***/ 32 | 33 | EEPROM.write(addr, val); 34 | 35 | /*** 36 | Advance to the next address, when at the end restart at the beginning. 37 | 38 | Larger AVR processors have larger EEPROM sizes, E.g: 39 | - Arduno Duemilanove: 512b EEPROM storage. 40 | - Arduino Uno: 1kb EEPROM storage. 41 | - Arduino Mega: 4kb EEPROM storage. 42 | 43 | Rather than hard-coding the length, you should use the pre-provided length function. 44 | This will make your code portable to all AVR processors. 45 | ***/ 46 | addr = addr + 1; 47 | if (addr == EEPROM.length()) { 48 | addr = 0; 49 | } 50 | 51 | /*** 52 | As the EEPROM sizes are powers of two, wrapping (preventing overflow) of an 53 | EEPROM address is also doable by a bitwise and of the length - 1. 54 | 55 | ++addr &= EEPROM.length() - 1; 56 | ***/ 57 | 58 | 59 | delay(100); 60 | } 61 | -------------------------------------------------------------------------------- /libraries/EEPROM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For EEPROM 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | EEPROM KEYWORD1 10 | EERef KEYWORD1 11 | EEPtr KEYWORD2 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | 17 | update KEYWORD2 18 | 19 | ####################################### 20 | # Constants (LITERAL1) 21 | ####################################### 22 | 23 | -------------------------------------------------------------------------------- /libraries/EEPROM/library.properties: -------------------------------------------------------------------------------- 1 | name=EEPROM 2 | version=2.0 3 | author=Arduino, Christopher Andrews 4 | maintainer=Arduino 5 | sentence=Enables reading and writing to the permanent board storage. 6 | paragraph=This library allows to read and write data in a memory type, the EEPROM, that keeps its content also when the board is powered off. The amount of EEPROM available depends on the microcontroller type. 7 | category=Data Storage 8 | url=http://www.arduino.cc/en/Reference/EEPROM 9 | architectures=stm32l4 10 | 11 | -------------------------------------------------------------------------------- /libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example reads audio data from an Invensense's ICS43432 I2S microphone 3 | breakout board, and prints out the samples to the Serial console. The 4 | Serial Plotter built into the Arduino IDE can be used to plot the audio 5 | data (Tools -> Serial Plotter) 6 | 7 | Circuit: 8 | * Arduino/Genuino Zero, MKRZero or MKR1000 board 9 | * ICS43432: 10 | * GND connected GND 11 | * 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero) 12 | * WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero) 13 | * CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero) 14 | * SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero) 15 | 16 | created 17 November 2016 17 | by Sandeep Mistry 18 | */ 19 | 20 | #include 21 | 22 | void setup() { 23 | // Open serial communications and wait for port to open: 24 | // A baud rate of 115200 is used instead of 9600 for a faster data rate 25 | // on non-native USB ports 26 | Serial.begin(115200); 27 | while (!Serial) { 28 | ; // wait for serial port to connect. Needed for native USB port only 29 | } 30 | 31 | // start I2S at 8 kHz with 32-bits per sample 32 | if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 32)) { 33 | Serial.println("Failed to initialize I2S!"); 34 | while (1); // do nothing 35 | } 36 | } 37 | 38 | void loop() { 39 | // read a sample 40 | int sample = I2S.read(); 41 | 42 | if (sample) { 43 | // if it's non-zero print value to serial 44 | Serial.println(sample); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /libraries/I2S/examples/SimpleTone/SimpleTone.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example generates a square wave based tone at a specified frequency 3 | and sample rate. Then outputs the data using the I2S interface to a 4 | MAX08357 I2S Amp Breakout board. 5 | 6 | Circuit: 7 | * Arduino/Genuino Zero, MKRZero or MKR1000 board 8 | * MAX08357: 9 | * GND connected GND 10 | * VIN connected 5V 11 | * LRC connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero) 12 | * BCLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero) 13 | * DIN connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero) 14 | 15 | created 17 November 2016 16 | by Sandeep Mistry 17 | */ 18 | 19 | #include 20 | 21 | const int frequency = 440; // frequency of square wave in Hz 22 | const int amplitude = 500; // amplitude of square wave 23 | const int sampleRate = 8000; // sample rate in Hz 24 | 25 | const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave 26 | 27 | short sample = amplitude; // current sample value 28 | int count = 0; 29 | 30 | void setup() { 31 | Serial.begin(9600); 32 | Serial.println("I2S simple tone"); 33 | 34 | // start I2S at the sample rate with 16-bits per sample 35 | if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) { 36 | Serial.println("Failed to initialize I2S!"); 37 | while (1); // do nothing 38 | } 39 | } 40 | 41 | void loop() { 42 | if (count % halfWavelength == 0) { 43 | // invert the sample every half wavelength count multiple to generate square wave 44 | sample = -1 * sample; 45 | } 46 | 47 | // write the same sample twice, once for left and once for the right channel 48 | I2S.write(sample); 49 | I2S.write(sample); 50 | 51 | // increment the counter for the next sample 52 | count++; 53 | } 54 | -------------------------------------------------------------------------------- /libraries/I2S/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map I2S 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | I2S KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | 17 | onReceive KEYWORD2 18 | onTransmit KEYWORD2 19 | 20 | ####################################### 21 | # Constants (LITERAL1) 22 | ####################################### 23 | I2S_PHILIPS_MODE LITERAL1 24 | I2S_RIGHT_JUSTIFIED_MODE LITERAL1 25 | I2S_LEFT_JUSTIFIED_MODE LITERAL1 26 | -------------------------------------------------------------------------------- /libraries/I2S/library.properties: -------------------------------------------------------------------------------- 1 | name=I2S 2 | version=1.0 3 | author=Thomas Roell 4 | maintainer=grumpyoldpizza@gmail.com 5 | sentence=Enables the communication with devices that use the Inter-IC Sound (I2S) Bus. Specific implementation for STM32L4. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/I2S 9 | architectures=stm32l4 10 | -------------------------------------------------------------------------------- /libraries/RTC/examples/Epoch/Epoch.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Epoch time example for Arduino Zero and MKR1000 3 | 4 | Demonstrates how to set time using epoch for the Arduino Zero and MKR1000 5 | 6 | This example code is in the public domain 7 | 8 | created by Sandeep Mistry 9 | 31 Dec 2015 10 | modified 11 | 18 Feb 2016 12 | */ 13 | 14 | #include 15 | 16 | void setup() { 17 | Serial.begin(9600); 18 | 19 | RTC.setEpoch(1451606400); // Jan 1, 2016 20 | } 21 | 22 | void loop() { 23 | Serial.print("Unix time = "); 24 | Serial.println(RTC.getEpoch()); 25 | 26 | Serial.print("Seconds since Jan 1 2000 = "); 27 | Serial.println(RTC.getY2kEpoch()); 28 | 29 | // Print date... 30 | Serial.print(RTC.getDay()); 31 | Serial.print("/"); 32 | Serial.print(RTC.getMonth()); 33 | Serial.print("/"); 34 | Serial.print(RTC.getYear()); 35 | Serial.print("\t"); 36 | 37 | // ...and time 38 | print2digits(RTC.getHours()); 39 | Serial.print(":"); 40 | print2digits(RTC.getMinutes()); 41 | Serial.print(":"); 42 | print2digits(RTC.getSeconds()); 43 | 44 | Serial.println(); 45 | 46 | delay(1000); 47 | } 48 | 49 | void print2digits(int number) { 50 | if (number < 10) { 51 | Serial.print("0"); 52 | } 53 | Serial.print(number); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /libraries/RTC/examples/SimpleRTC/SimpleRTC.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Simple RTC for Arduino Zero and MKR1000 3 | 4 | Demonstrates the use of the RTC library for the Arduino Zero and MKR1000 5 | 6 | This example code is in the public domain 7 | 8 | http://arduino.cc/en/Tutorial/SimpleRTC 9 | 10 | created by Arturo Guadalupi 11 | 15 Jun 2015 12 | modified 13 | 18 Feb 2016 14 | modified by Andrea Richetta 15 | 24 Aug 2016 16 | */ 17 | 18 | #include 19 | 20 | /* Change these values to set the current initial time */ 21 | const byte seconds = 0; 22 | const byte minutes = 0; 23 | const byte hours = 16; 24 | 25 | /* Change these values to set the current initial date */ 26 | const byte day = 15; 27 | const byte month = 6; 28 | const byte year = 15; 29 | 30 | void setup() 31 | { 32 | Serial.begin(9600); 33 | 34 | // Set the time 35 | RTC.setHours(hours); 36 | RTC.setMinutes(minutes); 37 | RTC.setSeconds(seconds); 38 | 39 | // Set the date 40 | RTC.setDay(day); 41 | RTC.setMonth(month); 42 | RTC.setYear(year); 43 | 44 | // you can use also 45 | //RTC.setTime(hours, minutes, seconds); 46 | //RTC.setDate(day, month, year); 47 | } 48 | 49 | void loop() 50 | { 51 | // Print date... 52 | print2digits(RTC.getDay()); 53 | Serial.print("/"); 54 | print2digits(RTC.getMonth()); 55 | Serial.print("/"); 56 | print2digits(RTC.getYear()); 57 | Serial.print(" "); 58 | 59 | // ...and time 60 | print2digits(RTC.getHours()); 61 | Serial.print(":"); 62 | print2digits(RTC.getMinutes()); 63 | Serial.print(":"); 64 | print2digits(RTC.getSeconds()); 65 | 66 | Serial.println(); 67 | 68 | delay(1000); 69 | } 70 | 71 | 72 | 73 | void print2digits(int number) { 74 | if (number < 10) { 75 | Serial.print("0"); // print a 0 before if the number is < than 10 76 | } 77 | Serial.print(number); 78 | } -------------------------------------------------------------------------------- /libraries/RTC/examples/SimpleRTCAlarm/SimpleRTCAlarm.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Simple RTC Alarm for Arduino Zero and MKR1000 3 | 4 | Demonstrates how to set an RTC alarm for the Arduino Zero and MKR1000 5 | 6 | This example code is in the public domain 7 | 8 | http://arduino.cc/en/Tutorial/SimpleRTCAlarm 9 | 10 | created by Arturo Guadalupi 11 | 25 Sept 2015 12 | 13 | modified 14 | 21 Oct 2015 15 | */ 16 | 17 | #include 18 | 19 | /* Change these values to set the current initial time */ 20 | const byte seconds = 0; 21 | const byte minutes = 0; 22 | const byte hours = 16; 23 | 24 | /* Change these values to set the current initial date */ 25 | const byte day = 25; 26 | const byte month = 9; 27 | const byte year = 15; 28 | 29 | void setup() 30 | { 31 | Serial.begin(9600); 32 | 33 | RTC.setTime(hours, minutes, seconds); 34 | RTC.setDate(day, month, year); 35 | 36 | RTC.setAlarmTime(16, 0, 10); 37 | RTC.enableAlarm(RTC.MATCH_HHMMSS); 38 | 39 | RTC.attachInterrupt(alarmMatch); 40 | } 41 | 42 | void loop() 43 | { 44 | 45 | } 46 | 47 | void alarmMatch() 48 | { 49 | Serial.println("Alarm Match!"); 50 | } 51 | -------------------------------------------------------------------------------- /libraries/RTC/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For RTC 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | RTCZero KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | getDay KEYWORD2 16 | getMonth KEYWORD2 17 | getYear KEYWORD2 18 | getHours KEYWORD2 19 | getMinutes KEYWORD2 20 | getSeconds KEYWORD2 21 | 22 | setDay KEYWORD2 23 | setMonth KEYWORD2 24 | setYear KEYWORD2 25 | setHours KEYWORD2 26 | setMinutes KEYWORD2 27 | setSeconds KEYWORD2 28 | setDate KEYWORD2 29 | setTime KEYWORD2 30 | 31 | getEpoch KEYWORD2 32 | getY2kEpoch KEYWORD2 33 | setEpoch KEYWORD2 34 | setY2kEpoch KEYWORD2 35 | 36 | getAlarmDay KEYWORD2 37 | getAlarmMonth KEYWORD2 38 | getAlarmYear KEYWORD2 39 | getAlarmHours KEYWORD2 40 | getAlarmMinutes KEYWORD2 41 | getAlarmSeconds KEYWORD2 42 | 43 | setAlarmDay KEYWORD2 44 | setAlarmMonth KEYWORD2 45 | setAlarmYear KEYWORD2 46 | setAlarmHours KEYWORD2 47 | setAlarmMinutes KEYWORD2 48 | setAlarmSeconds KEYWORD2 49 | setAlarmDate KEYWORD2 50 | setAlarmTime KEYWORD2 51 | 52 | enableAlarm KEYWORD2 53 | disableAlarm KEYWORD2 54 | 55 | ####################################### 56 | # Constants (LITERAL1) 57 | ####################################### 58 | -------------------------------------------------------------------------------- /libraries/RTC/library.properties: -------------------------------------------------------------------------------- 1 | name=RTC 2 | version=1.0 3 | author=Thomas Roell 4 | maintainer=grumpyoldpizza@gmail.com 5 | sentence=Allows to use the RTC functionalities. 6 | paragraph=With this library you can use the RTC peripheral to program actions related to date and time. 7 | category=Timing 8 | url=http://www.arduino.cc/en/Reference/RTCZero 9 | architectures=stm32l4 10 | -------------------------------------------------------------------------------- /libraries/SPI/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SPI 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SPI KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | transfer KEYWORD2 17 | #setBitOrder KEYWORD2 18 | setDataMode KEYWORD2 19 | setClockDivider KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SPI_MODE0 LITERAL1 26 | SPI_MODE1 LITERAL1 27 | SPI_MODE2 LITERAL1 28 | SPI_MODE3 LITERAL1 29 | -------------------------------------------------------------------------------- /libraries/SPI/library.properties: -------------------------------------------------------------------------------- 1 | name=SPI 2 | version=1.0 3 | author=Thomas Roell 4 | maintainer=grumpyoldpizza@gmail.com 5 | sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. Specific implementation for STM32L4. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/SPI 9 | architectures=stm32l4 10 | -------------------------------------------------------------------------------- /libraries/Servo/README.adoc: -------------------------------------------------------------------------------- 1 | = Servo Library for Arduino = 2 | 3 | This library allows an Arduino board to control RC (hobby) servo motors. 4 | 5 | For more information about this library please visit us at 6 | http://www.arduino.cc/en/Reference/Servo 7 | 8 | == License == 9 | 10 | Copyright (c) 2013 Arduino LLC. All right reserved. 11 | Copyright (c) 2009 Michael Margolis. All right reserved. 12 | 13 | This library is free software; you can redistribute it and/or 14 | modify it under the terms of the GNU Lesser General Public 15 | License as published by the Free Software Foundation; either 16 | version 2.1 of the License, or (at your option) any later version. 17 | 18 | This library is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | Lesser General Public License for more details. 22 | 23 | You should have received a copy of the GNU Lesser General Public 24 | License along with this library; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 | -------------------------------------------------------------------------------- /libraries/Servo/examples/Knob/Knob.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Controlling a servo position using a potentiometer (variable resistor) 3 | by Michal Rinott 4 | 5 | modified on 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Knob 8 | */ 9 | 10 | #include 11 | 12 | Servo myservo; // create servo object to control a servo 13 | 14 | int potpin = 0; // analog pin used to connect the potentiometer 15 | int val; // variable to read the value from the analog pin 16 | 17 | void setup() { 18 | myservo.attach(9); // attaches the servo on pin 9 to the servo object 19 | } 20 | 21 | void loop() { 22 | val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) 23 | val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) 24 | myservo.write(val); // sets the servo position according to the scaled value 25 | delay(15); // waits for the servo to get there 26 | } 27 | 28 | -------------------------------------------------------------------------------- /libraries/Servo/examples/Sweep/Sweep.ino: -------------------------------------------------------------------------------- 1 | /* Sweep 2 | by BARRAGAN 3 | This example code is in the public domain. 4 | 5 | modified 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Sweep 8 | */ 9 | 10 | #include 11 | 12 | Servo myservo; // create servo object to control a servo 13 | // twelve servo objects can be created on most boards 14 | 15 | int pos = 0; // variable to store the servo position 16 | 17 | void setup() { 18 | myservo.attach(9); // attaches the servo on pin 9 to the servo object 19 | } 20 | 21 | void loop() { 22 | for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees 23 | // in steps of 1 degree 24 | myservo.write(pos); // tell servo to go to position in variable 'pos' 25 | delay(15); // waits 15ms for the servo to reach the position 26 | } 27 | for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees 28 | myservo.write(pos); // tell servo to go to position in variable 'pos' 29 | delay(15); // waits 15ms for the servo to reach the position 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /libraries/Servo/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map Servo 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | Servo KEYWORD1 Servo 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | attach KEYWORD2 15 | detach KEYWORD2 16 | write KEYWORD2 17 | read KEYWORD2 18 | attached KEYWORD2 19 | writeMicroseconds KEYWORD2 20 | readMicroseconds KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | -------------------------------------------------------------------------------- /libraries/Servo/library.properties: -------------------------------------------------------------------------------- 1 | name=Servo 2 | version=1.1.2 3 | author=Thomas Roell 4 | maintainer=grumpyoldpizza@gmail.com 5 | sentence=Allows STM32L4 boards to control a variety of servo motors. 6 | paragraph=This library can control a great number of servos.
It makes careful use of timers: the library can control 9 servos using only 1 timer.
7 | category=Device Control 8 | url=http://www.arduino.cc/en/Reference/Servo 9 | architectures=stm32l4 10 | -------------------------------------------------------------------------------- /libraries/Wire/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Wire 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | 13 | begin KEYWORD2 14 | beginTransmission KEYWORD2 15 | endTransmission KEYWORD2 16 | requestFrom KEYWORD2 17 | onReceive KEYWORD2 18 | onRequest KEYWORD2 19 | 20 | ####################################### 21 | # Instances (KEYWORD2) 22 | ####################################### 23 | 24 | Wire KEYWORD2 25 | Wire1 KEYWORD2 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | 31 | -------------------------------------------------------------------------------- /libraries/Wire/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire 2 | version=1.0 3 | author=Thomas Roell 4 | maintainer=grumpyoldpizza@gmail.com 5 | sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. Specific implementation for STM32L4. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/Wire 9 | architectures=stm32l4 10 | -------------------------------------------------------------------------------- /programmers.txt: -------------------------------------------------------------------------------- 1 | dfu.name=STM32 BOOTLOADER 2 | dfu.communication=USB 3 | dfu.protocol=dfu 4 | dfu.program.protocol= 5 | dfu.program.tool=stm32l4_dfu 6 | dfu.program.extra_params= 7 | 8 | stlink.name=ST-Link V2 9 | stlink.communication=USB 10 | stlink.protocol=stlink 11 | stlink.program.protocol= 12 | stlink.program.tool=stm32l4_openocd 13 | stlink.program.extra_params= 14 | -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l431xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l431xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l432xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l433xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l433xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l442xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l442xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l443xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l443xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l451xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l451xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l452xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l452xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l462xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l462xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l471xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l471xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l475xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l475xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l476xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l476xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l485xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l485xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l486xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l486xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l496xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l496xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l4a6xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l4a6xx.h -------------------------------------------------------------------------------- /system/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h -------------------------------------------------------------------------------- /system/CMSIS/Lib/libarm_cortexM4lf_math.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/CMSIS/Lib/libarm_cortexM4lf_math.a -------------------------------------------------------------------------------- /system/STM32L4xx/Include/armv7m.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_ARMV7M_H) 30 | #define _ARMV7M_H 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | static inline void armv7m_core_yield(void) 39 | { 40 | /* This odd aequence seems to be required for at least STM32L4. Traces on the logic analyzer 41 | * showed that after blocking on wfe, then the subsequent wfe would not block. The only WAR 42 | * is to explicitly clear the EVENT flag via the SEV; WFE sequence. 43 | */ 44 | __asm__ volatile ("wfe; sev; wfe"); 45 | } 46 | 47 | extern int armv7m_core_priority(void); 48 | extern void armv7m_core_udelay(uint32_t udelay); 49 | 50 | #include "armv7m_atomic.h" 51 | #include "armv7m_bitband.h" 52 | #include "armv7m_pendsv.h" 53 | #include "armv7m_svcall.h" 54 | #include "armv7m_systick.h" 55 | #include "armv7m_timer.h" 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* _ARMV7M_H */ 62 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/armv7m_atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_ARMV7M_ATOMIC_H) 30 | #define _ARMV7M_ATOMIC_H 31 | 32 | #include 33 | #include 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | static inline uint32_t armv7m_atomic_load(volatile uint32_t *p_data) 40 | { 41 | return __atomic_load_n(p_data, __ATOMIC_RELAXED); 42 | } 43 | static inline void armv7m_atomic_store(volatile uint32_t *p_data, uint32_t data) 44 | { 45 | __atomic_store_n(p_data, data, __ATOMIC_RELAXED); 46 | } 47 | 48 | static inline uint32_t armv7m_atomic_exchange(volatile uint32_t *p_data, uint32_t data) 49 | { 50 | return __atomic_exchange_n(p_data, data, __ATOMIC_RELAXED); 51 | } 52 | 53 | 54 | extern bool armv7m_atomic_compare_exchange(volatile uint32_t *p_data, uint32_t *p_data_expected, uint32_t data); 55 | extern uint32_t armv7m_atomic_add(volatile uint32_t *p_data, uint32_t data); 56 | extern uint32_t armv7m_atomic_sub(volatile uint32_t *p_data, uint32_t data); 57 | extern uint32_t armv7m_atomic_and(volatile uint32_t *p_data, uint32_t data); 58 | extern uint32_t armv7m_atomic_or(volatile uint32_t *p_data, uint32_t data); 59 | extern uint32_t armv7m_atomic_xor(volatile uint32_t *p_data, uint32_t data); 60 | extern uint32_t armv7m_atomic_modify(volatile uint32_t *p_data, uint32_t mask, uint32_t data); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* _ARMV7M_ATOMIC_H */ 67 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/armv7m_bitband.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_ARMV7M_BITBAND_H) 30 | #define _ARMV7M_BITBAND_H 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #define ARMV7M_BITBAND_SRAM_ADDRESS(_address,_index) \ 39 | ((volatile uint32_t*)(0x22000000 + ((uint32_t)(_address) - 0x20000000) * 32 + ((_index) * 4))) 40 | 41 | #define ARMV7M_BITBAND_PERIPHERAL_ADDRESS(_address,_index) \ 42 | ((volatile uint32_t*)(0x42000000 + ((uint32_t)(_address) - 0x40000000) * 32 + ((_index) * 4))) 43 | 44 | 45 | static inline void armv7m_bitband_sram_write(volatile uint32_t *p_data, uint32_t index, uint32_t data) 46 | { 47 | *ARMV7M_BITBAND_SRAM_ADDRESS(p_data, index) = data; 48 | } 49 | 50 | static inline uint32_t armv7m_bitband_sram_read(volatile uint32_t *p_data, uint32_t index) 51 | { 52 | return *ARMV7M_BITBAND_SRAM_ADDRESS(p_data, index); 53 | } 54 | 55 | static inline void armv7m_bitband_peripheral_write(volatile uint32_t *p_data, uint32_t index, uint32_t data) 56 | { 57 | *ARMV7M_BITBAND_PERIPHERAL_ADDRESS(p_data, index) = data; 58 | } 59 | 60 | static inline uint32_t armv7m_bitband_peripheral_read(volatile uint32_t *p_data, uint32_t index) 61 | { 62 | return *ARMV7M_BITBAND_PERIPHERAL_ADDRESS(p_data, index); 63 | } 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* _ARMV7M_BITBAND_H */ 70 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/armv7m_pendsv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014,2015 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_ARMV7M_PENDSV_H) 30 | #define _ARMV7M_PENDSV_H 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #define ARMV7M_PENDSV_ENTRY_COUNT 32 39 | 40 | typedef void (*armv7m_pendsv_routine_t)(void *context, uint32_t data); 41 | 42 | extern volatile armv7m_pendsv_routine_t * armv7m_pendsv_enqueue(armv7m_pendsv_routine_t routine, void *context, uint32_t data); 43 | 44 | extern void armv7m_pendsv_initialize(void); 45 | 46 | extern void PendSV_Handler(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* _ARMV7M_PENDSV_H */ 53 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/armv7m_systick.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_ARMV7M_SYSTICK_H) 30 | #define _ARMV7M_SYSTICK_H 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef void (*armv7m_systick_callback_t)(void *context, uint32_t heartbeat); 39 | 40 | extern uint64_t armv7m_systick_millis(void); 41 | extern uint64_t armv7m_systick_micros(void); 42 | extern void armv7m_systick_delay(uint32_t delay); 43 | extern void armv7m_systick_notify(armv7m_systick_callback_t callback, void *context); 44 | extern void armv7m_systick_initialize(unsigned int priority); 45 | extern void armv7m_systick_enable(void); 46 | extern void armv7m_systick_disable(void); 47 | 48 | extern void SysTick_Handler(void); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* _ARMV7M_SYSTICK_H */ 55 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/armv7m_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_ARMV7M_TIMER_H) 30 | #define _ARMV7M_TIMER_H 31 | 32 | #include 33 | #include 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | typedef struct _armv7m_timer_t armv7m_timer_t; 40 | 41 | typedef void (*armv7m_timer_callback_t)(armv7m_timer_t *timer); 42 | 43 | struct _armv7m_timer_t { 44 | armv7m_timer_t *next; 45 | armv7m_timer_t *previous; 46 | volatile armv7m_timer_callback_t callback; 47 | uint32_t remaining; 48 | }; 49 | 50 | #define ARMV7M_TIMER_INIT(_callback,_timeout) { NULL, NULL, (_callback), (_timeout) } 51 | 52 | extern void armv7m_timer_create(armv7m_timer_t *timer, armv7m_timer_callback_t callback); 53 | extern bool armv7m_timer_start(armv7m_timer_t *timer, uint32_t timeout); 54 | extern bool armv7m_timer_stop(armv7m_timer_t *timer); 55 | 56 | extern void armv7m_timer_initialize(void); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* _ARMV7M_TIMER_H */ 63 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/dosfs_port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_DOSFS_PORT_h) 30 | #define _DOSFS_PORT_h 31 | 32 | #include "stm32l4_rtc.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | static inline void stm32l4_system_timedate(uint16_t *p_time, uint16_t *p_date) 39 | { 40 | stm32l4_rtc_time_t rtc_time; 41 | 42 | stm32l4_rtc_get_time(&rtc_time); 43 | 44 | *p_time = ((rtc_time.second >> 1) | (rtc_time.minute << 5) | (rtc_time.hour << 11)); 45 | *p_date = ((rtc_time.day << 0) | (rtc_time.month << 5) | ((rtc_time.year + 20) << 9)); 46 | } 47 | 48 | #define DOSFS_PORT_CORE_TIMEDATE(_ctime, _cdate) stm32l4_system_timedate((_ctime),(_cdate)) 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* _DOSFS_PORT_h */ 55 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/stm32l4_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_STM32L4_FLASH_H) 30 | #define _STM32L4_FLASH_H 31 | 32 | #include "armv7m.h" 33 | 34 | #include "stm32l4xx.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | extern uint32_t stm32l4_flash_size(void); 41 | extern bool stm32l4_flash_unlock(void); 42 | extern void stm32l4_flash_lock(void); 43 | extern bool stm32l4_flash_erase(uint32_t address, uint32_t count); 44 | extern bool stm32l4_flash_program(uint32_t address, const uint8_t *data, uint32_t count); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* _STM32L4_FLASH_H */ 51 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/stm32l4_iap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_STM32L4_IAP_H) 30 | #define _STM32L4_IAP_H 31 | 32 | #include 33 | #include 34 | 35 | #include "stm32l4xx.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct _stm32l4_iap_prefix_t { 42 | uint16_t bcdDevice; 43 | uint16_t idProduct; 44 | uint16_t idVendor; 45 | } stm32l4_iap_prefix_t; 46 | 47 | typedef struct _stm32l4_iap_info_t { 48 | uint8_t signature[11]; 49 | uint8_t length; 50 | uint32_t features; 51 | uint32_t address; 52 | uint32_t size; 53 | } stm32l4_iap_info_t; 54 | 55 | typedef struct _stm32l4_iap_suffix_t { 56 | uint16_t bcdDevice; 57 | uint16_t idProduct; 58 | uint16_t idVendor; 59 | uint16_t bcdDFU; 60 | uint8_t ucDfuSeSignature[3]; 61 | uint8_t bLength; 62 | uint32_t dwCRC; 63 | } stm32l4_iap_suffix_t; 64 | 65 | extern void stm32l4_iap(void); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* _STM32L4_IAP_H */ 72 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/stm32l4_iwdg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_STM32L4_IWDG_H) 30 | #define _STM32L4_IWDG_H 31 | 32 | #include 33 | 34 | #include "stm32l4xx.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | extern void stm32l4_iwdg_enable(uint32_t timeout); 41 | 42 | static inline void stm32l4_iwdg_reset(void) 43 | { 44 | IWDG->KR = 0xaaaa; 45 | } 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* _STM32L4_NVIC_H */ 52 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/stm32l4_nvic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_STM32L4_NVIC_H) 30 | #define _STM32L4_NVIC_H 31 | 32 | #include 33 | 34 | #include "stm32l4xx.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | extern uint32_t NVIC_CatchIRQ(IRQn_Type IRQn, uint32_t vector); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _STM32L4_NVIC_H */ 47 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/stm32l4_usbd_dap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_STM32L4_USBD_DAP_H) 30 | #define _STM32L4_USBD_DAP_H 31 | 32 | #include "stm32l4xx.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | extern void stm32l4_usbd_dap_initialize(uint16_t pin_swclk, uint16_t pin_swdio); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _STM32L4_USBD_DAP_H */ 45 | -------------------------------------------------------------------------------- /system/STM32L4xx/Include/stm32l4_usbd_hid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #if !defined(_STM32L4_USBD_HID_H) 30 | #define _STM32L4_USBD_HID_H 31 | 32 | #include "stm32l4xx.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | extern void stm32l4_usbd_hid_send_report(uint8_t id, const uint8_t *data, uint32_t count); 39 | extern bool stm32l4_usbd_hid_done(); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _STM32L4_USBD_HID_H */ 46 | -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/boot_stm32l432.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/boot_stm32l432.o -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/boot_stm32l433.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/boot_stm32l433.o -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/boot_stm32l452.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/boot_stm32l452.o -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/boot_stm32l476.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/boot_stm32l476.o -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/boot_stm32l496.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/boot_stm32l496.o -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/libstm32l432.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/libstm32l432.a -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/libstm32l433.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/libstm32l433.a -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/libstm32l452.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/libstm32l452.a -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/libstm32l476.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/libstm32l476.a -------------------------------------------------------------------------------- /system/STM32L4xx/Lib/libstm32l496.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/system/STM32L4xx/Lib/libstm32l496.a -------------------------------------------------------------------------------- /system/STM32L4xx/Source/USB/Class/MSC/Inc/usbd_msc_data.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_msc_data.h 4 | * @author MCD Application Team 5 | * @version V2.4.2 6 | * @date 11-December-2015 7 | * @brief Header for the usbd_msc_data.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_MSC_DATA_H 30 | #define __USBD_MSC_DATA_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_conf.h" 38 | 39 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 40 | * @{ 41 | */ 42 | 43 | /** @defgroup USB_INFO 44 | * @brief general defines for the usb device library file 45 | * @{ 46 | */ 47 | 48 | /** @defgroup USB_INFO_Exported_Defines 49 | * @{ 50 | */ 51 | #define MODE_SENSE6_LEN 8 52 | #define MODE_SENSE10_LEN 8 53 | #define LENGTH_INQUIRY_PAGE00 7 54 | #define LENGTH_FORMAT_CAPACITIES 20 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | 61 | /** @defgroup USBD_INFO_Exported_TypesDefinitions 62 | * @{ 63 | */ 64 | /** 65 | * @} 66 | */ 67 | 68 | 69 | 70 | /** @defgroup USBD_INFO_Exported_Macros 71 | * @{ 72 | */ 73 | 74 | /** 75 | * @} 76 | */ 77 | 78 | /** @defgroup USBD_INFO_Exported_Variables 79 | * @{ 80 | */ 81 | extern const uint8_t MSC_Page00_Inquiry_Data[]; 82 | extern const uint8_t MSC_Mode_Sense6_data[]; 83 | extern const uint8_t MSC_Mode_Sense10_data[] ; 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | /** @defgroup USBD_INFO_Exported_FunctionsPrototype 90 | * @{ 91 | */ 92 | 93 | /** 94 | * @} 95 | */ 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /* __USBD_MSC_DATA_H */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 112 | -------------------------------------------------------------------------------- /system/STM32L4xx/Source/USB/Class/MSC/Src/usbd_msc_data.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_msc_data.c 4 | * @author MCD Application Team 5 | * @version V2.4.2 6 | * @date 11-December-2015 7 | * @brief This file provides all the vital inquiry pages and sense data. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "usbd_msc_data.h" 30 | 31 | 32 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 33 | * @{ 34 | */ 35 | 36 | 37 | /** @defgroup MSC_DATA 38 | * @brief Mass storage info/data module 39 | * @{ 40 | */ 41 | 42 | /** @defgroup MSC_DATA_Private_TypesDefinitions 43 | * @{ 44 | */ 45 | /** 46 | * @} 47 | */ 48 | 49 | 50 | /** @defgroup MSC_DATA_Private_Defines 51 | * @{ 52 | */ 53 | /** 54 | * @} 55 | */ 56 | 57 | 58 | /** @defgroup MSC_DATA_Private_Macros 59 | * @{ 60 | */ 61 | /** 62 | * @} 63 | */ 64 | 65 | 66 | /** @defgroup MSC_DATA_Private_Variables 67 | * @{ 68 | */ 69 | 70 | 71 | /* USB Mass storage Page 0 Inquiry Data */ 72 | const uint8_t MSC_Page00_Inquiry_Data[] = {//7 73 | 0x00, 74 | 0x00, 75 | 0x00, 76 | (LENGTH_INQUIRY_PAGE00 - 4), 77 | 0x00, 78 | 0x80, 79 | 0x83 80 | }; 81 | /* USB Mass storage sense 6 Data */ 82 | const uint8_t MSC_Mode_Sense6_data[] = { 83 | 0x00, 84 | 0x00, 85 | 0x00, 86 | 0x00, 87 | 0x00, 88 | 0x00, 89 | 0x00, 90 | 0x00 91 | }; 92 | /* USB Mass storage sense 10 Data */ 93 | const uint8_t MSC_Mode_Sense10_data[] = { 94 | 0x00, 95 | 0x06, 96 | 0x00, 97 | 0x00, 98 | 0x00, 99 | 0x00, 100 | 0x00, 101 | 0x00 102 | }; 103 | /** 104 | * @} 105 | */ 106 | 107 | 108 | /** @defgroup MSC_DATA_Private_FunctionPrototypes 109 | * @{ 110 | */ 111 | /** 112 | * @} 113 | */ 114 | 115 | 116 | /** @defgroup MSC_DATA_Private_Functions 117 | * @{ 118 | */ 119 | 120 | /** 121 | * @} 122 | */ 123 | 124 | 125 | /** 126 | * @} 127 | */ 128 | 129 | 130 | /** 131 | * @} 132 | */ 133 | 134 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 135 | -------------------------------------------------------------------------------- /system/STM32L4xx/Source/USB/Core/Inc/usbd_ctlreq.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_req.h 4 | * @author MCD Application Team 5 | * @version V2.4.2 6 | * @date 11-December-2015 7 | * @brief Header file for the usbd_req.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USB_REQUEST_H 30 | #define __USB_REQUEST_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_def.h" 38 | 39 | 40 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 41 | * @{ 42 | */ 43 | 44 | /** @defgroup USBD_REQ 45 | * @brief header file for the usbd_req.c file 46 | * @{ 47 | */ 48 | 49 | /** @defgroup USBD_REQ_Exported_Defines 50 | * @{ 51 | */ 52 | /** 53 | * @} 54 | */ 55 | 56 | 57 | /** @defgroup USBD_REQ_Exported_Types 58 | * @{ 59 | */ 60 | /** 61 | * @} 62 | */ 63 | 64 | 65 | 66 | /** @defgroup USBD_REQ_Exported_Macros 67 | * @{ 68 | */ 69 | /** 70 | * @} 71 | */ 72 | 73 | /** @defgroup USBD_REQ_Exported_Variables 74 | * @{ 75 | */ 76 | /** 77 | * @} 78 | */ 79 | 80 | /** @defgroup USBD_REQ_Exported_FunctionsPrototype 81 | * @{ 82 | */ 83 | 84 | USBD_StatusTypeDef USBD_StdDevReq (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 85 | USBD_StatusTypeDef USBD_StdItfReq (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 86 | USBD_StatusTypeDef USBD_StdEPReq (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 87 | 88 | 89 | void USBD_CtlError (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 90 | 91 | void USBD_ParseSetupRequest (USBD_SetupReqTypedef *req, uint8_t *pdata); 92 | 93 | void USBD_GetString (const uint8_t *desc, uint8_t *unicode, uint16_t *len); 94 | /** 95 | * @} 96 | */ 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | 102 | #endif /* __USB_REQUEST_H */ 103 | 104 | /** 105 | * @} 106 | */ 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | 113 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 114 | -------------------------------------------------------------------------------- /system/STM32L4xx/Source/USB/usbd_cdc_msc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_cdc_msc.h 4 | * @author MCD Application Team 5 | * @version V2.4.2 6 | * @date 11-December-2015 7 | * @brief header file for the usbd_cdc_msc.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USB_CDC_MSC_H 30 | #define __USB_CDC_MSC_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_ioreq.h" 38 | #include "usbd_cdc.h" 39 | #include "usbd_msc.h" 40 | #include "usbd_hid.h" 41 | 42 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 43 | * @{ 44 | */ 45 | 46 | /** @defgroup usbd_cdc_msc 47 | * @brief This file is the Header file for usbd_cdc_msc.c 48 | * @{ 49 | */ 50 | 51 | 52 | /** @defgroup usbd_cdc_msc_Exported_Defines 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | 61 | /** @defgroup USBD_CORE_Exported_TypesDefinitions 62 | * @{ 63 | */ 64 | 65 | /** 66 | * @} 67 | */ 68 | 69 | /** @defgroup USBD_CORE_Exported_Macros 70 | * @{ 71 | */ 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | /** @defgroup USBD_CORE_Exported_Variables 78 | * @{ 79 | */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /** @defgroup USB_CORE_Exported_Functions 86 | * @{ 87 | */ 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* __USB_CDC_MSC_H */ 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | 106 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 107 | -------------------------------------------------------------------------------- /system/STM32L4xx/Source/armv7m_atomic.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014,2015 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #include "armv7m_atomic.h" 30 | 31 | bool armv7m_atomic_compare_exchange(volatile uint32_t *p_data, uint32_t *p_data_expected, uint32_t data) 32 | { 33 | return __atomic_compare_exchange_n(p_data, p_data_expected, data, false, __ATOMIC_RELAXED, __ATOMIC_RELAXED); 34 | } 35 | 36 | uint32_t armv7m_atomic_add(volatile uint32_t *p_data, uint32_t data) 37 | { 38 | return __atomic_fetch_add(p_data, data, __ATOMIC_RELAXED); 39 | } 40 | 41 | uint32_t armv7m_atomic_sub(volatile uint32_t *p_data, uint32_t data) 42 | { 43 | return __atomic_fetch_sub(p_data, data, __ATOMIC_RELAXED); 44 | } 45 | 46 | uint32_t armv7m_atomic_and(volatile uint32_t *p_data, uint32_t data) 47 | { 48 | return __atomic_fetch_and(p_data, data, __ATOMIC_RELAXED); 49 | } 50 | 51 | uint32_t armv7m_atomic_or(volatile uint32_t *p_data, uint32_t data) 52 | { 53 | return __atomic_fetch_or(p_data, data, __ATOMIC_RELAXED); 54 | } 55 | 56 | uint32_t armv7m_atomic_xor(volatile uint32_t *p_data, uint32_t data) 57 | { 58 | return __atomic_fetch_xor(p_data, data, __ATOMIC_RELAXED); 59 | } 60 | 61 | uint32_t armv7m_atomic_modify(volatile uint32_t *p_data, uint32_t mask, uint32_t data) 62 | { 63 | uint32_t o_data, n_data; 64 | 65 | o_data = *p_data; 66 | 67 | do 68 | { 69 | n_data = (o_data & ~mask) | (data & mask); 70 | } 71 | while (!__atomic_compare_exchange_n(p_data, &o_data, n_data, false, __ATOMIC_RELAXED, __ATOMIC_RELAXED)); 72 | 73 | return o_data; 74 | } 75 | -------------------------------------------------------------------------------- /system/STM32L4xx/Source/stm32l4_iwdg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #include 30 | 31 | #include "stm32l4xx.h" 32 | #include "stm32l4_iwdg.h" 33 | 34 | #include "armv7m.h" 35 | 36 | void stm32l4_iwdg_enable(uint32_t timeout) 37 | { 38 | uint32_t iwdg_pr, iwdg_rl; 39 | 40 | if (timeout > 32000) 41 | { 42 | timeout = 32000; 43 | } 44 | 45 | iwdg_pr = 0; 46 | iwdg_rl = timeout * (32000 / (4 * 1000)); 47 | 48 | while (iwdg_rl > 4096) 49 | { 50 | iwdg_pr++; 51 | iwdg_rl >>= 1; 52 | } 53 | 54 | IWDG->KR = 0xcccc; 55 | IWDG->KR = 0x5555; 56 | 57 | while (IWDG->SR & (IWDG_SR_WVU | IWDG_SR_RVU | IWDG_SR_PVU)) 58 | { 59 | } 60 | 61 | IWDG->PR = iwdg_pr; 62 | IWDG->RLR = iwdg_rl -1; 63 | IWDG->KR = 0xaaaa; 64 | } 65 | -------------------------------------------------------------------------------- /system/STM32L4xx/Source/stm32l4_nvic.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Thomas Roell. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal with the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimers. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimers in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of Thomas Roell, nor the names of its contributors 17 | * may be used to endorse or promote products derived from this Software 18 | * without specific prior written permission. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | * WITH THE SOFTWARE. 27 | */ 28 | 29 | #include 30 | 31 | #include "stm32l4xx.h" 32 | #include "stm32l4_nvic.h" 33 | 34 | #include "armv7m.h" 35 | 36 | __attribute__((section(".isr_vector_sram"))) uint32_t __isr_vector_sram[16+96]; 37 | 38 | uint32_t NVIC_CatchIRQ(IRQn_Type IRQn, uint32_t vector) 39 | { 40 | volatile uint32_t *vectors, *o_vectors; 41 | uint32_t primask; 42 | unsigned int i; 43 | 44 | vectors = (volatile uint32_t*)SCB->VTOR; 45 | 46 | if (vectors != &__isr_vector_sram[0]) 47 | { 48 | primask = __get_PRIMASK(); 49 | 50 | __disable_irq(); 51 | 52 | vectors = (volatile uint32_t*)SCB->VTOR; 53 | 54 | if (vectors != &__isr_vector_sram[0]) 55 | { 56 | o_vectors = vectors; 57 | vectors = &__isr_vector_sram[0]; 58 | 59 | for (i = 0; i < sizeof(__isr_vector_sram) / sizeof(__isr_vector_sram[0]); i++) 60 | { 61 | vectors[i] = o_vectors[i]; 62 | } 63 | SCB->VTOR = (uint32_t)vectors; 64 | } 65 | 66 | __set_PRIMASK(primask); 67 | } 68 | 69 | vector = armv7m_atomic_exchange(&vectors[IRQn + 16], vector); 70 | 71 | return vector; 72 | } 73 | -------------------------------------------------------------------------------- /tools/linux/dfu-prefix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/dfu-prefix -------------------------------------------------------------------------------- /tools/linux/dfu-suffix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/dfu-suffix -------------------------------------------------------------------------------- /tools/linux/dfu-util: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/dfu-util -------------------------------------------------------------------------------- /tools/linux/openocd/bin/openocd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LD_LIBRARY_PATH="$(dirname "$0")/../lib" "$0.bin" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" 4 | 5 | -------------------------------------------------------------------------------- /tools/linux/openocd/bin/openocd.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/bin/openocd.bin -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libhidapi-hidraw.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libhidapi-hidraw.so -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libhidapi-hidraw.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libhidapi-hidraw.so.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libhidapi-hidraw.so.0.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libhidapi-hidraw.so.0.0.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libhidapi-libusb.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libhidapi-libusb.so -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libhidapi-libusb.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libhidapi-libusb.so.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libhidapi-libusb.so.0.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libhidapi-libusb.so.0.0.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libjaylink.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libjaylink.so -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libjaylink.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libjaylink.so.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libjaylink.so.0.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libjaylink.so.0.0.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libusb-1.0.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libusb-1.0.so -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libusb-1.0.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libusb-1.0.so.0 -------------------------------------------------------------------------------- /tools/linux/openocd/lib/libusb-1.0.so.0.1.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/linux/openocd/lib/libusb-1.0.so.0.1.0 -------------------------------------------------------------------------------- /tools/linux/stm32l4-upload: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TOOLDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) 4 | 5 | RETRIES=10 6 | 7 | while [ $RETRIES -gt 0 ] 8 | do 9 | if [ "$($TOOLDIR/dfu-util -l 2>/dev/null | grep 0483:df11)" != "" ] 10 | then 11 | $TOOLDIR/dfu-util -d $1:$2,0x0483:0xdf11 -t 4096 -a 0 -s 0x08000000:leave -D $3 12 | echo "OK" 13 | exit 0 14 | fi 15 | echo $RETRIES 16 | RETRIES=$[$RETRIES -1]; 17 | sleep 1; 18 | done 19 | 20 | echo "FAIL" 21 | exit 0 22 | -------------------------------------------------------------------------------- /tools/macosx/dfu-prefix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/dfu-prefix -------------------------------------------------------------------------------- /tools/macosx/dfu-suffix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/dfu-suffix -------------------------------------------------------------------------------- /tools/macosx/dfu-util: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/dfu-util -------------------------------------------------------------------------------- /tools/macosx/openocd/bin/openocd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DYLD_LIBRARY_PATH="$(dirname "$0")/../lib" "$0.bin" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" 4 | 5 | -------------------------------------------------------------------------------- /tools/macosx/openocd/bin/openocd.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/bin/openocd.bin -------------------------------------------------------------------------------- /tools/macosx/openocd/lib/libhidapi.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/lib/libhidapi.0.dylib -------------------------------------------------------------------------------- /tools/macosx/openocd/lib/libhidapi.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/lib/libhidapi.dylib -------------------------------------------------------------------------------- /tools/macosx/openocd/lib/libjaylink.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/lib/libjaylink.0.dylib -------------------------------------------------------------------------------- /tools/macosx/openocd/lib/libjaylink.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/lib/libjaylink.dylib -------------------------------------------------------------------------------- /tools/macosx/openocd/lib/libusb-1.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/lib/libusb-1.0.0.dylib -------------------------------------------------------------------------------- /tools/macosx/openocd/lib/libusb-1.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/macosx/openocd/lib/libusb-1.0.dylib -------------------------------------------------------------------------------- /tools/macosx/stm32l4-upload: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TOOLDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) 4 | 5 | RETRIES=10 6 | 7 | while [ $RETRIES -gt 0 ] 8 | do 9 | if [ "$($TOOLDIR/dfu-util -l 2>/dev/null | grep 0483:df11)" != "" ] 10 | then 11 | $TOOLDIR/dfu-util -d $1:$2,0x0483:0xdf11 -a 0 -s 0x08000000:leave -D $3 12 | echo "OK" 13 | exit 0 14 | fi 15 | echo $RETRIES 16 | RETRIES=$[$RETRIES -1]; 17 | sleep 1; 18 | done 19 | 20 | echo "FAIL" 21 | exit 0 22 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/st_nucleo_f0.cfg: -------------------------------------------------------------------------------- 1 | # This is for all ST NUCLEO with any STM32F0. Known boards at the moment: 2 | # STM32F030R8 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF259997 4 | # NUCLEO-F072RB 5 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF259997 6 | # STM32F091RC 7 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260944 8 | 9 | source [find interface/stlink-v2-1.cfg] 10 | 11 | transport select hla_swd 12 | 13 | source [find target/stm32f0x.cfg] 14 | 15 | reset_config srst_only 16 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/st_nucleo_f103rb.cfg: -------------------------------------------------------------------------------- 1 | # This is an ST NUCLEO F103RB board with a single STM32F103RBT6 chip. 2 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF259875 3 | 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | source [find target/stm32f1x.cfg] 9 | 10 | reset_config srst_only 11 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/st_nucleo_f3.cfg: -------------------------------------------------------------------------------- 1 | # This is an ST NUCLEO F334R8 board with a single STM32F334R8T6 chip. 2 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260004 3 | 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | source [find target/stm32f3x.cfg] 9 | 10 | reset_config srst_only 11 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/st_nucleo_f4.cfg: -------------------------------------------------------------------------------- 1 | # This is for all ST NUCLEO with any STM32F4. Known boards at the moment: 2 | # STM32F401RET6 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260000 4 | # STM32F411RET6 5 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260320 6 | 7 | source [find interface/stlink-v2-1.cfg] 8 | 9 | transport select hla_swd 10 | 11 | source [find target/stm32f4x.cfg] 12 | 13 | reset_config srst_only 14 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/st_nucleo_l1.cfg: -------------------------------------------------------------------------------- 1 | # This is an ST NUCLEO L152RE board with a single STM32L152RET6 chip. 2 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF260002 3 | 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | source [find target/stm32l1.cfg] 9 | 10 | reset_config srst_only 11 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/st_nucleo_l476rg.cfg: -------------------------------------------------------------------------------- 1 | # This is a ST NUCLEO L476RG board with a single STM32L476RGT6 chip. 2 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF261636 3 | 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | source [find target/stm32l4x.cfg] 9 | 10 | # use hardware reset 11 | reset_config srst_only srst_nogate 12 | 13 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm320518_eval.cfg: -------------------------------------------------------------------------------- 1 | # STM320518-EVAL: This is an STM32F0 eval board with a single STM32F051R8T6 2 | # (64KB) chip. 3 | # http://www.st.com/internet/evalboard/product/252994.jsp 4 | # 5 | 6 | # increase working area to 8KB 7 | set WORKAREASIZE 0x2000 8 | 9 | # chip name 10 | set CHIPNAME STM32F051R8T6 11 | 12 | source [find target/stm32f0x.cfg] 13 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm320518_eval_stlink.cfg: -------------------------------------------------------------------------------- 1 | # STM320518-EVAL: This is an STM32F0 eval board with a single STM32F051R8T6 2 | # (64KB) chip. 3 | # http://www.st.com/internet/evalboard/product/252994.jsp 4 | # 5 | # This is for using the onboard STLINK/V2 6 | 7 | source [find interface/stlink-v2.cfg] 8 | 9 | transport select hla_swd 10 | 11 | # increase working area to 8KB 12 | set WORKAREASIZE 0x2000 13 | 14 | # chip name 15 | set CHIPNAME STM32F051R8T6 16 | 17 | source [find target/stm32f0x.cfg] 18 | 19 | reset_config srst_only 20 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32100b_eval.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32 eval board with a single STM32F100VBT6 chip. 2 | # http://www.st.com/internet/evalboard/product/247099.jsp 3 | 4 | # The chip has only 8KB sram 5 | set WORKAREASIZE 0x2000 6 | 7 | source [find target/stm32f1x.cfg] 8 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3210b_eval.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32 eval board with a single STM32F10x (128KB) chip. 2 | # http://www.st.com/internet/evalboard/product/176090.jsp 3 | 4 | # increase working area to 32KB for faster flash programming 5 | set WORKAREASIZE 0x8000 6 | 7 | source [find target/stm32f1x.cfg] 8 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3210c_eval.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32 eval board with a single STM32F107VCT chip. 2 | # http://www.st.com/internet/evalboard/product/217965.jsp 3 | 4 | # increase working area to 32KB for faster flash programming 5 | set WORKAREASIZE 0x8000 6 | 7 | source [find target/stm32f1x.cfg] 8 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3210e_eval.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32 eval board with a single STM32F103ZET6 chip. 2 | # http://www.st.com/internet/evalboard/product/204176.jsp 3 | 4 | # increase working area to 32KB for faster flash programming 5 | set WORKAREASIZE 0x8000 6 | 7 | source [find target/stm32f1x.cfg] 8 | 9 | # 10 | # configure FSMC Bank 1 (NOR/PSRAM Bank 2) NOR flash 11 | # M29W128GL70ZA6E 12 | # 13 | 14 | set _FLASHNAME $_CHIPNAME.norflash 15 | flash bank $_FLASHNAME cfi 0x64000000 0x01000000 2 2 $_TARGETNAME 16 | 17 | proc stm32_enable_fsmc {} { 18 | 19 | echo "Enabling FSMC Bank 1 (NOR/PSRAM Bank 2)" 20 | 21 | # enable gpio (defg) clocks for fsmc 22 | # RCC_APB2ENR 23 | mww 0x40021018 0x000001E0 24 | 25 | # enable fsmc clock 26 | # RCC_AHBENR 27 | mww 0x40021014 0x00000114 28 | 29 | # configure gpio to alternate function 30 | # GPIOD_CRL 31 | mww 0x40011400 0x44BB44BB 32 | # GPIOD_CRH 33 | mww 0x40011404 0xBBBBBBBB 34 | 35 | # GPIOE_CRL 36 | mww 0x40011800 0xBBBBB444 37 | # GPIOE_CRH 38 | mww 0x40011804 0xBBBBBBBB 39 | 40 | # GPIOF_CRL 41 | mww 0x40011C00 0x44BBBBBB 42 | # GPIOF_CRH 43 | mww 0x40011C04 0xBBBB4444 44 | 45 | # GPIOG_CRL 46 | mww 0x40012000 0x44BBBBBB 47 | # GPIOG_CRH 48 | mww 0x40012004 0x444444B4 49 | 50 | # setup fsmc timings 51 | # FSMC_BCR1 52 | mww 0xA0000008 0x00001058 53 | 54 | # FSMC_BTR1 55 | mww 0xA000000C 0x10000502 56 | 57 | # FSMC_BCR1 - enable fsmc 58 | mww 0xA0000008 0x00001059 59 | } 60 | 61 | $_TARGETNAME configure -event reset-init { 62 | stm32_enable_fsmc 63 | } 64 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3220g_eval.cfg: -------------------------------------------------------------------------------- 1 | # STM3220G-EVAL: This is an STM32F2 eval board with a single STM32F207IGH6 2 | # (128KB) chip. 3 | # http://www.st.com/internet/evalboard/product/250374.jsp 4 | 5 | # increase working area to 128KB 6 | set WORKAREASIZE 0x20000 7 | 8 | # chip name 9 | set CHIPNAME STM32F207IGH6 10 | 11 | source [find target/stm32f2x.cfg] 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3220g_eval_stlink.cfg: -------------------------------------------------------------------------------- 1 | # STM3220G-EVAL: This is an STM32F2 eval board with a single STM32F207IGH6 2 | # (128KB) chip. 3 | # http://www.st.com/internet/evalboard/product/250374.jsp 4 | # 5 | # This is for using the onboard STLINK/V2 6 | 7 | source [find interface/stlink-v2.cfg] 8 | 9 | transport select hla_swd 10 | 11 | # increase working area to 128KB 12 | set WORKAREASIZE 0x20000 13 | 14 | # chip name 15 | set CHIPNAME STM32F207IGH6 16 | 17 | source [find target/stm32f2x.cfg] 18 | 19 | reset_config srst_only 20 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3241g_eval.cfg: -------------------------------------------------------------------------------- 1 | # STM3241G-EVAL: This is an STM32F4 eval board with a single STM32F417IGH6 2 | # (1024KB) chip. 3 | # http://www.st.com/internet/evalboard/product/252216.jsp 4 | 5 | # increase working area to 128KB 6 | set WORKAREASIZE 0x20000 7 | 8 | # chip name 9 | set CHIPNAME STM32F417IGH6 10 | 11 | source [find target/stm32f4x.cfg] 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm3241g_eval_stlink.cfg: -------------------------------------------------------------------------------- 1 | # STM3241G-EVAL: This is an STM32F4 eval board with a single STM32F417IGH6 2 | # (1024KB) chip. 3 | # http://www.st.com/internet/evalboard/product/252216.jsp 4 | # 5 | # This is for using the onboard STLINK/V2 6 | 7 | source [find interface/stlink-v2.cfg] 8 | 9 | transport select hla_swd 10 | 11 | # increase working area to 128KB 12 | set WORKAREASIZE 0x20000 13 | 14 | # chip name 15 | set CHIPNAME STM32F417IGH6 16 | 17 | source [find target/stm32f4x.cfg] 18 | 19 | reset_config srst_only 20 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32429i_eval.cfg: -------------------------------------------------------------------------------- 1 | # STM32429I-EVAL: This is an STM32F4 eval board with a single STM32F429NIH6 2 | # (2048KB) chip. 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259093 4 | 5 | # increase working area to 128KB 6 | set WORKAREASIZE 0x20000 7 | 8 | # chip name 9 | set CHIPNAME STM32F429NIH6 10 | 11 | source [find target/stm32f4x.cfg] 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32429i_eval_stlink.cfg: -------------------------------------------------------------------------------- 1 | # STM32429I-EVAL: This is an STM32F4 eval board with a single STM32F429NIH6 2 | # (2048KB) chip. 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259093 4 | # 5 | # This is for using the onboard STLINK/V2 6 | 7 | source [find interface/stlink-v2.cfg] 8 | 9 | transport select hla_swd 10 | 11 | # increase working area to 128KB 12 | set WORKAREASIZE 0x20000 13 | 14 | # chip name 15 | set CHIPNAME STM32F429NIH6 16 | 17 | source [find target/stm32f4x.cfg] 18 | 19 | reset_config srst_only 20 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32439i_eval.cfg: -------------------------------------------------------------------------------- 1 | # STM32439I-EVAL: This is an STM32F4 eval board with a single STM32F439NIH6 2 | # (2048KB) chip. 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259094 4 | 5 | # increase working area to 128KB 6 | set WORKAREASIZE 0x20000 7 | 8 | # chip name 9 | set CHIPNAME STM32F439NIH6 10 | 11 | source [find target/stm32f4x.cfg] 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32439i_eval_stlink.cfg: -------------------------------------------------------------------------------- 1 | # STM32439I-EVAL: This is an STM32F4 eval board with a single STM32F439NIH6 2 | # (2048KB) chip. 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF259094 4 | # 5 | # This is for using the onboard STLINK/V2 6 | 7 | source [find interface/stlink-v2.cfg] 8 | 9 | transport select hla_swd 10 | 11 | # increase working area to 128KB 12 | set WORKAREASIZE 0x20000 13 | 14 | # chip name 15 | set CHIPNAME STM32F439NIH6 16 | 17 | source [find target/stm32f4x.cfg] 18 | 19 | reset_config srst_only 20 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm327x6g_eval.cfg: -------------------------------------------------------------------------------- 1 | # STM327[4|5]6G-EVAL: This is for the STM32F7 eval boards. 2 | # STM32746G-EVAL 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF261639 4 | # STM32756G-EVAL 5 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF261640 6 | 7 | # increase working area to 256KB 8 | set WORKAREASIZE 0x40000 9 | 10 | source [find target/stm32f7x.cfg] 11 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f0discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F0 discovery board with a single STM32F051R8T6 chip. 2 | # http://www.st.com/internet/evalboard/product/253215.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | transport select hla_swd 7 | 8 | set WORKAREASIZE 0x2000 9 | source [find target/stm32f0x.cfg] 10 | 11 | reset_config srst_only 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f334discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F334 discovery board with a single STM32F334C8T6 chip. 2 | # As it is one of the few boards with stlink V.2-1, we source the corresponding 3 | # nucleo file. 4 | # http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/LN1848/PF260318 5 | 6 | source [find board/st_nucleo_f3.cfg] 7 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f3discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F3 discovery board with a single STM32F303VCT6 chip. 2 | # http://www.st.com/internet/evalboard/product/254044.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | transport select hla_swd 7 | 8 | source [find target/stm32f3x.cfg] 9 | 10 | reset_config srst_only 11 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f429disc1.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # This is an STM32F429 discovery board with a single STM32F429ZI chip. 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF259090 4 | # 5 | 6 | source [find interface/stlink-v2-1.cfg] 7 | 8 | transport select hla_swd 9 | 10 | source [find target/stm32f4x.cfg] 11 | 12 | reset_config srst_only 13 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f429discovery.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # This is an STM32F429 discovery board with a single STM32F429ZI chip. 3 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF259090 4 | # 5 | 6 | source [find interface/stlink-v2.cfg] 7 | 8 | transport select hla_swd 9 | 10 | # increase working area to 128KB 11 | set WORKAREASIZE 0x20000 12 | 13 | source [find target/stm32f4x.cfg] 14 | 15 | reset_config srst_only 16 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f469discovery.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # This is an STM32F469 discovery board with a single STM32F469NI chip. 3 | # http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF262395 4 | # 5 | 6 | source [find interface/stlink-v2-1.cfg] 7 | 8 | transport select hla_swd 9 | 10 | # increase working area to 128KB 11 | set WORKAREASIZE 0x20000 12 | 13 | source [find target/stm32f4x.cfg] 14 | 15 | reset_config srst_only 16 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f4discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F4 discovery board with a single STM32F407VGT6 chip. 2 | # http://www.st.com/internet/evalboard/product/252419.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | transport select hla_swd 7 | 8 | # increase working area to 64KB 9 | set WORKAREASIZE 0x10000 10 | 11 | source [find target/stm32f4x.cfg] 12 | 13 | reset_config srst_only 14 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32f7discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F7 discovery board with a single STM32F756NGH6 chip. 2 | # http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF261641 3 | 4 | # This is for using the onboard STLINK/V2-1 5 | source [find interface/stlink-v2-1.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 256KB 10 | set WORKAREASIZE 0x40000 11 | 12 | source [find target/stm32f7x.cfg] 13 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32l0discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32L053 discovery board with a single STM32L053 chip. 2 | # http://www.st.com/web/en/catalog/tools/PF260319 3 | 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | set WORKAREASIZE 0x2000 9 | source [find target/stm32l0.cfg] 10 | 11 | reset_config srst_only 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32l4discovery.cfg: -------------------------------------------------------------------------------- 1 | # Explicitly for the STM32L476 discovery board: 2 | # http://www.st.com/web/en/catalog/tools/PF261635 3 | # but perfectly functional for any other STM32L4 board connected via 4 | # an stlink-v2-1 interface. 5 | # This is for STM32L4 boards that are connected via stlink-v2-1. 6 | 7 | source [find interface/stlink-v2-1.cfg] 8 | 9 | transport select hla_swd 10 | 11 | source [find target/stm32l4x.cfg] 12 | 13 | reset_config srst_only 14 | 15 | adapter_khz 100 -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32ldiscovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32L discovery board with a single STM32L152RBT6 chip. 2 | # http://www.st.com/internet/evalboard/product/250990.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | transport select hla_swd 7 | 8 | set WORKAREASIZE 0x4000 9 | source [find target/stm32l1.cfg] 10 | 11 | reset_config srst_only 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/board/stm32vldiscovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32VL discovery board with a single STM32F100RB chip. 2 | # http://www.st.com/internet/evalboard/product/250863.jsp 3 | 4 | source [find interface/stlink-v1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | set WORKAREASIZE 0x2000 9 | source [find target/stm32f1x.cfg] 10 | 11 | reset_config srst_only 12 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/chip/st/stm32/stm32.tcl: -------------------------------------------------------------------------------- 1 | source [find bitsbytes.tcl] 2 | source [find cpu/arm/cortex_m3.tcl] 3 | source [find memory.tcl] 4 | source [find mmr_helpers.tcl] 5 | 6 | source [find chip/st/stm32/stm32_regs.tcl] 7 | source [find chip/st/stm32/stm32_rcc.tcl] 8 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/cpu/arm/cortex_m3.tcl: -------------------------------------------------------------------------------- 1 | set CPU_TYPE arm 2 | set CPU_NAME cortex_m3 3 | set CPU_ARCH armv7 4 | set CPU_MAX_ADDRESS 0xFFFFFFFF 5 | set CPU_NBITS 32 6 | 7 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/interface/cmsis-dap.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # ARM CMSIS-DAP compliant adapter 3 | # 4 | # http://www.keil.com/support/man/docs/dapdebug/ 5 | # 6 | 7 | interface cmsis-dap 8 | 9 | # Optionally specify the serial number of CMSIS-DAP usb device. 10 | #cmsis_dap_serial 02200201E6661E601B98E3B9 11 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/interface/stlink-v1.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # STMicroelectronics ST-LINK/V1 in-circuit debugger/programmer 3 | # 4 | 5 | interface hla 6 | hla_layout stlink 7 | hla_device_desc "ST-LINK/V1" 8 | hla_vid_pid 0x0483 0x3744 9 | 10 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/interface/stlink-v2-1.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # STMicroelectronics ST-LINK/V2-1 in-circuit debugger/programmer 3 | # 4 | 5 | interface hla 6 | hla_layout stlink 7 | hla_device_desc "ST-LINK/V2-1" 8 | hla_vid_pid 0x0483 0x374b 9 | 10 | # Optionally specify the serial number of ST-LINK/V2 usb device. ST-LINK/V2 11 | # devices seem to have serial numbers with unreadable characters. ST-LINK/V2 12 | # firmware version >= V2.J21.S4 recommended to avoid issues with adapter serial 13 | # number reset issues. 14 | # eg. 15 | #hla_serial "\xaa\xbc\x6e\x06\x50\x75\xff\x55\x17\x42\x19\x3f" 16 | 17 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/interface/stlink-v2.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # STMicroelectronics ST-LINK/V2 in-circuit debugger/programmer 3 | # 4 | 5 | interface hla 6 | hla_layout stlink 7 | hla_device_desc "ST-LINK/V2" 8 | hla_vid_pid 0x0483 0x3748 9 | 10 | # Optionally specify the serial number of ST-LINK/V2 usb device. ST-LINK/V2 11 | # devices seem to have serial numbers with unreadable characters. ST-LINK/V2 12 | # firmware version >= V2.J21.S4 recommended to avoid issues with adapter serial 13 | # number reset issues. 14 | # eg. 15 | #hla_serial "\xaa\xbc\x6e\x06\x50\x75\xff\x55\x17\x42\x19\x3f" 16 | 17 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/mem_helper.tcl: -------------------------------------------------------------------------------- 1 | # Helper for common memory read/modify/write procedures 2 | 3 | # mrw: "memory read word", returns value of $reg 4 | proc mrw {reg} { 5 | set value "" 6 | mem2array value 32 $reg 1 7 | return $value(0) 8 | } 9 | 10 | add_usage_text mrw "address" 11 | add_help_text mrw "Returns value of word in memory." 12 | 13 | proc mrb {reg} { 14 | set value "" 15 | mem2array value 8 $reg 1 16 | return $value(0) 17 | } 18 | 19 | add_usage_text mrb "address" 20 | add_help_text mrb "Returns value of byte in memory." 21 | 22 | # mmw: "memory modify word", updates value of $reg 23 | # $reg <== ((value & ~$clearbits) | $setbits) 24 | proc mmw {reg setbits clearbits} { 25 | set old [mrw $reg] 26 | set new [expr ($old & ~$clearbits) | $setbits] 27 | mww $reg $new 28 | } 29 | 30 | add_usage_text mmw "address setbits clearbits" 31 | add_help_text mmw "Modify word in memory. new_val = (old_val & ~clearbits) | setbits;" 32 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: stm32_stlink.cfg is deprecated (and does nothing, you can safely remove it.)" 2 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f0x.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32f0x family 2 | 3 | # 4 | # stm32 devices support SWD transports only. 5 | # 6 | source [find target/swj-dp.tcl] 7 | source [find mem_helper.tcl] 8 | 9 | if { [info exists CHIPNAME] } { 10 | set _CHIPNAME $CHIPNAME 11 | } else { 12 | set _CHIPNAME stm32f0x 13 | } 14 | 15 | set _ENDIAN little 16 | 17 | # Work-area is a space in RAM used for flash programming 18 | # By default use 4kB 19 | if { [info exists WORKAREASIZE] } { 20 | set _WORKAREASIZE $WORKAREASIZE 21 | } else { 22 | set _WORKAREASIZE 0x1000 23 | } 24 | 25 | #jtag scan chain 26 | if { [info exists CPUTAPID] } { 27 | set _CPUTAPID $CPUTAPID 28 | } else { 29 | # See STM Document RM0091 30 | # Section 29.5.3 31 | set _CPUTAPID 0x0bb11477 32 | } 33 | 34 | swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 35 | 36 | set _TARGETNAME $_CHIPNAME.cpu 37 | target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME 38 | 39 | $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 40 | 41 | # flash size will be probed 42 | set _FLASHNAME $_CHIPNAME.flash 43 | flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME 44 | 45 | # adapter speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz 46 | adapter_khz 1000 47 | 48 | adapter_nsrst_delay 100 49 | 50 | reset_config srst_nogate 51 | 52 | if {![using_hla]} { 53 | # if srst is not fitted use SYSRESETREQ to 54 | # perform a soft reset 55 | cortex_m reset_config sysresetreq 56 | } 57 | 58 | proc stm32f0x_default_reset_start {} { 59 | # Reset clock is HSI (8 MHz) 60 | adapter_khz 1000 61 | } 62 | 63 | proc stm32f0x_default_examine_end {} { 64 | # Enable debug during low power modes (uses more power) 65 | mmw 0x40015804 0x00000006 0 ;# DBGMCU_CR |= DBG_STANDBY | DBG_STOP 66 | 67 | # Stop watchdog counters during halt 68 | mmw 0x40015808 0x00001800 0 ;# DBGMCU_APB1_FZ |= DBG_IWDG_STOP | DBG_WWDG_STOP 69 | } 70 | 71 | proc stm32f0x_default_reset_init {} { 72 | # Configure PLL to boost clock to HSI x 6 (48 MHz) 73 | mww 0x40021004 0x00100000 ;# RCC_CFGR = PLLMUL[2] 74 | mmw 0x40021000 0x01000000 0 ;# RCC_CR[31:16] |= PLLON 75 | mww 0x40022000 0x00000011 ;# FLASH_ACR = PRFTBE | LATENCY[0] 76 | sleep 10 ;# Wait for PLL to lock 77 | mmw 0x40021004 0x00000002 0 ;# RCC_CFGR |= SW[1] 78 | 79 | # Boost JTAG frequency 80 | adapter_khz 8000 81 | } 82 | 83 | # Default hooks 84 | $_TARGETNAME configure -event examine-end { stm32f0x_default_examine_end } 85 | $_TARGETNAME configure -event reset-start { stm32f0x_default_reset_start } 86 | $_TARGETNAME configure -event reset-init { stm32f0x_default_reset_init } 87 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f0x_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: target/stm32f0x_stlink.cfg is deprecated, please switch to target/stm32f0x.cfg" 2 | source [find target/stm32f0x.cfg] 3 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f1x_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: target/stm32f1x_stlink.cfg is deprecated, please switch to target/stm32f1x.cfg" 2 | source [find target/stm32f1x.cfg] 3 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f2x.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32f2x family 2 | 3 | # 4 | # stm32 devices support both JTAG and SWD transports. 5 | # 6 | source [find target/swj-dp.tcl] 7 | source [find mem_helper.tcl] 8 | 9 | if { [info exists CHIPNAME] } { 10 | set _CHIPNAME $CHIPNAME 11 | } else { 12 | set _CHIPNAME stm32f2x 13 | } 14 | 15 | set _ENDIAN little 16 | 17 | # Work-area is a space in RAM used for flash programming 18 | # By default use 64kB 19 | if { [info exists WORKAREASIZE] } { 20 | set _WORKAREASIZE $WORKAREASIZE 21 | } else { 22 | set _WORKAREASIZE 0x10000 23 | } 24 | 25 | # JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz 26 | # 27 | # Since we may be running of an RC oscilator, we crank down the speed a 28 | # bit more to be on the safe side. Perhaps superstition, but if are 29 | # running off a crystal, we can run closer to the limit. Note 30 | # that there can be a pretty wide band where things are more or less stable. 31 | adapter_khz 1000 32 | 33 | adapter_nsrst_delay 100 34 | if {[using_jtag]} { 35 | jtag_ntrst_delay 100 36 | } 37 | 38 | #jtag scan chain 39 | if { [info exists CPUTAPID] } { 40 | set _CPUTAPID $CPUTAPID 41 | } else { 42 | if { [using_jtag] } { 43 | # See STM Document RM0033 44 | # Section 32.6.3 - corresponds to Cortex-M3 r2p0 45 | set _CPUTAPID 0x4ba00477 46 | } { 47 | set _CPUTAPID 0x2ba01477 48 | } 49 | } 50 | 51 | swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 52 | 53 | if { [info exists BSTAPID] } { 54 | set _BSTAPID $BSTAPID 55 | } else { 56 | # See STM Document RM0033 57 | # Section 32.6.2 58 | # 59 | set _BSTAPID 0x06411041 60 | } 61 | 62 | if {[using_jtag]} { 63 | swj_newdap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID 64 | } 65 | 66 | set _TARGETNAME $_CHIPNAME.cpu 67 | target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME 68 | 69 | $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 70 | 71 | set _FLASHNAME $_CHIPNAME.flash 72 | flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME 73 | 74 | reset_config srst_nogate 75 | 76 | if {![using_hla]} { 77 | # if srst is not fitted use SYSRESETREQ to 78 | # perform a soft reset 79 | cortex_m reset_config sysresetreq 80 | } 81 | 82 | $_TARGETNAME configure -event examine-end { 83 | # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP 84 | mmw 0xE0042004 0x00000007 0 85 | 86 | # Stop watchdog counters during halt 87 | # DBGMCU_APB1_FZ |= DBG_IWDG_STOP | DBG_WWDG_STOP 88 | mmw 0xE0042008 0x00001800 0 89 | } 90 | 91 | $_TARGETNAME configure -event trace-config { 92 | # Set TRACE_IOEN; TRACE_MODE is set to async; when using sync 93 | # change this value accordingly to configure trace pins 94 | # assignment 95 | mmw 0xE0042004 0x00000020 0 96 | } 97 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f2x_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: target/stm32f2x_stlink.cfg is deprecated, please switch to target/stm32f2x.cfg" 2 | source [find target/stm32f2x.cfg] 3 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f3x_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: target/stm32f3x_stlink.cfg is deprecated, please switch to target/stm32f3x.cfg" 2 | source [find target/stm32f3x.cfg] 3 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f4x_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg" 2 | source [find target/stm32f4x.cfg] 3 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32f7x.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32f7x family 2 | 3 | # 4 | # stm32f7 devices support both JTAG and SWD transports. 5 | # 6 | source [find target/swj-dp.tcl] 7 | source [find mem_helper.tcl] 8 | 9 | if { [info exists CHIPNAME] } { 10 | set _CHIPNAME $CHIPNAME 11 | } else { 12 | set _CHIPNAME stm32f7x 13 | } 14 | 15 | set _ENDIAN little 16 | 17 | # Work-area is a space in RAM used for flash programming 18 | # By default use 128kB 19 | if { [info exists WORKAREASIZE] } { 20 | set _WORKAREASIZE $WORKAREASIZE 21 | } else { 22 | set _WORKAREASIZE 0x20000 23 | } 24 | 25 | #jtag scan chain 26 | if { [info exists CPUTAPID] } { 27 | set _CPUTAPID $CPUTAPID 28 | } else { 29 | if { [using_jtag] } { 30 | # See STM Document RM0385 31 | # Section 40.6.3 - corresponds to Cortex-M7 with FPU r0p0 32 | set _CPUTAPID 0x5ba00477 33 | } { 34 | set _CPUTAPID 0x5ba02477 35 | } 36 | } 37 | 38 | swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 39 | 40 | if { [info exists BSTAPID] } { 41 | set _BSTAPID $BSTAPID 42 | } else { 43 | # See STM Document RM0385 44 | # Section 40.6.1 45 | # STM32F75xxG 46 | set _BSTAPID1 0x06449041 47 | } 48 | 49 | if {[using_jtag]} { 50 | swj_newdap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 51 | } 52 | 53 | set _TARGETNAME $_CHIPNAME.cpu 54 | target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME 55 | 56 | $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 57 | 58 | set _FLASHNAME $_CHIPNAME.flash 59 | flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME 60 | 61 | # adapter speed should be <= F_CPU/6. F_CPU after reset is 16MHz, so use F_JTAG = 2MHz 62 | adapter_khz 2000 63 | 64 | adapter_nsrst_delay 100 65 | if {[using_jtag]} { 66 | jtag_ntrst_delay 100 67 | } 68 | 69 | # use hardware reset, connect under reset 70 | reset_config srst_only srst_nogate 71 | 72 | if {![using_hla]} { 73 | # if srst is not fitted use SYSRESETREQ to 74 | # perform a soft reset 75 | cortex_m reset_config sysresetreq 76 | } 77 | 78 | $_TARGETNAME configure -event examine-end { 79 | # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP 80 | mmw 0xE0042004 0x00000007 0 81 | 82 | # Stop watchdog counters during halt 83 | # DBGMCU_APB1_FZ |= DBG_IWDG_STOP | DBG_WWDG_STOP 84 | mmw 0xE0042008 0x00001800 0 85 | } 86 | 87 | $_TARGETNAME configure -event trace-config { 88 | # Set TRACE_IOEN; TRACE_MODE is set to async; when using sync 89 | # change this value accordingly to configure trace pins 90 | # assignment 91 | mmw 0xE0042004 0x00000020 0 92 | } 93 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32l0.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # M0+ devices only have SW-DP, but swj-dp code works, just don't 3 | # set any jtag related features 4 | # 5 | 6 | source [find target/swj-dp.tcl] 7 | 8 | if { [info exists CHIPNAME] } { 9 | set _CHIPNAME $CHIPNAME 10 | } else { 11 | set _CHIPNAME stm32l0 12 | } 13 | 14 | set _ENDIAN little 15 | 16 | # Work-area is a space in RAM used for flash programming 17 | # By default use 8kB (max ram on smallest part) 18 | if { [info exists WORKAREASIZE] } { 19 | set _WORKAREASIZE $WORKAREASIZE 20 | } else { 21 | set _WORKAREASIZE 0x2000 22 | } 23 | 24 | # JTAG speed should be <= F_CPU/6. 25 | # F_CPU after reset is ~2MHz, so use F_JTAG max = 333kHz 26 | adapter_khz 300 27 | 28 | adapter_nsrst_delay 100 29 | 30 | if { [info exists CPUTAPID] } { 31 | set _CPUTAPID $CPUTAPID 32 | } else { 33 | # Arm, m0+, non-multidrop. 34 | # http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka16088.html 35 | set _CPUTAPID 0x0bc11477 36 | } 37 | 38 | swj_newdap $_CHIPNAME cpu -expected-id $_CPUTAPID 39 | 40 | set _TARGETNAME $_CHIPNAME.cpu 41 | target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME 42 | 43 | $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 44 | 45 | # flash size will be probed 46 | set _FLASHNAME $_CHIPNAME.flash 47 | flash bank $_FLASHNAME stm32lx 0x08000000 0 0 0 $_TARGETNAME 48 | 49 | reset_config srst_nogate 50 | 51 | if {![using_hla]} { 52 | # if srst is not fitted use SYSRESETREQ to 53 | # perform a soft reset 54 | cortex_m reset_config sysresetreq 55 | } 56 | 57 | proc stm32l0_enable_HSI16 {} { 58 | # Enable HSI16 as clock source 59 | echo "STM32L0: Enabling HSI16" 60 | 61 | # Set HSI16ON in RCC_CR (leave MSI enabled) 62 | mww 0x40021000 0x00000101 63 | 64 | # Set HSI16 as SYSCLK (RCC_CFGR) 65 | mww 0x4002100c 0x00000001 66 | 67 | # Increase speed 68 | adapter_khz 2500 69 | } 70 | 71 | $_TARGETNAME configure -event reset-init { 72 | stm32l0_enable_HSI16 73 | } 74 | 75 | $_TARGETNAME configure -event reset-start { 76 | adapter_khz 300 77 | } 78 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32l1x_dual_bank.cfg: -------------------------------------------------------------------------------- 1 | source [find target/stm32l1.cfg] 2 | 3 | # The stm32l1x 384kb have a dual bank flash. 4 | # Let's add a definition for the second bank here. 5 | 6 | # Add the second flash bank. 7 | set _FLASHNAME $_CHIPNAME.flash1 8 | flash bank $_FLASHNAME stm32lx 0 0 0 0 $_TARGETNAME 9 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32l4x.cfg: -------------------------------------------------------------------------------- 1 | # script for stm32l4x family 2 | 3 | # 4 | # stm32l4 devices support both JTAG and SWD transports. 5 | # 6 | source [find target/swj-dp.tcl] 7 | source [find mem_helper.tcl] 8 | 9 | if { [info exists CHIPNAME] } { 10 | set _CHIPNAME $CHIPNAME 11 | } else { 12 | set _CHIPNAME stm32l4x 13 | } 14 | 15 | set _ENDIAN little 16 | 17 | # Work-area is a space in RAM used for flash programming 18 | # Smallest current target has 64kB ram, use 32kB by default to avoid surprises 19 | if { [info exists WORKAREASIZE] } { 20 | set _WORKAREASIZE $WORKAREASIZE 21 | } else { 22 | set _WORKAREASIZE 0x8000 23 | } 24 | 25 | #jtag scan chain 26 | if { [info exists CPUTAPID] } { 27 | set _CPUTAPID $CPUTAPID 28 | } else { 29 | if { [using_jtag] } { 30 | # See STM Document RM0351 31 | # Section 44.6.3 - corresponds to Cortex-M4 r0p1 32 | set _CPUTAPID 0x4ba00477 33 | } { 34 | set _CPUTAPID 0x2ba01477 35 | } 36 | } 37 | 38 | swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID 39 | 40 | if { [info exists BSTAPID] } { 41 | set _BSTAPID $BSTAPID 42 | } else { 43 | # See STM Document RM0351 44 | # Section 44.6.3 45 | # STM32L4X6 46 | set _BSTAPID1 0x06415041 47 | } 48 | 49 | if {[using_jtag]} { 50 | swj_newdap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID1 51 | } 52 | 53 | set _TARGETNAME $_CHIPNAME.cpu 54 | target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME 55 | 56 | $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 57 | 58 | set _FLASHNAME $_CHIPNAME.flash 59 | flash bank $_FLASHNAME stm32l4x 0 0 0 0 $_TARGETNAME 60 | 61 | # Common knowledges tells JTAG speed should be <= F_CPU/6. 62 | # F_CPU after reset is MSI 4MHz, so use F_JTAG = 500 kHz to stay on 63 | # the safe side. 64 | # 65 | # Note that there is a pretty wide band where things are 66 | # more or less stable, see http://openocd.zylin.com/#/c/3366/ 67 | adapter_khz 500 68 | 69 | adapter_nsrst_delay 100 70 | if {[using_jtag]} { 71 | jtag_ntrst_delay 100 72 | } 73 | 74 | reset_config srst_nogate 75 | 76 | if {![using_hla]} { 77 | # if srst is not fitted use SYSRESETREQ to 78 | # perform a soft reset 79 | cortex_m reset_config sysresetreq 80 | } 81 | 82 | $_TARGETNAME configure -event reset-init { 83 | # CPU comes out of reset with MSI_ON | MSI_RDY | MSI Range 6 (4 MHz). 84 | # Use MSI 24 MHz clock, compliant even with VOS == 2. 85 | # 3 WS compliant with VOS == 2 and 24 MHz. 86 | mww 0x40022000 0x00000103 ;# FLASH_ACR = PRFTBE | 3(Latency) 87 | mww 0x40021000 0x00000099 ;# RCC_CR = MSI_ON | MSIRGSEL| MSI Range 10 88 | # Boost JTAG frequency 89 | adapter_khz 4000 90 | } 91 | 92 | $_TARGETNAME configure -event reset-start { 93 | # Reset clock is MSI (4 MHz) 94 | adapter_khz 500 95 | } 96 | 97 | $_TARGETNAME configure -event examine-end { 98 | # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP 99 | mmw 0xE0042004 0x00000007 0 100 | 101 | # Stop watchdog counters during halt 102 | # DBGMCU_APB1_FZ |= DBG_IWDG_STOP | DBG_WWDG_STOP 103 | mmw 0xE0042008 0x00001800 0 104 | } 105 | 106 | $_TARGETNAME configure -event trace-config { 107 | # Set TRACE_IOEN; TRACE_MODE is set to async; when using sync 108 | # change this value accordingly to configure trace pins 109 | # assignment 110 | mmw 0xE0042004 0x00000020 0 111 | } 112 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/stm32lx_stlink.cfg: -------------------------------------------------------------------------------- 1 | echo "WARNING: target/stm32lx_stlink.cfg is deprecated, please switch to target/stm32l1.cfg" 2 | source [find target/stm32l1.cfg] 3 | -------------------------------------------------------------------------------- /tools/share/openocd/scripts/target/swj-dp.tcl: -------------------------------------------------------------------------------- 1 | # ARM Debug Interface V5 (ADI_V5) utility 2 | # ... Mostly for SWJ-DP (not SW-DP or JTAG-DP, since 3 | # SW-DP and JTAG-DP targets don't need to switch based 4 | # on which transport is active. 5 | # 6 | # declare a JTAG or SWD Debug Access Point (DAP) 7 | # based on the transport in use with this session. 8 | # You can't access JTAG ops when SWD is active, etc. 9 | 10 | # params are currently what "jtag newtap" uses 11 | # because OpenOCD internals are still strongly biased 12 | # to JTAG .... but for SWD, "irlen" etc are ignored, 13 | # and the internals work differently 14 | 15 | # for now, ignore non-JTAG and non-SWD transports 16 | # (e.g. initial flash programming via SPI or UART) 17 | 18 | # split out "chip" and "tag" so we can someday handle 19 | # them more uniformly irlen too...) 20 | 21 | if [catch {transport select}] { 22 | echo "Error: unable to select a session transport. Can't continue." 23 | shutdown 24 | } 25 | 26 | proc swj_newdap {chip tag args} { 27 | if [using_hla] { 28 | eval hla newtap $chip $tag $args 29 | } elseif [using_jtag] { 30 | eval jtag newtap $chip $tag $args 31 | } elseif [using_swd] { 32 | eval swd newdap $chip $tag $args 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tools/windows/dfu-prefix.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/dfu-prefix.exe -------------------------------------------------------------------------------- /tools/windows/dfu-suffix.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/dfu-suffix.exe -------------------------------------------------------------------------------- /tools/windows/dfu-util.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/dfu-util.exe -------------------------------------------------------------------------------- /tools/windows/libwinpthread-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/libwinpthread-1.dll -------------------------------------------------------------------------------- /tools/windows/openocd/bin/libgcc_s_sjlj-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/openocd/bin/libgcc_s_sjlj-1.dll -------------------------------------------------------------------------------- /tools/windows/openocd/bin/libhidapi-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/openocd/bin/libhidapi-0.dll -------------------------------------------------------------------------------- /tools/windows/openocd/bin/libjaylink-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/openocd/bin/libjaylink-0.dll -------------------------------------------------------------------------------- /tools/windows/openocd/bin/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/openocd/bin/libusb-1.0.dll -------------------------------------------------------------------------------- /tools/windows/openocd/bin/libwinpthread-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/openocd/bin/libwinpthread-1.dll -------------------------------------------------------------------------------- /tools/windows/openocd/bin/openocd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/profezzorn/arduino-proffieboard/2b62c5fbe667d5f58aa1fd61a3f61b38c7bb969f/tools/windows/openocd/bin/openocd.exe -------------------------------------------------------------------------------- /tools/windows/stm32l4-upload.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set count=1 3 | :wait 4 | "%~dp0\dfu-util.exe" -l -d 0483:df11 | findstr "Found" >NUL 2>&1 5 | if %errorlevel% == 0 ( 6 | "%~dp0\dfu-util.exe" -d %1:%2,0x0483:0xdf11 -a 0 -s 0x08000000:leave -D %3 7 | ) else ( 8 | if %count% gtr 10 goto break 9 | echo %count% 10 | set /A count+=1 11 | ping -n 1 127.0.0.1 >NUL 12 | goto :wait 13 | ) 14 | ) 15 | 16 | :break 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /variants/STM32L432KC-Ladybug/openocd_scripts/stm32l432kc_ladybug.cfg: -------------------------------------------------------------------------------- 1 | # This is a Ladybug L432KC board with a single STM32L432KCU6 chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 48KB 10 | set WORKAREASIZE 0x0C000 11 | 12 | # chip name 13 | set CHIPNAME STM32L432 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L432KC-Ladybug/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L432KC-NUCLEO/openocd_scripts/stm32l432kc_nucleo.cfg: -------------------------------------------------------------------------------- 1 | # This is a ST NUCLEO L432KC board with a single STM32L432KCU6 chip. 2 | 3 | # This is for using the onboard STLINK/V2 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | # increase working area to 48KB 9 | set WORKAREASIZE 0x0c000 10 | 11 | # chip name 12 | set CHIPNAME STM32L432 13 | 14 | source [find target/stm32l4x.cfg] 15 | 16 | # use hardware reset 17 | reset_config srst_only srst_nogate 18 | -------------------------------------------------------------------------------- /variants/STM32L432KC-NUCLEO/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L433CC-Butterfly/openocd_scripts/stm32l433cc_butterfly.cfg: -------------------------------------------------------------------------------- 1 | # This is a Butterfly L433CC board with a single STM32L433CCU6 chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 48KB 10 | set WORKAREASIZE 0x0C000 11 | 12 | # chip name 13 | set CHIPNAME STM32L433 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L433CC-Butterfly/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg: -------------------------------------------------------------------------------- 1 | # This is a Butterfly L433CC board with a single STM32L433CCU6 chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 48KB 10 | set WORKAREASIZE 0x0C000 11 | 12 | # chip name 13 | set CHIPNAME STM32L433 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L433CC-Proffieboard/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L433CC-ProffieboardV2/openocd_scripts/stm32l433cc_butterfly.cfg: -------------------------------------------------------------------------------- 1 | # This is a Butterfly L433CC board with a single STM32L433CCU6 chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 48KB 10 | set WORKAREASIZE 0x0C000 11 | 12 | # chip name 13 | set CHIPNAME STM32L433 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L433CC-ProffieboardV2/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L452RE-ProffieboardV3/openocd_scripts/stm32l452re.cfg: -------------------------------------------------------------------------------- 1 | # This is a Proffieboard V3 with a STM32L452RE chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 48KB 10 | set WORKAREASIZE 0x0C000 11 | 12 | # chip name 13 | set CHIPNAME STM32L452 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L452RE-ProffieboardV3/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L476RE-Dragonfly/openocd_scripts/stm32l476re_dragonfly.cfg: -------------------------------------------------------------------------------- 1 | # This is a Dragonfly L476RE board with a single STM32L476RET6 chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 96KB 10 | set WORKAREASIZE 0x18000 11 | 12 | # chip name 13 | set CHIPNAME STM32L476 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L476RE-Dragonfly/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L476RG-NUCLEO/openocd_scripts/stm32l476rg_nucleo.cfg: -------------------------------------------------------------------------------- 1 | # This is a ST NUCLEO L476RG board with a single STM32L476RGT6 chip. 2 | 3 | # This is for using the onboard STLINK/V2 4 | source [find interface/stlink-v2-1.cfg] 5 | 6 | transport select hla_swd 7 | 8 | # increase working area to 96KB 9 | set WORKAREASIZE 0x18000 10 | 11 | # chip name 12 | set CHIPNAME STM32L476 13 | 14 | source [find target/stm32l4x.cfg] 15 | 16 | # use hardware reset 17 | reset_config srst_only srst_nogate 18 | -------------------------------------------------------------------------------- /variants/STM32L476RG-NUCLEO/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /variants/STM32L496RG-Dragonfly/openocd_scripts/stm32l496rg_dragonfly.cfg: -------------------------------------------------------------------------------- 1 | # This is a Dragonfly L496RG board with a single STM32L476RGT6 chip. 2 | # 3 | 4 | # This is for using the onboard STLINK/V2 5 | source [find interface/stlink-v2.cfg] 6 | 7 | transport select hla_swd 8 | 9 | # increase working area to 96KB 10 | set WORKAREASIZE 0x40000 11 | 12 | # chip name 13 | set CHIPNAME STM32L496 14 | 15 | source [find target/stm32l4x.cfg] 16 | 17 | reset_config none separate 18 | 19 | -------------------------------------------------------------------------------- /variants/STM32L496RG-Dragonfly/pins_arduino.h: -------------------------------------------------------------------------------- 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 | // API compatibility 20 | #include "variant.h" 21 | 22 | --------------------------------------------------------------------------------