Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions boards/nucleo-f042k6.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef __BOARD_H__
#define __BOARD_H__

#include <stdbool.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>

/*
* Board definitions for ST's Nucleo-32 reference board with STM32F042K6
* https://www.st.com/en/evaluation-tools/nucleo-f042k6.html
*
* The USB port on the board is connected to an onboard ST-LINK.
* F042's actual USB port is exposed on the pin headers:
*
* USB | Nucleo pin
* ------|------------
* D- | D10
* D+ | D2
* 5V | 5V
* GND | GND
*
* SPI | Nucleo pin
* ------|------------
* CS | A3
* SCK | A4
* MISO | A5
* MOSI | A6
*
*/

#define BOARD_USE_DEBUG_PINS_AS_GPIO false

#define BOARD_RCC_LED RCC_GPIOB
#define BOARD_PORT_LED GPIOB
#define BOARD_PIN_LED GPIO3

/* Only LED, high active, use as idle. */
#define BOARD_LED_HIGH_IS_BUSY false

/* STM32F0x2 has internal USB pullup. */

/* Currently you can only use SPI1, since it has highest clock. */

#endif /* __BOARD_H__ */
4 changes: 4 additions & 0 deletions boards/nucleo-f042k6.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ARCH_FLAGS = -DSTM32F0 -mthumb -mcpu=cortex-m0 -msoft-float
LDSCRIPT = boards/ld/stm32f04xz6.ld
LIBOPENCM3 = libopencm3/lib/libopencm3_stm32f0.a
OPENCM3_MK = lib/stm32/f0