Skip to content

Commit

Permalink
REMOVEME: STM32 test boards
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Dec 21, 2023
1 parent 1e716b0 commit 53cd37e
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 1 deletion.
15 changes: 15 additions & 0 deletions boards/nucleo-f411re/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += fatfs_vfs
USEMODULE += mtd
endif

ifneq (,$(filter mtd,$(USEMODULE)))
ifneq (,$(filter sdmmc,$(USEMODULE)))
USEMODULE += mtd_sdmmc_default
endif
ifneq (,$(filter sdcard_spi,$(USEMODULE)))
USEMODULE += mtd_sdcard_default
endif
endif

include $(RIOTBOARD)/common/nucleo64/Makefile.dep
1 change: 1 addition & 0 deletions boards/nucleo-f411re/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_sdmmc
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
Expand Down
43 changes: 43 additions & 0 deletions boards/nucleo-f411re/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ extern "C" {
static const dma_conf_t dma_config[] = {
{ .stream = 11 }, /* DMA2 Stream 3 - SPI1_TX */
{ .stream = 10 }, /* DMA2 Stream 2 - SPI1_RX */
{ .stream = 14 }, /* DMA2 Stream 6 - SDIO */
};

#define DMA_0_ISR isr_dma2_stream3
#define DMA_1_ISR isr_dma2_stream2
#define DMA_2_ISR isr_dma2_stream6

#define DMA_NUMOF ARRAY_SIZE(dma_config)
/** @} */
Expand Down Expand Up @@ -193,6 +195,47 @@ static const adc_conf_t adc_config[] = {
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */

/**
* @name SDIO/SDMMC configuration
* @{
*/

/**
* @brief SDIO/SDMMC static configuration struct
*/
static const sdmmc_conf_t sdmmc_config[] = {
{
.dev = SDIO,
.bus = APB2,
.rcc_mask = RCC_APB2ENR_SDIOEN,
.cd = GPIO_UNDEF,
.clk = { GPIO_PIN(PORT_C, 12), GPIO_AF12 },
.cmd = { GPIO_PIN(PORT_D, 2), GPIO_AF12 },
.dat0 = { GPIO_PIN(PORT_C, 8), GPIO_AF12 },
.dat1 = { GPIO_PIN(PORT_C, 9), GPIO_AF12 },
.dat2 = { GPIO_PIN(PORT_C, 10), GPIO_AF12 },
.dat3 = { GPIO_PIN(PORT_C, 11), GPIO_AF12 },
#if IS_USED(MODULE_PERIPH_SDMMC_8BIT)
.dat4 = { GPIO_PIN(PORT_B, 8), GPIO_AF12 },
.dat5 = { GPIO_PIN(PORT_B, 9), GPIO_AF12 },
.dat6 = { GPIO_PIN(PORT_C, 6), GPIO_AF12 },
.dat7 = { GPIO_PIN(PORT_C, 7), GPIO_AF12 },
#endif
#if IS_USED(MODULE_PERIPH_DMA)
.dma = 2,
.dma_chan = 4,
#endif
.irqn = SDIO_IRQn
},
};

/**
* @brief Number of available SDIO/SDMMC peripherals
*/
#define SDMMC_NUMOF ARRAY_SIZE(sdmmc_config)

/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
15 changes: 15 additions & 0 deletions boards/nucleo-f446ze/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += fatfs_vfs
USEMODULE += mtd
endif

ifneq (,$(filter mtd,$(USEMODULE)))
ifneq (,$(filter sdmmc,$(USEMODULE)))
USEMODULE += mtd_sdmmc_default
endif
ifneq (,$(filter sdcard_spi,$(USEMODULE)))
USEMODULE += mtd_sdcard_default
endif
endif

include $(RIOTBOARD)/common/nucleo/Makefile.dep
2 changes: 2 additions & 0 deletions boards/nucleo-f446ze/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_can
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_sdmmc
FEATURES_PROVIDED += periph_sdmmc_8bit
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_timer
Expand Down
42 changes: 42 additions & 0 deletions boards/nucleo-f446ze/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ extern "C" {
static const dma_conf_t dma_config[] = {
{ .stream = 11 }, /* DMA2 Stream 3 - SPI1_TX */
{ .stream = 10 }, /* DMA2 Stream 2 - SPI1_RX */
{ .stream = 14 }, /* DMA2 Stream 6 - SDIO */
};

#define DMA_0_ISR isr_dma2_stream3
#define DMA_1_ISR isr_dma2_stream2
#define DMA_2_ISR isr_dma2_stream6

#define DMA_NUMOF ARRAY_SIZE(dma_config)
/** @} */
Expand Down Expand Up @@ -209,6 +211,46 @@ static const adc_conf_t adc_config[] = {

/** @} */

/**
* @name SDIO/SDMMC configuration
* @{
*/

/**
* @brief SDIO/SDMMC static configuration struct
*/
static const sdmmc_conf_t sdmmc_config[] = {
{
.dev = SDIO,
.bus = APB2,
.rcc_mask = RCC_APB2ENR_SDIOEN,
.cd = GPIO_UNDEF,
.clk = { GPIO_PIN(PORT_C, 12), GPIO_AF12 },
.cmd = { GPIO_PIN(PORT_D, 2), GPIO_AF12 },
.dat0 = { GPIO_PIN(PORT_C, 8), GPIO_AF12 },
.dat1 = { GPIO_PIN(PORT_C, 9), GPIO_AF12 },
.dat2 = { GPIO_PIN(PORT_C, 10), GPIO_AF12 },
.dat3 = { GPIO_PIN(PORT_C, 11), GPIO_AF12 },
#if IS_USED(MODULE_PERIPH_SDMMC_8BIT)
.dat4 = { GPIO_PIN(PORT_B, 8), GPIO_AF12 },
.dat5 = { GPIO_PIN(PORT_B, 9), GPIO_AF12 },
.dat6 = { GPIO_PIN(PORT_C, 6), GPIO_AF12 },
.dat7 = { GPIO_PIN(PORT_C, 7), GPIO_AF12 },
#endif
#if IS_USED(MODULE_PERIPH_DMA)
.dma = 2,
.dma_chan = 4,
#endif
.irqn = SDIO_IRQn
},
};

/**
* @brief Number of available SDIO/SDMMC peripherals
*/
#define SDMMC_NUMOF ARRAY_SIZE(sdmmc_config)

/** @} */
#ifdef __cplusplus
}
#endif
Expand Down
15 changes: 15 additions & 0 deletions boards/nucleo-f767zi/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,19 @@ ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += stm32_eth
endif

# default to using fatfs on SD card
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += fatfs_vfs
USEMODULE += mtd
endif

ifneq (,$(filter mtd,$(USEMODULE)))
ifneq (,$(filter sdmmc,$(USEMODULE)))
USEMODULE += mtd_sdmmc_default
endif
ifneq (,$(filter sdcard_spi,$(USEMODULE)))
USEMODULE += mtd_sdcard_default
endif
endif

include $(RIOTBOARD)/common/nucleo/Makefile.dep
1 change: 1 addition & 0 deletions boards/nucleo-f767zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FEATURES_PROVIDED += periph_ptp_txrx_timestamps
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_sdmmc
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
Expand Down
2 changes: 2 additions & 0 deletions boards/nucleo-f767zi/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ static const dma_conf_t dma_config[] = {
{ .stream = 14 }, /* DMA2 Stream 6 - USART6_TX */
{ .stream = 6 }, /* DMA1 Stream 6 - USART2_TX */
{ .stream = 8 }, /* DMA2 Stream 0 - ETH_TX */
{ .stream = 11 }, /* DMA2 Stream 3 - SDMMC1 */
};

#define DMA_0_ISR isr_dma1_stream4
#define DMA_1_ISR isr_dma2_stream6
#define DMA_2_ISR isr_dma1_stream6
#define DMA_3_ISR isr_dma2_stream0
#define DMA_4_ISR isr_dma2_stream3

#define DMA_NUMOF ARRAY_SIZE(dma_config)
/** @} */
Expand Down
2 changes: 1 addition & 1 deletion tests/pkg/littlefs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* CONFIG_USE_HARDWARE_MTD is defined (add CFLAGS=-DCONFIG_USE_HARDWARE_MTD to
* the command line to enable it */
#if defined(MTD_0) && IS_ACTIVE(CONFIG_USE_HARDWARE_MTD)

extern mtd_dev_t *mtd0;
#define _dev (MTD_0)

#else
Expand Down

0 comments on commit 53cd37e

Please sign in to comment.