From 6eebc0e7189f46790eed2e4d0fe05f64ced52fa7 Mon Sep 17 00:00:00 2001 From: ZYH Date: Tue, 19 Mar 2019 11:27:21 +0800 Subject: [PATCH] [BSP][k210]fix depend --- bsp/k210/.config | 104 ++++++++++++++---------------------- bsp/k210/applications/mnt.c | 3 ++ bsp/k210/driver/Kconfig | 2 +- bsp/k210/driver/SConscript | 10 +++- bsp/k210/rtconfig.h | 91 +++++++++++++------------------ bsp/k210/rtconfig.py | 2 +- 6 files changed, 91 insertions(+), 121 deletions(-) diff --git a/bsp/k210/.config b/bsp/k210/.config index ba91c1ab93..6d791c8da2 100644 --- a/bsp/k210/.config +++ b/bsp/k210/.config @@ -112,7 +112,23 @@ CONFIG_DFS_FILESYSTEMS_MAX=4 CONFIG_DFS_FILESYSTEM_TYPES_MAX=4 CONFIG_DFS_FD_MAX=16 # CONFIG_RT_USING_DFS_MNTTABLE is not set -# CONFIG_RT_USING_DFS_ELMFAT is not set +CONFIG_RT_USING_DFS_ELMFAT=y + +# +# elm-chan's FatFs, Generic FAT Filesystem Module +# +CONFIG_RT_DFS_ELM_CODE_PAGE=437 +CONFIG_RT_DFS_ELM_WORD_ACCESS=y +# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set +CONFIG_RT_DFS_ELM_USE_LFN_3=y +CONFIG_RT_DFS_ELM_USE_LFN=3 +CONFIG_RT_DFS_ELM_MAX_LFN=255 +CONFIG_RT_DFS_ELM_DRIVES=2 +CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512 +# CONFIG_RT_DFS_ELM_USE_ERASE is not set +CONFIG_RT_DFS_ELM_REENTRANT=y CONFIG_RT_USING_DFS_DEVFS=y # CONFIG_RT_USING_DFS_ROMFS is not set # CONFIG_RT_USING_DFS_RAMFS is not set @@ -131,7 +147,7 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64 # CONFIG_RT_USING_HWTIMER is not set # CONFIG_RT_USING_CPUTIME is not set # CONFIG_RT_USING_I2C is not set -# CONFIG_RT_USING_PIN is not set +CONFIG_RT_USING_PIN=y # CONFIG_RT_USING_ADC is not set # CONFIG_RT_USING_PWM is not set # CONFIG_RT_USING_MTD_NOR is not set @@ -140,7 +156,14 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64 # CONFIG_RT_USING_PM is not set # CONFIG_RT_USING_RTC is not set # CONFIG_RT_USING_SDIO is not set -# CONFIG_RT_USING_SPI is not set +CONFIG_RT_USING_SPI=y +# CONFIG_RT_USING_QSPI is not set +CONFIG_RT_USING_SPI_MSD=y +# CONFIG_RT_USING_SFUD is not set +# CONFIG_RT_USING_W25QXX is not set +# CONFIG_RT_USING_GD is not set +# CONFIG_RT_USING_ENC28J60 is not set +# CONFIG_RT_USING_SPI_WIFI is not set # CONFIG_RT_USING_WDT is not set # CONFIG_RT_USING_AUDIO is not set # CONFIG_RT_USING_SENSOR is not set @@ -218,6 +241,7 @@ CONFIG_RT_USING_POSIX=y # CONFIG_PKG_USING_WEBTERMINAL is not set # CONFIG_PKG_USING_CJSON is not set # CONFIG_PKG_USING_JSMN is not set +# CONFIG_PKG_USING_LIBMODBUS is not set # CONFIG_PKG_USING_LJSON is not set # CONFIG_PKG_USING_EZXML is not set # CONFIG_PKG_USING_NANOPB is not set @@ -327,6 +351,7 @@ CONFIG_RT_USING_POSIX=y # CONFIG_PKG_USING_MPU6XXX is not set # CONFIG_PKG_USING_PCF8574 is not set # CONFIG_PKG_USING_SX12XX is not set +# CONFIG_PKG_USING_SIGNAL_LED is not set CONFIG_PKG_USING_KENDRYTE_SDK=y CONFIG_PKG_KENDRYTE_SDK_PATH="/packages/peripherals/kendryte-sdk" CONFIG_PKG_USING_KENDRYTE_SDK_V052=y @@ -357,74 +382,22 @@ CONFIG_PKG_KENDRYTE_SDK_VER="v0.5.2" # CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set # CONFIG_PKG_USING_HELLO is not set # CONFIG_PKG_USING_VI is not set - -# -# Privated Packages of RealThread -# -# CONFIG_PKG_USING_CODEC is not set -# CONFIG_PKG_USING_PLAYER is not set -# CONFIG_PKG_USING_MPLAYER is not set -# CONFIG_PKG_USING_PERSIMMON_SRC is not set -# CONFIG_PKG_USING_JS_PERSIMMON is not set -# CONFIG_PKG_USING_JERRYSCRIPT_WIN32 is not set - -# -# Network Utilities -# -# CONFIG_PKG_USING_WICED is not set -# CONFIG_PKG_USING_CLOUDSDK is not set -# CONFIG_PKG_USING_COREMARK is not set -# CONFIG_PKG_USING_POWER_MANAGER is not set -# CONFIG_PKG_USING_RT_OTA is not set -# CONFIG_PKG_USING_RDBD_SRC is not set -# CONFIG_PKG_USING_RTINSIGHT is not set -# CONFIG_PKG_USING_SMARTCONFIG is not set -# CONFIG_PKG_USING_RTX is not set -# CONFIG_RT_USING_TESTCASE is not set -# CONFIG_PKG_USING_NGHTTP2 is not set -# CONFIG_PKG_USING_AVS is not set -# CONFIG_PKG_USING_STS is not set -# CONFIG_PKG_USING_DLMS is not set - -# -# Test Packages of RealThread -# - -# -# RT-Thread Senior Membership Packages -# - -# -# system packages -# -# CONFIG_PKG_USING_FTL_SRC is not set - -# -# IoT - internet of things -# - -# -# Webnet: A web server package for rt-thread -# - -# -# rtpkgs online packages -# -# CONFIG_PKG_USING_CSTRING is not set -# CONFIG_PKG_USING_ARGPARSE is not set -# CONFIG_PKG_USING_LIBBMPREAD is not set -# CONFIG_PKG_USING_LIBUTILS is not set -# CONFIG_PKG_USING_SAM is not set -# CONFIG_PKG_USING_LIBCALLBACK is not set -# CONFIG_PKG_USING_Z_EVENT is not set -# CONFIG_PKG_USING_LIBSTM32HAL is not set CONFIG_BOARD_K210_EVB=y CONFIG_BSP_USING_UART_HS=y # CONFIG_BSP_USING_UART1 is not set # CONFIG_BSP_USING_UART2 is not set # CONFIG_BSP_USING_UART3 is not set # CONFIG_BSP_USING_I2C1 is not set -# CONFIG_BSP_USING_SPI1 is not set +CONFIG_BSP_USING_SPI1=y +# CONFIG_BSP_USING_SPI1_AS_QSPI is not set +CONFIG_BSP_SPI1_CLK_PIN=29 +CONFIG_BSP_SPI1_D0_PIN=30 +CONFIG_BSP_SPI1_D1_PIN=31 +CONFIG_BSP_SPI1_USING_SS0=y +CONFIG_BSP_SPI1_SS0_PIN=32 +# CONFIG_BSP_SPI1_USING_SS1 is not set +# CONFIG_BSP_SPI1_USING_SS2 is not set +# CONFIG_BSP_SPI1_USING_SS3 is not set CONFIG_BSP_USING_LCD=y CONFIG_BSP_LCD_CS_PIN=6 CONFIG_BSP_LCD_WR_PIN=7 @@ -439,4 +412,5 @@ CONFIG_BSP_CAMERA_CMOS_VSYNC_PIN=12 CONFIG_BSP_CAMERA_CMOS_PWDN_PIN=13 CONFIG_BSP_CAMERA_CMOS_XCLK_PIN=14 CONFIG_BSP_CAMERA_CMOS_PCLK_PIN=15 +CONFIG_BSP_CAMERA_CMOS_HREF_PIN=17 CONFIG___STACKSIZE__=4096 diff --git a/bsp/k210/applications/mnt.c b/bsp/k210/applications/mnt.c index 29557d71b2..0ded757117 100644 --- a/bsp/k210/applications/mnt.c +++ b/bsp/k210/applications/mnt.c @@ -8,6 +8,7 @@ */ #include +#if defined(RT_USING_SPI_MSD) && defined(RT_USING_DFS_ELMFAT) #include #include int mnt_init(void) @@ -20,3 +21,5 @@ int mnt_init(void) return 0; } INIT_ENV_EXPORT(mnt_init); +#endif + diff --git a/bsp/k210/driver/Kconfig b/bsp/k210/driver/Kconfig index 7ba893a6f0..4d38a7c9b2 100644 --- a/bsp/k210/driver/Kconfig +++ b/bsp/k210/driver/Kconfig @@ -50,7 +50,7 @@ if BSP_USING_SPI1 if BSP_SPI1_USING_SS0 config BSP_SPI1_SS0_PIN int "spi1 ss0 pin number" - default 24 + default 32 endif menuconfig BSP_SPI1_USING_SS1 bool "SPI1 Enable SS1" diff --git a/bsp/k210/driver/SConscript b/bsp/k210/driver/SConscript index 4f1741e838..75a634227a 100644 --- a/bsp/k210/driver/SConscript +++ b/bsp/k210/driver/SConscript @@ -37,4 +37,12 @@ if GetDepend('RT_USING_WDT'): group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) -Return('group') +objs = [group] + +list = os.listdir(cwd) + +for item in list: + if os.path.isfile(os.path.join(cwd, item, 'SConscript')): + objs = objs + SConscript(os.path.join(item, 'SConscript')) + +Return('objs') diff --git a/bsp/k210/rtconfig.h b/bsp/k210/rtconfig.h index 6cc8ae9063..e3891e1634 100644 --- a/bsp/k210/rtconfig.h +++ b/bsp/k210/rtconfig.h @@ -105,7 +105,22 @@ #define DFS_FILESYSTEM_TYPES_MAX 4 #define DFS_FD_MAX 16 /* RT_USING_DFS_MNTTABLE is not set */ -/* RT_USING_DFS_ELMFAT is not set */ +#define RT_USING_DFS_ELMFAT + +/* elm-chan's FatFs, Generic FAT Filesystem Module */ + +#define RT_DFS_ELM_CODE_PAGE 437 +#define RT_DFS_ELM_WORD_ACCESS +/* RT_DFS_ELM_USE_LFN_0 is not set */ +/* RT_DFS_ELM_USE_LFN_1 is not set */ +/* RT_DFS_ELM_USE_LFN_2 is not set */ +#define RT_DFS_ELM_USE_LFN_3 +#define RT_DFS_ELM_USE_LFN 3 +#define RT_DFS_ELM_MAX_LFN 255 +#define RT_DFS_ELM_DRIVES 2 +#define RT_DFS_ELM_MAX_SECTOR_SIZE 512 +/* RT_DFS_ELM_USE_ERASE is not set */ +#define RT_DFS_ELM_REENTRANT #define RT_USING_DFS_DEVFS /* RT_USING_DFS_ROMFS is not set */ /* RT_USING_DFS_RAMFS is not set */ @@ -123,7 +138,7 @@ /* RT_USING_HWTIMER is not set */ /* RT_USING_CPUTIME is not set */ /* RT_USING_I2C is not set */ -/* RT_USING_PIN is not set */ +#define RT_USING_PIN /* RT_USING_ADC is not set */ /* RT_USING_PWM is not set */ /* RT_USING_MTD_NOR is not set */ @@ -132,7 +147,14 @@ /* RT_USING_PM is not set */ /* RT_USING_RTC is not set */ /* RT_USING_SDIO is not set */ -/* RT_USING_SPI is not set */ +#define RT_USING_SPI +/* RT_USING_QSPI is not set */ +#define RT_USING_SPI_MSD +/* RT_USING_SFUD is not set */ +/* RT_USING_W25QXX is not set */ +/* RT_USING_GD is not set */ +/* RT_USING_ENC28J60 is not set */ +/* RT_USING_SPI_WIFI is not set */ /* RT_USING_WDT is not set */ /* RT_USING_AUDIO is not set */ /* RT_USING_SENSOR is not set */ @@ -196,6 +218,7 @@ /* PKG_USING_WEBTERMINAL is not set */ /* PKG_USING_CJSON is not set */ /* PKG_USING_JSMN is not set */ +/* PKG_USING_LIBMODBUS is not set */ /* PKG_USING_LJSON is not set */ /* PKG_USING_EZXML is not set */ /* PKG_USING_NANOPB is not set */ @@ -292,6 +315,7 @@ /* PKG_USING_MPU6XXX is not set */ /* PKG_USING_PCF8574 is not set */ /* PKG_USING_SX12XX is not set */ +/* PKG_USING_SIGNAL_LED is not set */ #define PKG_USING_KENDRYTE_SDK #define PKG_USING_KENDRYTE_SDK_V052 /* PKG_USING_KENDRYTE_SDK_LATEST_VERSION is not set */ @@ -318,62 +342,22 @@ /* PKG_USING_PERIPHERAL_SAMPLES is not set */ /* PKG_USING_HELLO is not set */ /* PKG_USING_VI is not set */ - -/* Privated Packages of RealThread */ - -/* PKG_USING_CODEC is not set */ -/* PKG_USING_PLAYER is not set */ -/* PKG_USING_MPLAYER is not set */ -/* PKG_USING_PERSIMMON_SRC is not set */ -/* PKG_USING_JS_PERSIMMON is not set */ -/* PKG_USING_JERRYSCRIPT_WIN32 is not set */ - -/* Network Utilities */ - -/* PKG_USING_WICED is not set */ -/* PKG_USING_CLOUDSDK is not set */ -/* PKG_USING_COREMARK is not set */ -/* PKG_USING_POWER_MANAGER is not set */ -/* PKG_USING_RT_OTA is not set */ -/* PKG_USING_RDBD_SRC is not set */ -/* PKG_USING_RTINSIGHT is not set */ -/* PKG_USING_SMARTCONFIG is not set */ -/* PKG_USING_RTX is not set */ -/* RT_USING_TESTCASE is not set */ -/* PKG_USING_NGHTTP2 is not set */ -/* PKG_USING_AVS is not set */ -/* PKG_USING_STS is not set */ -/* PKG_USING_DLMS is not set */ - -/* Test Packages of RealThread */ - -/* RT-Thread Senior Membership Packages */ - -/* system packages */ - -/* PKG_USING_FTL_SRC is not set */ - -/* IoT - internet of things */ - -/* Webnet: A web server package for rt-thread */ - -/* rtpkgs online packages */ - -/* PKG_USING_CSTRING is not set */ -/* PKG_USING_ARGPARSE is not set */ -/* PKG_USING_LIBBMPREAD is not set */ -/* PKG_USING_LIBUTILS is not set */ -/* PKG_USING_SAM is not set */ -/* PKG_USING_LIBCALLBACK is not set */ -/* PKG_USING_Z_EVENT is not set */ -/* PKG_USING_LIBSTM32HAL is not set */ #define BOARD_K210_EVB #define BSP_USING_UART_HS /* BSP_USING_UART1 is not set */ /* BSP_USING_UART2 is not set */ /* BSP_USING_UART3 is not set */ /* BSP_USING_I2C1 is not set */ -/* BSP_USING_SPI1 is not set */ +#define BSP_USING_SPI1 +/* BSP_USING_SPI1_AS_QSPI is not set */ +#define BSP_SPI1_CLK_PIN 29 +#define BSP_SPI1_D0_PIN 30 +#define BSP_SPI1_D1_PIN 31 +#define BSP_SPI1_USING_SS0 +#define BSP_SPI1_SS0_PIN 32 +/* BSP_SPI1_USING_SS1 is not set */ +/* BSP_SPI1_USING_SS2 is not set */ +/* BSP_SPI1_USING_SS3 is not set */ #define BSP_USING_LCD #define BSP_LCD_CS_PIN 6 #define BSP_LCD_WR_PIN 7 @@ -388,6 +372,7 @@ #define BSP_CAMERA_CMOS_PWDN_PIN 13 #define BSP_CAMERA_CMOS_XCLK_PIN 14 #define BSP_CAMERA_CMOS_PCLK_PIN 15 +#define BSP_CAMERA_CMOS_HREF_PIN 17 #define __STACKSIZE__ 4096 #endif diff --git a/bsp/k210/rtconfig.py b/bsp/k210/rtconfig.py index 4610f85adc..686f7f7412 100644 --- a/bsp/k210/rtconfig.py +++ b/bsp/k210/rtconfig.py @@ -27,7 +27,7 @@ BUILD = 'release' if PLATFORM == 'gcc': # toolchains - PREFIX = 'riscv64-unknown-elf-' + PREFIX = 'riscv-none-embed-' CC = PREFIX + 'gcc' CXX = PREFIX + 'g++' AS = PREFIX + 'gcc'