Browse Source
- STM32F407VGT6 (1MB of Flash, 192+4 Kbytes of SRAM) - 5V (via USB) or Li-Polymer Battery (3.7V) power input - 2 x LEDs - 2 x user switches - 2 x mikroBUS sockets - 2 x 1x26 mikromedia-compatible headers (52 pins) https://www.mikroe.com/clicker-2-stm32f4pull/5088/head
Christopher Wilson
5 years ago
committed by
Damien George
4 changed files with 205 additions and 0 deletions
@ -0,0 +1,85 @@ |
|||||
|
#define MICROPY_HW_BOARD_NAME "MIKROE_CLICKER2_STM32" |
||||
|
#define MICROPY_HW_MCU_NAME "STM32F407" |
||||
|
|
||||
|
#define MICROPY_HW_HAS_SWITCH (1) |
||||
|
#define MICROPY_HW_HAS_FLASH (1) |
||||
|
#define MICROPY_HW_ENABLE_RNG (1) |
||||
|
#define MICROPY_HW_ENABLE_RTC (1) |
||||
|
#define MICROPY_HW_ENABLE_DAC (1) |
||||
|
#define MICROPY_HW_ENABLE_USB (1) |
||||
|
|
||||
|
// HSE is 25MHz
|
||||
|
#define MICROPY_HW_CLK_PLLM (25) |
||||
|
#define MICROPY_HW_CLK_PLLN (336) |
||||
|
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2) |
||||
|
#define MICROPY_HW_CLK_PLLQ (7) |
||||
|
#define MICROPY_HW_CLK_LAST_FREQ (1) |
||||
|
|
||||
|
// The board has a 32kHz crystal for the RTC
|
||||
|
#define MICROPY_HW_RTC_USE_LSE (1) |
||||
|
#define MICROPY_HW_RTC_USE_US (0) |
||||
|
#define MICROPY_HW_RTC_USE_CALOUT (0) // turn on/off PC13 512Hz output
|
||||
|
|
||||
|
// UART config
|
||||
|
// mikroBUS slot 1
|
||||
|
#define MICROPY_HW_UART2_NAME "SLOT1" |
||||
|
#define MICROPY_HW_UART2_TX (pin_D5) |
||||
|
#define MICROPY_HW_UART2_RX (pin_D6) |
||||
|
// mikroBUS slot 2
|
||||
|
#define MICROPY_HW_UART3_NAME "SLOT2" |
||||
|
#define MICROPY_HW_UART3_TX (pin_D8) |
||||
|
#define MICROPY_HW_UART3_RX (pin_D9) |
||||
|
// HDR2
|
||||
|
#define MICROPY_HW_UART4_NAME "HDR2" |
||||
|
#define MICROPY_HW_UART4_TX (pin_A0) |
||||
|
#define MICROPY_HW_UART4_RX (pin_A1) |
||||
|
|
||||
|
// I2C buses
|
||||
|
// mikroBUS slot 2 / HDR2
|
||||
|
#define MICROPY_HW_I2C2_NAME "SLOT2" |
||||
|
#define MICROPY_HW_I2C2_SCL (pin_B10) |
||||
|
#define MICROPY_HW_I2C2_SDA (pin_B11) |
||||
|
// mikroBUS slot 1
|
||||
|
#define MICROPY_HW_I2C3_NAME "SLOT1" |
||||
|
#define MICROPY_HW_I2C3_SCL (pin_A8) |
||||
|
#define MICROPY_HW_I2C3_SDA (pin_C9) |
||||
|
|
||||
|
// SPI buses
|
||||
|
// mikroBUS slot 2 / HDR1
|
||||
|
#define MICROPY_HW_SPI2_NAME "SLOT2" |
||||
|
#define MICROPY_HW_SPI2_NSS (pin_E11) |
||||
|
#define MICROPY_HW_SPI2_SCK (pin_B13) |
||||
|
#define MICROPY_HW_SPI2_MISO (pin_B14) |
||||
|
#define MICROPY_HW_SPI2_MOSI (pin_B15) |
||||
|
// mikroBUS slot 1
|
||||
|
#define MICROPY_HW_SPI3_NAME "SLOT1" |
||||
|
#define MICROPY_HW_SPI3_NSS (pin_E8) |
||||
|
#define MICROPY_HW_SPI3_SCK (pin_C10) |
||||
|
#define MICROPY_HW_SPI3_MISO (pin_C11) |
||||
|
#define MICROPY_HW_SPI3_MOSI (pin_C12) |
||||
|
|
||||
|
// USRSW is pulled high; pressing the button makes the input go low
|
||||
|
#define MICROPY_HW_USRSW_PIN (pin_E0) |
||||
|
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL) |
||||
|
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING) |
||||
|
#define MICROPY_HW_USRSW_PRESSED (0) |
||||
|
|
||||
|
// LEDs
|
||||
|
#define MICROPY_HW_LED1 (pin_E12) // red
|
||||
|
#define MICROPY_HW_LED2 (pin_E15) // red
|
||||
|
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin)) |
||||
|
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin)) |
||||
|
|
||||
|
// USB config
|
||||
|
#define MICROPY_HW_USB_FS (1) |
||||
|
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9) |
||||
|
|
||||
|
// Bootloader configuration (only needed if Mboot is used)
|
||||
|
#define MBOOT_I2C_PERIPH_ID 2 |
||||
|
#define MBOOT_I2C_SCL (pin_B10) |
||||
|
#define MBOOT_I2C_SDA (pin_B11) |
||||
|
#define MBOOT_I2C_ALTFUNC (4) |
||||
|
#define MBOOT_BOOTPIN_PIN (pin_A10) |
||||
|
#define MBOOT_BOOTPIN_PULL (MP_HAL_PIN_PULL_NONE) |
||||
|
#define MBOOT_BOOTPIN_ACTIVE (0) |
||||
|
#define MBOOT_FSLOAD (1) |
@ -0,0 +1,13 @@ |
|||||
|
MCU_SERIES = f4 |
||||
|
CMSIS_MCU = STM32F407xx |
||||
|
AF_FILE = boards/stm32f405_af.csv |
||||
|
ifeq ($(USE_MBOOT),1) |
||||
|
# When using Mboot all the text goes together after the filesystem
|
||||
|
LD_FILES = boards/stm32f405.ld boards/common_blifs.ld |
||||
|
TEXT0_ADDR = 0x08020000 |
||||
|
else |
||||
|
# When not using Mboot the ISR text goes first, then the rest after the filesystem
|
||||
|
LD_FILES = boards/stm32f405.ld boards/common_ifs.ld |
||||
|
TEXT0_ADDR = 0x08000000 |
||||
|
TEXT1_ADDR = 0x08020000 |
||||
|
endif |
|
@ -0,0 +1,19 @@ |
|||||
|
/* This file is part of the MicroPython project, http://micropython.org/
|
||||
|
* The MIT License (MIT) |
||||
|
* Copyright (c) 2019 Damien P. George |
||||
|
*/ |
||||
|
#ifndef MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H |
||||
|
#define MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H |
||||
|
|
||||
|
#include "boards/stm32f4xx_hal_conf_base.h" |
||||
|
|
||||
|
// Oscillator values in Hz
|
||||
|
#define HSE_VALUE (25000000) |
||||
|
#define LSE_VALUE (32768) |
||||
|
#define EXTERNAL_CLOCK_VALUE (12288000) |
||||
|
|
||||
|
// Oscillator timeouts in ms
|
||||
|
#define HSE_STARTUP_TIMEOUT (100) |
||||
|
#define LSE_STARTUP_TIMEOUT (5000) |
||||
|
|
||||
|
#endif // MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
|
Loading…
Reference in new issue