add support for ST-Link V2 clone adapter
This commit is contained in:
parent
4b531542dc
commit
60de1182a4
2
Rakefile
2
Rakefile
|
@ -14,7 +14,7 @@ APPLICATION = "application"
|
||||||
FIRMWARES = [BOOTLOADER, APPLICATION]
|
FIRMWARES = [BOOTLOADER, APPLICATION]
|
||||||
|
|
||||||
# which development board is used
|
# which development board is used
|
||||||
# supported are: SYSTEM_BOARD, MAPLE_MINI, BLUE_PILL, CORE_BOARD, BUSVOODOO
|
# supported are: SYSTEM_BOARD, MAPLE_MINI, BLUE_PILL, CORE_BOARD, STLINKV2_ALU, BUSVOODOO
|
||||||
BOARD = ENV["BOARD"] || "CORE_BOARD"
|
BOARD = ENV["BOARD"] || "CORE_BOARD"
|
||||||
|
|
||||||
# libopencm3 definitions
|
# libopencm3 definitions
|
||||||
|
|
|
@ -275,8 +275,8 @@ void main(void)
|
||||||
|
|
||||||
// setup RTC
|
// setup RTC
|
||||||
printf("setup internal RTC: ");
|
printf("setup internal RTC: ");
|
||||||
#if defined(BLUE_PILL) // for boards without a Low Speed External oscillator
|
#if defined(BLUE_PILL) || defined(STLINKV2_ALU) // for boards without a Low Speed External oscillator
|
||||||
// /!\ WARNING the blue pill LSE oscillator is affected when toggling the onboard LED, thus prefer the HSE
|
// note: the blue pill LSE oscillator is affected when toggling the onboard LED, thus prefer the HSE
|
||||||
rtc_auto_awake(RCC_HSE, 8000000 / 128 - 1); // use High Speed External oscillator (8 MHz / 128) as RTC clock (VBAT can't be used to keep the RTC running)
|
rtc_auto_awake(RCC_HSE, 8000000 / 128 - 1); // use High Speed External oscillator (8 MHz / 128) as RTC clock (VBAT can't be used to keep the RTC running)
|
||||||
#else // for boards with an precise Low Speed External oscillator
|
#else // for boards with an precise Low Speed External oscillator
|
||||||
rtc_auto_awake(RCC_LSE, 32768 - 1); // ensure internal RTC is on, uses the 32.678 kHz LSE, and the prescale is set to our tick speed, else update backup registers accordingly (power off the micro-controller for the change to take effect)
|
rtc_auto_awake(RCC_LSE, 32768 - 1); // ensure internal RTC is on, uses the 32.678 kHz LSE, and the prescale is set to our tick speed, else update backup registers accordingly (power off the micro-controller for the change to take effect)
|
||||||
|
|
5
global.h
5
global.h
|
@ -373,6 +373,11 @@
|
||||||
#define LED_PORT B /**< GPIO port (port B on maple mini) */
|
#define LED_PORT B /**< GPIO port (port B on maple mini) */
|
||||||
#define LED_PIN 1 /**< GPIO pin (pin PB1 on maple mini) */
|
#define LED_PIN 1 /**< GPIO pin (pin PB1 on maple mini) */
|
||||||
#define LED_ON 1 /**< LED is on when pin is high */
|
#define LED_ON 1 /**< LED is on when pin is high */
|
||||||
|
#elif defined (STLINKV2_ALU) // it's actually a STM32F101, but it seems to have all STM32F103 features
|
||||||
|
/* on ST-Link V2 clone dongle in aluminum case LED is on pin PA9 */
|
||||||
|
#define LED_PORT A /**< GPIO port (port A) */
|
||||||
|
#define LED_PIN 9 /**< GPIO pin (pin PA9) */
|
||||||
|
#define LED_ON 0 /**< the color and on level depends on the clone */
|
||||||
#elif defined (BUSVOODOO)
|
#elif defined (BUSVOODOO)
|
||||||
/* on BusVoodoo LED is on pin PA8 */
|
/* on BusVoodoo LED is on pin PA8 */
|
||||||
#define LED_PORT A /**< GPIO port (port A) */
|
#define LED_PORT A /**< GPIO port (port A) */
|
||||||
|
|
Loading…
Reference in New Issue