4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 08:23:30 +08:00

[stm32][rt-spark] support nano version

This commit is contained in:
Meco Man 2023-12-28 01:09:02 +08:00 committed by Rbb666
parent 975af5fd54
commit 0ad5c9585d
22 changed files with 112 additions and 98 deletions

View File

@ -8,11 +8,13 @@
* 2018-12-22 zylx first version
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -10,11 +10,13 @@
*
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -8,11 +8,13 @@
* 2018-12-5 SummerGift first version
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -8,11 +8,13 @@
* 2018-12-5 SummerGift first version
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -11,11 +11,13 @@
* 2021-8-11 CX fix the sector calculation error bug
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -8,11 +8,13 @@
* 2020-06-27 NU-LL first version
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -12,11 +12,13 @@
* 2021-3-3 zhuyf233 fix some bugs
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -8,11 +8,13 @@
* 2018-12-5 SummerGift first version
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -8,11 +8,13 @@
* 2020-10-14 Dozingfiretruck first version
*/
#include "board.h"
#include <rtconfig.h>
#include <rtdef.h>
#ifdef BSP_USING_ON_CHIP_FLASH
#include "drv_config.h"
#include "drv_flash.h"
#include <board.h>
#if defined(RT_USING_FAL)
#include "fal.h"

View File

@ -0,0 +1 @@
CONFIG_RT_USING_NANO=y

View File

@ -15,7 +15,21 @@ config PKGS_DIR
option env="PKGS_ROOT"
default "packages"
config SOC_STM32F407ZG
bool
select SOC_SERIES_STM32F4
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y
config BOARD_STM32F407_SPARK
bool
default y
source "$RTT_DIR/Kconfig"
source "../libraries/Kconfig"
source "board/Kconfig"
source "$PKGS_DIR/Kconfig"
source "../libraries/Kconfig"
if !RT_USING_NANO
source "board/Kconfig"
endif

View File

@ -6,12 +6,15 @@
* Change Logs:
* Date Author Notes
* 2023-07-06 Supperthomas first version
* 2023-12-03 Meco Man support nano version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include <rtthread.h>
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#endif /* RT_USING_NANO */
#define GPIO_LED_B GET_PIN(F, 11)
#define GPIO_LED_R GET_PIN(F, 12)

View File

@ -1,16 +1,5 @@
menu "Hardware Drivers Config"
config SOC_STM32F407ZG
bool
select SOC_SERIES_STM32F4
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y
config BOARD_STM32F407_SPARK
bool
default y
menu "Onboard Peripheral Drivers"
config BSP_USING_USB_TO_USART
@ -31,7 +20,7 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_UART
select BSP_USING_UART3
default n
menuconfig BSP_USING_RS485
bool "Enable RS485 (uart6)"
select BSP_USING_UART
@ -69,7 +58,7 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_PWM14_CH1
endif
config BSP_USING_ONBOARD_LED_MATRIX
config BSP_USING_ONBOARD_LED_MATRIX
bool "Enable Led MATRIX"
default n
select BSP_USING_PWM
@ -108,7 +97,7 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_I2C1
default n
config BSP_USING_ENC28j60
config BSP_USING_ENC28j60
bool "Enable Ethernet 28j60"
default n
select BSP_USING_SPI
@ -127,45 +116,45 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_SDIO
select RT_USING_DFS_ELMFAT
default n
if BSP_USING_SDCARD_FATFS
menuconfig BSP_USING_FS_AUTO_MOUNT
bool "Enable filesystem auto mount"
default y
endif
config BSP_USING_FLASH_FATFS
bool "Enable FAL filesystem partition base on W25Q64"
select BSP_USING_FAL
default n
if BSP_USING_FLASH_FATFS
menuconfig BSP_USING_FLASH_FS_AUTO_MOUNT
bool "Enable filesystem auto mount"
default y
endif
if BSP_USING_SDCARD_FATFS
menuconfig BSP_USING_FS_AUTO_MOUNT
bool "Enable filesystem auto mount"
default y
endif
config BSP_USING_FLASH_FATFS
bool "Enable FAL filesystem partition base on W25Q64"
select BSP_USING_FAL
default n
if BSP_USING_FLASH_FATFS
menuconfig BSP_USING_FLASH_FS_AUTO_MOUNT
bool "Enable filesystem auto mount"
default y
endif
endif
config BSP_USING_FAL
bool "Enable FAL (enable on-chip flash and spi2 flash)"
select BSP_USING_SPI_FLASH
select RT_USING_FAL
select FAL_DEBUG_CONFIG
select FAL_PART_HAS_TABLE_CFG
select FAL_USING_SFUD_PORT
bool "Enable FAL (enable on-chip flash and spi2 flash)"
select BSP_USING_SPI_FLASH
select RT_USING_FAL
select FAL_DEBUG_CONFIG
select FAL_PART_HAS_TABLE_CFG
select FAL_USING_SFUD_PORT
select BSP_USING_ON_CHIP_FLASH
if BSP_USING_FAL
menuconfig BSP_USING_BOOTLOADER
bool "Enable bootloader partition table"
default n
endif
config BSP_USING_EASYFLASH
if BSP_USING_FAL
menuconfig BSP_USING_BOOTLOADER
bool "Enable bootloader partition table"
default n
endif
config BSP_USING_EASYFLASH
bool "Enable Easy Flash base on FAL"
select BSP_USING_FAL
select PKG_USING_EASYFLASH
default n
menuconfig BSP_USING_RW007_WLAN
bool "Enable Rw007 Wlan Base on SPI2"
default n
@ -192,9 +181,9 @@ menu "Onboard Peripheral Drivers"
int "RW007 RESET pin index"
default 111
endif
config BSP_USING_AHT21
bool "Enable AHT21(i2c3)"
bool "Enable AHT21(i2c3)"
select BSP_USING_I2C
select BSP_USING_I2C3
select PKG_USING_SENSORS_DRIVERS
@ -249,9 +238,9 @@ menu "Onboard Peripheral Drivers"
config BSP_USING_AUDIO_RECORD
bool "Enable Audio Record"
default n
endif
endif
endmenu
menu "On-chip Peripheral Drivers"
@ -369,23 +358,6 @@ menu "On-chip Peripheral Drivers"
default n
endif
menuconfig BSP_USING_ONCHIP_RTC
bool "Enable RTC"
select RT_USING_RTC
default n
if BSP_USING_ONCHIP_RTC
choice
prompt "Select clock source"
default BSP_RTC_USING_LSE
config BSP_RTC_USING_LSE
bool "RTC USING LSE"
config BSP_RTC_USING_LSI
bool "RTC USING LSI"
endchoice
endif
menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
@ -450,7 +422,7 @@ menu "On-chip Peripheral Drivers"
range 1 176
default 91
endif
menuconfig BSP_USING_SOFT_SPI2
bool "Enable soft SPI2 BUS (software simulation)"
default n
@ -553,7 +525,7 @@ menu "On-chip Peripheral Drivers"
range 0 143
default 80
endif
menuconfig BSP_USING_I2C3
bool "Enable I2C3 BUS for AHT21 Onboard(software simulation)"
default n
@ -577,7 +549,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_PM
select RT_USING_HOOK
default n
menuconfig BSP_USING_DAC
bool "Enable DAC"
default n

View File

@ -9,6 +9,7 @@
*/
#include "board.h"
#include <drv_common.h>
void SystemClock_Config(void)
{

View File

@ -12,10 +12,7 @@
#ifndef __BOARD_H__
#define __BOARD_H__
#include <rtthread.h>
#include <stm32f4xx.h>
#include "drv_common.h"
#include "drv_gpio.h"
#ifdef __cplusplus
extern "C" {

View File

@ -8,10 +8,11 @@
* 2018-08-27 ZYLX the first version
*/
#include <drivers/pin.h>
#include <rtdevice.h>
#include <enc28j60.h>
#include "drv_spi.h"
#include "board.h"
#include <drv_spi.h>
#include <drv_gpio.h>
#include <board.h>
#define PIN_NRF_IRQ GET_PIN(E,2)
#define PIN_SPI_CS GET_PIN(A,4)

View File

@ -11,8 +11,9 @@
#ifndef _FAL_CFG_H_
#define _FAL_CFG_H_
#include <rtthread.h>
#include <board.h>
#include <fal_def.h>
#define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
#define FLASH_SIZE_GRANULARITY_64K (8 * 64 * 1024)
#define FLASH_SIZE_GRANULARITY_128K (8 * 128 * 1024)

View File

@ -13,7 +13,8 @@
#include <rtdevice.h>
#include <board.h>
#include "string.h"
#include <string.h>
#include <drv_gpio.h>
#include "drv_lcd.h"
#include "drv_lcd_font.h"

View File

@ -21,19 +21,21 @@
* - logic 1 is: 900ns(H) + 400ns(L)
*/
#include <rtdevice.h>
#include <board.h>
#include <drv_matrix_led.h>
#include <drv_common.h>
#include <drv_gpio.h>
#ifndef LED_NUM
#define LED_NUM 19 // LED灯珠个数
#define LED_NUM 19 // LED灯珠个数
#endif
#define LED_MATRIX_EN_PIN GET_PIN(F, 2)
TIM_HandleTypeDef htim3;
DMA_HandleTypeDef hdma_tim3_ch2;
rt_align(4)
uint8_t led_buffer[LED_NUM * 24 * 2];
rt_align(RT_ALIGN_SIZE) uint8_t led_buffer[LED_NUM * 24 * 2];
extern void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);

View File

@ -9,7 +9,9 @@
* 2023-05-05 yuanjie add test method
*/
#include <rtdevice.h>
#include <board.h>
#include <drv_gpio.h>
#include "drv_rs485.h"
#ifdef BSP_USING_RS485
@ -134,4 +136,4 @@ void rs485_test(int argc, void **argv)
}
MSH_CMD_EXPORT(rs485_test, test rs485 transmission);
#endif /* bsp_using_RS485 */
#endif /* BSP_USING_RS485 */

View File

@ -11,8 +11,8 @@
#include <rtthread.h>
#include "spi_flash.h"
#include "spi_flash_sfud.h"
#include "drv_spi.h"
#include "drv_soft_spi.h"
#include <drv_spi.h>
#include <drv_soft_spi.h>
#ifdef BSP_USING_SOFT_SPI_FLASH

View File

@ -11,7 +11,8 @@
#include <rtthread.h>
#include "spi_flash.h"
#include "spi_flash_sfud.h"
#include "drv_spi.h"
#include <drv_spi.h>
#include <drv_gpio.h>
#if defined(BSP_USING_SPI_FLASH)