[bsp/phytium]部分设备驱动修改 (#8794)

* update

* 修改 SDIF 驱动,支持同时使用 TF 卡和 eMMC,更换飞腾派自启动镜像

* drivers debug

* update

* update

* update config

* update

* modify format

---------

Co-authored-by: 朱耿宇 <zhugengyu@phytium.com.cn>
This commit is contained in:
zhangyan 2024-04-19 08:52:09 +08:00 committed by GitHub
parent 6311bcaf24
commit de32f35016
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
46 changed files with 1546 additions and 946 deletions

View File

@ -58,6 +58,7 @@
2. 启动 RT-Thread env 应用程序,在交互界面可以使用`cd`指令进入`aarch32`或`aarch64`目录
3. 按照指导安装 [aarch32](./aarch32/README.md)或[aarch64](./aarch64/README.md)编译链,并进行相关配置
4. 按照指导[启动镜像程序](./doc/how_to_flashed_binary.md)
5. 参考[使用文件系统](./doc/how_to_use_file_system.md)制作和使用文件系统
### RT-Thread Studio 环境

View File

@ -1219,9 +1219,16 @@ CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
# CONFIG_BSP_USING_CAN is not set
CONFIG_BSP_USING_CAN=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
# CONFIG_RT_USING_CAN0 is not set
# CONFIG_RT_USING_CAN1 is not set
CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_QSPI is not set
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
CONFIG_USING_QSPI_CHANNEL0=y
# CONFIG_USING_QSPI_CHANNEL1 is not set
CONFIG_BSP_USING_ETH=y
CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
@ -1252,10 +1259,15 @@ CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
# CONFIG_USING_SDIF0 is not set
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1279,6 +1291,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
@ -1286,7 +1299,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -1,140 +0,0 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Email: opensource_embedded@phytium.com.cn
*
* Change Logs:
* Date Author Notes
* 2023-04-27 huanghe first version
* 2023-07-14 liqiaozhong add SD file sys mount func
*
*/
#include <rtthread.h>
#if defined(RT_USING_DFS)
#include <rtdbg.h>
#include <dfs_fs.h>
#include <dfs_file.h>
static int ram_disk_mount(const char *mount_point)
{
#ifdef RT_USING_DFS_RAMFS
extern struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size);
rt_uint8_t *pool = RT_NULL;
rt_size_t size = 8 * 1024 * 1024;
pool = rt_malloc(size);
if (pool == RT_NULL)
{
LOG_E("Malloc fail!");
}
if (dfs_mount(RT_NULL, mount_point, "ram", 0, (const void *)dfs_ramfs_create(pool, size)) == 0)
{
LOG_I("RAM file system initializated!");
}
else
{
LOG_E("RAM file system initializate failed!");
}
#endif
return RT_EOK;
}
#ifdef BSP_USING_SDCARD_FATFS
extern void fsdif_change(void);
static int sd_disk_try_mount(char *device_name, char *mount_point, char *fs_type_name, int mkfs_count)
{
struct statfs fs_stat;
int rc = 0;
LOG_I("mount(\"%s\",\"%s\",\"%s\");", device_name, mount_point, fs_type_name);
if (rt_device_find(device_name) == NULL)
{
LOG_I("%s not find!!!", device_name);
return -RT_EIO;
}
mkdir(mount_point, 0);
_remount:
rc = dfs_mount(device_name, mount_point, fs_type_name, 0, 0);
if (rc == 0)
{
LOG_I("mounted %s on %s", device_name, mount_point);
if (dfs_statfs(mount_point, &fs_stat) >= 0)
{
LOG_I("%s size:%d, total: %d, free: %d", mount_point,
fs_stat.f_bsize, fs_stat.f_blocks, fs_stat.f_bfree);
}
}
else
{
if (mkfs_count > 0)
{
/* LOG_I("[%s]try mkfs -t %s %s ", mkfs_count, fs_type_name, device_name);
dfs_mkfs(fs_type_name, device_name); */
mkfs_count--;
LOG_E("%s is not in %s, please format first !!!", device_name, fs_type_name);
goto _remount;
}
LOG_I("mount failed :%d ", rc);
return -RT_EIO;
}
return RT_EOK;
}
static void sd_filesytem_task_entry(void *parameter)
{
int result;
LOG_D("sdio host change: %d", change);
mmcsd_wait_cd_changed(0); /* clear */
fsdif_change(); /* send cd change to host */
/* block until plug/unplug event happens */
result = mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
if (result == MMCSD_HOST_PLUGED)
{
rt_kprintf("mmcsd change pluged \n");
/* mount sdcard partition as / */
if (RT_EOK == sd_disk_try_mount(BSP_USING_SDCARD_PARTITION, "/", "elm", 0))
{
ram_disk_mount("/ram"); /* mount ramdisk if configured */
}
}
}
int filesystem_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_filesytem", sd_filesytem_task_entry,
RT_NULL,
4096,
RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
LOG_E("create sd mount task error!");
}
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);
#else
static int filesystem_mount(void)
{
return ram_disk_mount("/"); /* mount ramdisk as / */
}
INIT_APP_EXPORT(filesystem_mount);
#endif // #ifdef BSP_USING_SDCARD_FATFS
#endif // #if defined(RT_USING_DFS)

View File

@ -78,7 +78,7 @@ CONFIG_RT_USING_HEAP=y
CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_DEVICE_OPS=y
# CONFIG_RT_USING_INTERRUPT_INFO is not set
# CONFIG_RT_USING_THREADSAFE_PRINTF is not set
CONFIG_RT_USING_THREADSAFE_PRINTF=y
CONFIG_RT_USING_SCHED_THREAD_CTX=y
CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=256
@ -135,7 +135,6 @@ CONFIG_RT_USING_DFS=y
CONFIG_DFS_USING_POSIX=y
CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FD_MAX=16
# CONFIG_RT_USING_DFS_V1 is not set
CONFIG_RT_USING_DFS_V2=y
CONFIG_RT_USING_DFS_ELMFAT=y
@ -163,6 +162,7 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_DFS_ELM_USE_EXFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
CONFIG_RT_USING_DFS_PTYFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
CONFIG_RT_USING_DFS_MQUEUE=y
@ -193,10 +193,8 @@ CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=1024
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
CONFIG_RT_USING_CAN=y
CONFIG_RT_CAN_USING_HDR=y
# CONFIG_RT_CAN_USING_HDR is not set
CONFIG_RT_CAN_USING_CANFD=y
# CONFIG_RT_USING_CPUTIME is not set
CONFIG_RT_USING_I2C=y
@ -421,10 +419,11 @@ CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_LWP_ENABLE_ASID=y
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set
CONFIG_RT_USING_LDSO=y
# CONFIG_ELF_DEBUG_ENABLE is not set
# CONFIG_ELF_LOAD_RANDOMIZE is not set
CONFIG_LWP_USING_TERMINAL=y
CONFIG_LWP_PTY_MAX_PARIS_LIMIT=64
#
# Memory management
@ -1246,13 +1245,13 @@ CONFIG_RT_USING_UART1=y
# CONFIG_RT_USING_UART2 is not set
# CONFIG_RT_USING_UART3 is not set
CONFIG_BSP_USING_SPI=y
# CONFIG_RT_USING_SPIM0 is not set
CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
CONFIG_RT_USING_SPIM2=y
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
CONFIG_BSP_USING_CAN=y
CONFIG_RT_USING_CANFD=y
CONFIG_RT_USING_FILTER=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
CONFIG_RT_USING_CAN0=y
CONFIG_RT_USING_CAN1=y
CONFIG_BSP_USING_GPIO=y
@ -1265,16 +1264,16 @@ CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
# CONFIG_RT_USING_PWM0 is not set
# CONFIG_RT_USING_PWM1 is not set
# CONFIG_RT_USING_PWM2 is not set
CONFIG_RT_USING_PWM2=y
# CONFIG_RT_USING_PWM3 is not set
# CONFIG_RT_USING_PWM4 is not set
# CONFIG_RT_USING_PWM5 is not set
CONFIG_RT_USING_PWM6=y
# CONFIG_RT_USING_PWM6 is not set
# CONFIG_RT_USING_PWM7 is not set
CONFIG_BSP_USING_I2C=y
CONFIG_I2C_USE_MIO=y
# CONFIG_RT_USING_MIO0 is not set
# CONFIG_RT_USING_MIO1 is not set
CONFIG_RT_USING_MIO0=y
CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO2 is not set
# CONFIG_RT_USING_MIO3 is not set
# CONFIG_RT_USING_MIO4 is not set
@ -1288,21 +1287,19 @@ CONFIG_I2C_USE_MIO=y
# CONFIG_RT_USING_MIO12 is not set
# CONFIG_RT_USING_MIO13 is not set
# CONFIG_RT_USING_MIO14 is not set
CONFIG_RT_USING_MIO15=y
CONFIG_I2C_USE_CONTROLLER=y
CONFIG_RT_USING_I2C0=y
# CONFIG_RT_USING_I2C1 is not set
# CONFIG_RT_USING_I2C2 is not set
# CONFIG_RT_USING_I2C3 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_BSP_USING_SDCARD_PARTITION="sd0"
# CONFIG_USING_SDIF0 is not set
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
# CONFIG_USING_EMMC is not set
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1326,6 +1323,7 @@ CONFIG_TARGET_E2000D=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="d"
CONFIG_SOC_CORE_NUM=2
@ -1334,7 +1332,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@ -1358,6 +1355,7 @@ CONFIG_BOARD_NAME="demo"
# CONFIG_USE_TACHO_IOPAD is not set
# CONFIG_USE_UART_IOPAD is not set
# CONFIG_USE_THIRD_PARTY_IOPAD is not set
# CONFIG_FIREFLY_DEMO_BOARD is not set
# CONFIG_CUS_DEMO_BOARD is not set
#

View File

@ -53,6 +53,7 @@
#define RT_USING_HEAP
#define RT_USING_DEVICE
#define RT_USING_DEVICE_OPS
#define RT_USING_THREADSAFE_PRINTF
#define RT_USING_SCHED_THREAD_CTX
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 256
@ -114,6 +115,7 @@
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_DFS_MQUEUE
#define RT_USING_PAGECACHE
@ -137,9 +139,7 @@
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 1024
#define RT_USING_TTY
#define RT_USING_CAN
#define RT_CAN_USING_HDR
#define RT_CAN_USING_CANFD
#define RT_USING_I2C
#define RT_USING_I2C_BITOPS
@ -282,6 +282,8 @@
#define LWP_ENABLE_ASID
#define RT_LWP_SHM_MAX_NR 64
#define RT_USING_LDSO
#define LWP_USING_TERMINAL
#define LWP_PTY_MAX_PARIS_LIMIT 64
/* Memory management */
@ -421,10 +423,8 @@
#define RT_USING_UART0
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM2
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define RT_USING_CANFD
#define RT_USING_FILTER
#define RT_USING_CAN0
#define RT_USING_CAN1
#define BSP_USING_GPIO
@ -434,18 +434,19 @@
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
#define RT_USING_PWM6
#define RT_USING_PWM2
#define BSP_USING_I2C
#define I2C_USE_MIO
#define RT_USING_MIO15
#define I2C_USE_CONTROLLER
#define RT_USING_I2C0
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define BSP_USING_SDCARD_PARTITION "sd0"
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL1
#define RT_USING_DC_CHANNEL0
/* Board extended module Drivers */

View File

@ -186,7 +186,7 @@ CONFIG_RT_USING_SERIAL_V1=y
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=1024
CONFIG_RT_USING_CAN=y
CONFIG_RT_CAN_USING_HDR=y
# CONFIG_RT_CAN_USING_HDR is not set
CONFIG_RT_CAN_USING_CANFD=y
# CONFIG_RT_USING_CPUTIME is not set
CONFIG_RT_USING_I2C=y
@ -1215,15 +1215,15 @@ CONFIG_RT_USING_UART1=y
# CONFIG_RT_USING_UART2 is not set
# CONFIG_RT_USING_UART3 is not set
CONFIG_BSP_USING_SPI=y
# CONFIG_RT_USING_SPIM0 is not set
CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
CONFIG_RT_USING_SPIM2=y
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
CONFIG_BSP_USING_CAN=y
CONFIG_RT_USING_CANFD=y
CONFIG_RT_USING_FILTER=y
CONFIG_RT_USING_CAN0=y
CONFIG_RT_USING_CAN1=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
# CONFIG_RT_USING_CAN0 is not set
# CONFIG_RT_USING_CAN1 is not set
CONFIG_BSP_USING_GPIO=y
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
@ -1234,16 +1234,16 @@ CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
# CONFIG_RT_USING_PWM0 is not set
# CONFIG_RT_USING_PWM1 is not set
# CONFIG_RT_USING_PWM2 is not set
CONFIG_RT_USING_PWM2=y
# CONFIG_RT_USING_PWM3 is not set
# CONFIG_RT_USING_PWM4 is not set
# CONFIG_RT_USING_PWM5 is not set
CONFIG_RT_USING_PWM6=y
# CONFIG_RT_USING_PWM6 is not set
# CONFIG_RT_USING_PWM7 is not set
CONFIG_BSP_USING_I2C=y
CONFIG_I2C_USE_MIO=y
# CONFIG_RT_USING_MIO0 is not set
# CONFIG_RT_USING_MIO1 is not set
CONFIG_RT_USING_MIO0=y
CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO2 is not set
# CONFIG_RT_USING_MIO3 is not set
# CONFIG_RT_USING_MIO4 is not set
@ -1257,20 +1257,18 @@ CONFIG_I2C_USE_MIO=y
# CONFIG_RT_USING_MIO12 is not set
# CONFIG_RT_USING_MIO13 is not set
# CONFIG_RT_USING_MIO14 is not set
CONFIG_RT_USING_MIO15=y
CONFIG_I2C_USE_CONTROLLER=y
CONFIG_RT_USING_I2C0=y
# CONFIG_RT_USING_I2C1 is not set
# CONFIG_RT_USING_I2C2 is not set
# CONFIG_RT_USING_I2C3 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_BSP_USING_SDCARD_PARTITION="sd0"
# CONFIG_USING_SDIF0 is not set
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
# CONFIG_USING_EMMC is not set
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
CONFIG_RT_USING_DC_CHANNEL0=y
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1295,6 +1293,7 @@ CONFIG_TARGET_E2000D=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="d"
CONFIG_SOC_CORE_NUM=2
@ -1303,7 +1302,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@ -1327,6 +1325,7 @@ CONFIG_BOARD_NAME="demo"
# CONFIG_USE_TACHO_IOPAD is not set
# CONFIG_USE_UART_IOPAD is not set
# CONFIG_USE_THIRD_PARTY_IOPAD is not set
# CONFIG_E2000Q_DEMO_BOARD is not set
# CONFIG_CUS_DEMO_BOARD is not set
#

View File

@ -127,7 +127,6 @@
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 1024
#define RT_USING_CAN
#define RT_CAN_USING_HDR
#define RT_CAN_USING_CANFD
#define RT_USING_I2C
#define RT_USING_I2C_BITOPS
@ -394,12 +393,8 @@
#define RT_USING_UART0
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM2
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define RT_USING_CANFD
#define RT_USING_FILTER
#define RT_USING_CAN0
#define RT_USING_CAN1
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
@ -407,17 +402,19 @@
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
#define RT_USING_PWM6
#define RT_USING_PWM2
#define BSP_USING_I2C
#define I2C_USE_MIO
#define RT_USING_MIO15
#define I2C_USE_CONTROLLER
#define RT_USING_I2C0
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define BSP_USING_SDCARD_PARTITION "sd0"
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -162,6 +162,7 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_DFS_ELM_USE_EXFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
CONFIG_RT_USING_DFS_PTYFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
CONFIG_RT_USING_DFS_MQUEUE=y
@ -192,8 +193,6 @@ CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=1024
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
CONFIG_RT_USING_CAN=y
# CONFIG_RT_CAN_USING_HDR is not set
CONFIG_RT_CAN_USING_CANFD=y
@ -420,10 +419,11 @@ CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_LWP_ENABLE_ASID=y
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set
CONFIG_RT_USING_LDSO=y
# CONFIG_ELF_DEBUG_ENABLE is not set
# CONFIG_ELF_LOAD_RANDOMIZE is not set
CONFIG_LWP_USING_TERMINAL=y
CONFIG_LWP_PTY_MAX_PARIS_LIMIT=64
#
# Memory management
@ -1249,9 +1249,16 @@ CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
# CONFIG_BSP_USING_CAN is not set
CONFIG_BSP_USING_CAN=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
CONFIG_RT_USING_CAN0=y
CONFIG_RT_USING_CAN1=y
CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_QSPI is not set
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
CONFIG_USING_QSPI_CHANNEL0=y
# CONFIG_USING_QSPI_CHANNEL1 is not set
CONFIG_BSP_USING_ETH=y
CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
@ -1282,7 +1289,14 @@ CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
@ -1309,6 +1323,7 @@ CONFIG_TARGET_E2000Q=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="q"
CONFIG_SOC_CORE_NUM=4
@ -1317,7 +1332,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@ -1340,7 +1354,6 @@ CONFIG_E2000Q_DEMO_BOARD=y
#
# IO mux configuration when board start up
#
# CONFIG_FIREFLY_DEMO_BOARD is not set
# CONFIG_CUS_DEMO_BOARD is not set
#

View File

@ -115,6 +115,7 @@
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_DFS_MQUEUE
#define RT_USING_PAGECACHE
@ -138,7 +139,6 @@
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 1024
#define RT_USING_TTY
#define RT_USING_CAN
#define RT_CAN_USING_CANFD
#define RT_USING_I2C
@ -282,6 +282,8 @@
#define LWP_ENABLE_ASID
#define RT_LWP_SHM_MAX_NR 64
#define RT_USING_LDSO
#define LWP_USING_TERMINAL
#define LWP_PTY_MAX_PARIS_LIMIT 64
/* Memory management */
@ -422,7 +424,13 @@
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define RT_USING_CAN0
#define RT_USING_CAN1
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
#define USING_QSPI_CHANNEL0
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
@ -431,6 +439,12 @@
#define I2C_USE_MIO
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0

View File

@ -1219,9 +1219,16 @@ CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
# CONFIG_BSP_USING_CAN is not set
CONFIG_BSP_USING_CAN=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
# CONFIG_RT_USING_CAN0 is not set
# CONFIG_RT_USING_CAN1 is not set
CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_QSPI is not set
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
CONFIG_USING_QSPI_CHANNEL0=y
# CONFIG_USING_QSPI_CHANNEL1 is not set
CONFIG_BSP_USING_ETH=y
CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
@ -1252,10 +1259,17 @@ CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1279,6 +1293,7 @@ CONFIG_TARGET_E2000Q=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="q"
CONFIG_SOC_CORE_NUM=4
@ -1287,7 +1302,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@ -1310,7 +1324,6 @@ CONFIG_E2000Q_DEMO_BOARD=y
#
# IO mux configuration when board start up
#
# CONFIG_FIREFLY_DEMO_BOARD is not set
# CONFIG_CUS_DEMO_BOARD is not set
#

View File

@ -394,7 +394,11 @@
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
#define USING_QSPI_CHANNEL0
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
@ -403,8 +407,15 @@
#define I2C_USE_MIO
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -162,6 +162,7 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_DFS_ELM_USE_EXFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
CONFIG_RT_USING_DFS_PTYFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
CONFIG_RT_USING_DFS_MQUEUE=y
@ -192,8 +193,6 @@ CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=1024
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
CONFIG_RT_USING_CAN=y
# CONFIG_RT_CAN_USING_HDR is not set
CONFIG_RT_CAN_USING_CANFD=y
@ -420,10 +419,11 @@ CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_LWP_ENABLE_ASID=y
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set
CONFIG_RT_USING_LDSO=y
# CONFIG_ELF_DEBUG_ENABLE is not set
# CONFIG_ELF_LOAD_RANDOMIZE is not set
CONFIG_LWP_USING_TERMINAL=y
CONFIG_LWP_PTY_MAX_PARIS_LIMIT=64
#
# Memory management
@ -1249,9 +1249,16 @@ CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
# CONFIG_BSP_USING_CAN is not set
CONFIG_BSP_USING_CAN=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
CONFIG_RT_USING_CAN0=y
CONFIG_RT_USING_CAN1=y
CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_QSPI is not set
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
CONFIG_USING_QSPI_CHANNEL0=y
# CONFIG_USING_QSPI_CHANNEL1 is not set
CONFIG_BSP_USING_ETH=y
CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
@ -1282,7 +1289,14 @@ CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
# CONFIG_USING_SDIF0 is not set
# CONFIG_USE_SDIF0_TF is not set
# CONFIG_USE_SDIF0_EMMC is not set
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
@ -1309,6 +1323,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
@ -1316,7 +1331,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -115,6 +115,7 @@
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_DFS_MQUEUE
#define RT_USING_PAGECACHE
@ -138,7 +139,6 @@
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 1024
#define RT_USING_TTY
#define RT_USING_CAN
#define RT_CAN_USING_CANFD
#define RT_USING_I2C
@ -282,6 +282,8 @@
#define LWP_ENABLE_ASID
#define RT_LWP_SHM_MAX_NR 64
#define RT_USING_LDSO
#define LWP_USING_TERMINAL
#define LWP_PTY_MAX_PARIS_LIMIT 64
/* Memory management */
@ -422,7 +424,13 @@
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define RT_USING_CAN0
#define RT_USING_CAN1
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
#define USING_QSPI_CHANNEL0
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
@ -431,6 +439,10 @@
#define I2C_USE_MIO
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0

View File

@ -1219,9 +1219,16 @@ CONFIG_RT_USING_SPIM0=y
# CONFIG_RT_USING_SPIM1 is not set
# CONFIG_RT_USING_SPIM2 is not set
# CONFIG_RT_USING_SPIM3 is not set
# CONFIG_BSP_USING_CAN is not set
CONFIG_BSP_USING_CAN=y
# CONFIG_RT_USING_CANFD is not set
# CONFIG_RT_USING_FILTER is not set
# CONFIG_RT_USING_CAN0 is not set
# CONFIG_RT_USING_CAN1 is not set
CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_QSPI is not set
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
CONFIG_USING_QSPI_CHANNEL0=y
# CONFIG_USING_QSPI_CHANNEL1 is not set
CONFIG_BSP_USING_ETH=y
CONFIG_RT_LWIP_PBUF_POOL_BUFSIZE=1700
CONFIG_BSP_USING_PWM=y
@ -1252,10 +1259,17 @@ CONFIG_RT_USING_MIO1=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
# CONFIG_USING_SDIF0 is not set
# CONFIG_USE_SDIF0_TF is not set
# CONFIG_USE_SDIF0_EMMC is not set
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1279,6 +1293,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
@ -1286,7 +1301,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set
@ -1294,6 +1308,7 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
#
# Board Configuration
#
# CONFIG_E2000D_DEMO_BOARD is not set
CONFIG_BOARD_NAME="firefly"
# CONFIG_USE_SPI_IOPAD is not set
# CONFIG_USE_GPIO_IOPAD is not set

View File

@ -394,7 +394,11 @@
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
#define USING_QSPI_CHANNEL0
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
@ -403,8 +407,13 @@
#define I2C_USE_MIO
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -394,7 +394,11 @@
#define RT_USING_UART1
#define BSP_USING_SPI
#define RT_USING_SPIM0
#define BSP_USING_CAN
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
#define USING_QSPI_CHANNEL0
#define BSP_USING_ETH
#define RT_LWIP_PBUF_POOL_BUFSIZE 1700
#define BSP_USING_PWM
@ -403,8 +407,13 @@
#define I2C_USE_MIO
#define RT_USING_MIO0
#define RT_USING_MIO1
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -1279,7 +1279,12 @@ CONFIG_RT_USING_MIO10=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
# CONFIG_USING_SDIF0 is not set
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
# CONFIG_RT_USING_DC_CHANNEL1 is not set
@ -1308,6 +1313,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
@ -1315,7 +1321,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -1,142 +0,0 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Email: opensource_embedded@phytium.com.cn
*
* Change Logs:
* Date Author Notes
* 2023-04-27 huanghe first version
* 2023-07-14 liqiaozhong add SD file sys mount func
*
*/
#include <rtthread.h>
#if defined(RT_USING_DFS)
#include <rtdbg.h>
#include <dfs_fs.h>
#include <dfs_file.h>
static int ram_disk_mount(const char *mount_point)
{
#ifdef RT_USING_DFS_RAMFS
extern struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size);
rt_uint8_t *pool = RT_NULL;
rt_size_t size = 8 * 1024 * 1024;
rt_err_t err = RT_EOK;
pool = rt_malloc(size);
if (pool == RT_NULL)
{
LOG_E("Malloc fail!");
}
err = dfs_mount(RT_NULL, mount_point, "ram", 0, (const void *)dfs_ramfs_create(pool, size));
if (err == RT_EOK)
{
LOG_I("RAM file system initializated!");
}
else
{
LOG_E("RAM file system initializate failed!, err = %d", err);
}
#endif
return RT_EOK;
}
#ifdef BSP_USING_SDCARD_FATFS
extern void fsdif_change(void);
static int sd_disk_try_mount(char *device_name, char *mount_point, char *fs_type_name, int mkfs_count)
{
struct statfs fs_stat;
int rc = 0;
LOG_I("mount(\"%s\",\"%s\",\"%s\");", device_name, mount_point, fs_type_name);
if (rt_device_find(device_name) == NULL)
{
LOG_I("%s not find!!!", device_name);
return -RT_EIO;
}
mkdir(mount_point, 0);
_remount:
rc = dfs_mount(device_name, mount_point, fs_type_name, 0, 0);
if (rc == 0)
{
LOG_I("mounted %s on %s", device_name, mount_point);
if (dfs_statfs(mount_point, &fs_stat) >= 0)
{
LOG_I("%s size:%d, total: %d, free: %d", mount_point,
fs_stat.f_bsize, fs_stat.f_blocks, fs_stat.f_bfree);
}
}
else
{
if (mkfs_count > 0)
{
/* LOG_I("[%s]try mkfs -t %s %s ", mkfs_count, fs_type_name, device_name);
dfs_mkfs(fs_type_name, device_name); */
mkfs_count--;
LOG_E("%s is not in %s, please format first !!!", device_name, fs_type_name);
goto _remount;
}
LOG_I("mount failed :%d ", rc);
return -RT_EIO;
}
return RT_EOK;
}
static void sd_filesytem_task_entry(void *parameter)
{
int result;
LOG_D("sdio host change: %d", change);
mmcsd_wait_cd_changed(0); /* clear */
fsdif_change(); /* send cd change to host */
/* block until plug/unplug event happens */
result = mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
if (result == MMCSD_HOST_PLUGED)
{
rt_kprintf("mmcsd change pluged \n");
/* mount sdcard partition as / */
if (RT_EOK == sd_disk_try_mount(BSP_USING_SDCARD_PARTITION, "/", "elm", 0))
{
ram_disk_mount("/ram"); /* mount ramdisk if configured */
}
}
}
int filesystem_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_filesytem", sd_filesytem_task_entry,
RT_NULL,
4096,
RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
LOG_E("create sd mount task error!");
}
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);
#else
static int filesystem_mount(void)
{
return ram_disk_mount("/"); /* mount ramdisk as / */
}
INIT_ENV_EXPORT(filesystem_mount);
#endif // #ifdef BSP_USING_SDCARD_FATFS
#endif // #if defined(RT_USING_DFS)

View File

@ -165,6 +165,7 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_DFS_ELM_USE_EXFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
CONFIG_RT_USING_DFS_PTYFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
# CONFIG_RT_USING_DFS_MQUEUE is not set
@ -195,8 +196,6 @@ CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=64
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
CONFIG_RT_USING_CAN=y
CONFIG_RT_CAN_USING_HDR=y
CONFIG_RT_CAN_USING_CANFD=y
@ -385,7 +384,35 @@ CONFIG_LWIP_NETIF_LOOPBACK=0
# CONFIG_RT_LWIP_USING_HW_CHECKSUM is not set
CONFIG_RT_LWIP_USING_PING=y
# CONFIG_LWIP_USING_DHCPD is not set
# CONFIG_RT_LWIP_DEBUG is not set
CONFIG_RT_LWIP_DEBUG=y
# CONFIG_RT_LWIP_SYS_DEBUG is not set
# CONFIG_RT_LWIP_ETHARP_DEBUG is not set
# CONFIG_RT_LWIP_PPP_DEBUG is not set
# CONFIG_RT_LWIP_MEM_DEBUG is not set
# CONFIG_RT_LWIP_MEMP_DEBUG is not set
# CONFIG_RT_LWIP_PBUF_DEBUG is not set
# CONFIG_RT_LWIP_API_LIB_DEBUG is not set
# CONFIG_RT_LWIP_API_MSG_DEBUG is not set
# CONFIG_RT_LWIP_TCPIP_DEBUG is not set
CONFIG_RT_LWIP_NETIF_DEBUG=y
# CONFIG_RT_LWIP_SOCKETS_DEBUG is not set
# CONFIG_RT_LWIP_DNS_DEBUG is not set
# CONFIG_RT_LWIP_AUTOIP_DEBUG is not set
# CONFIG_RT_LWIP_DHCP_DEBUG is not set
# CONFIG_RT_LWIP_IP_DEBUG is not set
# CONFIG_RT_LWIP_IP_REASS_DEBUG is not set
# CONFIG_RT_LWIP_ICMP_DEBUG is not set
# CONFIG_RT_LWIP_IGMP_DEBUG is not set
# CONFIG_RT_LWIP_UDP_DEBUG is not set
# CONFIG_RT_LWIP_TCP_DEBUG is not set
# CONFIG_RT_LWIP_TCP_INPUT_DEBUG is not set
# CONFIG_RT_LWIP_TCP_OUTPUT_DEBUG is not set
# CONFIG_RT_LWIP_TCP_RTO_DEBUG is not set
# CONFIG_RT_LWIP_TCP_CWND_DEBUG is not set
# CONFIG_RT_LWIP_TCP_WND_DEBUG is not set
# CONFIG_RT_LWIP_TCP_FR_DEBUG is not set
# CONFIG_RT_LWIP_TCP_QLEN_DEBUG is not set
# CONFIG_RT_LWIP_TCP_RST_DEBUG is not set
# CONFIG_RT_USING_AT is not set
#
@ -419,10 +446,11 @@ CONFIG_RT_CH_MSG_MAX_NR=1024
CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set
CONFIG_RT_USING_LDSO=y
# CONFIG_ELF_DEBUG_ENABLE is not set
# CONFIG_ELF_LOAD_RANDOMIZE is not set
CONFIG_LWP_USING_TERMINAL=y
CONFIG_LWP_PTY_MAX_PARIS_LIMIT=64
#
# Memory management
@ -1273,9 +1301,9 @@ CONFIG_RT_USING_SPIM2=y
CONFIG_RT_USING_SPIM3=y
CONFIG_BSP_USING_CAN=y
CONFIG_RT_USING_CANFD=y
# CONFIG_RT_USING_FILTER is not set
CONFIG_RT_USING_FILTER=y
CONFIG_RT_USING_CAN0=y
# CONFIG_RT_USING_CAN1 is not set
CONFIG_RT_USING_CAN1=y
CONFIG_BSP_USING_GPIO=y
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
@ -1311,8 +1339,17 @@ CONFIG_I2C_USE_MIO=y
# CONFIG_RT_USING_MIO14 is not set
CONFIG_RT_USING_MIO15=y
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
# CONFIG_BSP_USING_DC is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1338,6 +1375,7 @@ CONFIG_TARGET_E2000D=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="d"
CONFIG_SOC_CORE_NUM=2
@ -1346,7 +1384,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -122,6 +122,7 @@
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_PAGECACHE
/* page cache config */
@ -144,7 +145,6 @@
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_TTY
#define RT_USING_CAN
#define RT_CAN_USING_HDR
#define RT_CAN_USING_CANFD
@ -257,6 +257,8 @@
#define LWIP_SO_LINGER 0
#define LWIP_NETIF_LOOPBACK 0
#define RT_LWIP_USING_PING
#define RT_LWIP_DEBUG
#define RT_LWIP_NETIF_DEBUG
/* Memory protection */
@ -279,6 +281,8 @@
#define LWP_TID_MAX_NR 64
#define RT_LWP_SHM_MAX_NR 64
#define RT_USING_LDSO
#define LWP_USING_TERMINAL
#define LWP_PTY_MAX_PARIS_LIMIT 64
/* Memory management */
@ -427,7 +431,9 @@
#define RT_USING_SPIM3
#define BSP_USING_CAN
#define RT_USING_CANFD
#define RT_USING_FILTER
#define RT_USING_CAN0
#define RT_USING_CAN1
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
@ -439,6 +445,14 @@
#define BSP_USING_I2C
#define I2C_USE_MIO
#define RT_USING_MIO15
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -41,7 +41,7 @@ CONFIG_RT_KSERVICE_USING_STDLIB=y
CONFIG_RT_KPRINTF_USING_LONGLONG=y
CONFIG_RT_USING_DEBUG=y
CONFIG_RT_DEBUGING_COLOR=y
CONFIG_RT_DEBUGING_CONTEXT=y
# CONFIG_RT_DEBUGING_CONTEXT is not set
# CONFIG_RT_DEBUGING_AUTO_INIT is not set
# CONFIG_RT_DEBUGING_PAGE_LEAK is not set
# CONFIG_RT_DEBUGING_SPINLOCK is not set
@ -1283,7 +1283,14 @@ CONFIG_I2C_USE_MIO=y
# CONFIG_RT_USING_MIO14 is not set
CONFIG_RT_USING_MIO15=y
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
@ -1312,6 +1319,7 @@ CONFIG_TARGET_E2000D=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="d"
CONFIG_SOC_CORE_NUM=2
@ -1320,7 +1328,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -30,7 +30,6 @@
#define RT_KPRINTF_USING_LONGLONG
#define RT_USING_DEBUG
#define RT_DEBUGING_COLOR
#define RT_DEBUGING_CONTEXT
/* Inter-Thread communication */
@ -411,6 +410,12 @@
#define BSP_USING_I2C
#define I2C_USE_MIO
#define RT_USING_MIO15
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL1

View File

@ -165,6 +165,7 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_DFS_ELM_USE_EXFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
CONFIG_RT_USING_DFS_PTYFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
# CONFIG_RT_USING_DFS_MQUEUE is not set
@ -195,8 +196,6 @@ CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=64
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
CONFIG_RT_USING_CAN=y
CONFIG_RT_CAN_USING_HDR=y
CONFIG_RT_CAN_USING_CANFD=y
@ -447,10 +446,11 @@ CONFIG_RT_CH_MSG_MAX_NR=1024
CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set
CONFIG_RT_USING_LDSO=y
# CONFIG_ELF_DEBUG_ENABLE is not set
# CONFIG_ELF_LOAD_RANDOMIZE is not set
CONFIG_LWP_USING_TERMINAL=y
CONFIG_LWP_PTY_MAX_PARIS_LIMIT=64
#
# Memory management
@ -1341,11 +1341,15 @@ CONFIG_RT_USING_MIO15=y
# CONFIG_I2C_USE_CONTROLLER is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_BSP_USING_SDCARD_PARTITION="sd0"
# CONFIG_USING_SDIF0 is not set
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
# CONFIG_USING_EMMC is not set
# CONFIG_BSP_USING_DC is not set
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1371,6 +1375,7 @@ CONFIG_TARGET_E2000Q=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="q"
CONFIG_SOC_CORE_NUM=4
@ -1379,7 +1384,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -122,6 +122,7 @@
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_PAGECACHE
/* page cache config */
@ -144,7 +145,6 @@
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_TTY
#define RT_USING_CAN
#define RT_CAN_USING_HDR
#define RT_CAN_USING_CANFD
@ -281,6 +281,8 @@
#define LWP_TID_MAX_NR 64
#define RT_LWP_SHM_MAX_NR 64
#define RT_USING_LDSO
#define LWP_USING_TERMINAL
#define LWP_PTY_MAX_PARIS_LIMIT 64
/* Memory management */
@ -445,8 +447,12 @@
#define RT_USING_MIO15
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define BSP_USING_SDCARD_PARTITION "sd0"
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -41,7 +41,7 @@ CONFIG_RT_KSERVICE_USING_STDLIB=y
CONFIG_RT_KPRINTF_USING_LONGLONG=y
CONFIG_RT_USING_DEBUG=y
CONFIG_RT_DEBUGING_COLOR=y
CONFIG_RT_DEBUGING_CONTEXT=y
# CONFIG_RT_DEBUGING_CONTEXT is not set
# CONFIG_RT_DEBUGING_AUTO_INIT is not set
# CONFIG_RT_DEBUGING_PAGE_LEAK is not set
# CONFIG_RT_DEBUGING_SPINLOCK is not set
@ -374,35 +374,7 @@ CONFIG_LWIP_NETIF_LOOPBACK=0
# CONFIG_RT_LWIP_USING_HW_CHECKSUM is not set
CONFIG_RT_LWIP_USING_PING=y
# CONFIG_LWIP_USING_DHCPD is not set
CONFIG_RT_LWIP_DEBUG=y
# CONFIG_RT_LWIP_SYS_DEBUG is not set
# CONFIG_RT_LWIP_ETHARP_DEBUG is not set
# CONFIG_RT_LWIP_PPP_DEBUG is not set
# CONFIG_RT_LWIP_MEM_DEBUG is not set
# CONFIG_RT_LWIP_MEMP_DEBUG is not set
# CONFIG_RT_LWIP_PBUF_DEBUG is not set
# CONFIG_RT_LWIP_API_LIB_DEBUG is not set
# CONFIG_RT_LWIP_API_MSG_DEBUG is not set
# CONFIG_RT_LWIP_TCPIP_DEBUG is not set
CONFIG_RT_LWIP_NETIF_DEBUG=y
# CONFIG_RT_LWIP_SOCKETS_DEBUG is not set
# CONFIG_RT_LWIP_DNS_DEBUG is not set
# CONFIG_RT_LWIP_AUTOIP_DEBUG is not set
# CONFIG_RT_LWIP_DHCP_DEBUG is not set
# CONFIG_RT_LWIP_IP_DEBUG is not set
# CONFIG_RT_LWIP_IP_REASS_DEBUG is not set
# CONFIG_RT_LWIP_ICMP_DEBUG is not set
# CONFIG_RT_LWIP_IGMP_DEBUG is not set
# CONFIG_RT_LWIP_UDP_DEBUG is not set
# CONFIG_RT_LWIP_TCP_DEBUG is not set
# CONFIG_RT_LWIP_TCP_INPUT_DEBUG is not set
# CONFIG_RT_LWIP_TCP_OUTPUT_DEBUG is not set
# CONFIG_RT_LWIP_TCP_RTO_DEBUG is not set
# CONFIG_RT_LWIP_TCP_CWND_DEBUG is not set
# CONFIG_RT_LWIP_TCP_WND_DEBUG is not set
# CONFIG_RT_LWIP_TCP_FR_DEBUG is not set
# CONFIG_RT_LWIP_TCP_QLEN_DEBUG is not set
# CONFIG_RT_LWIP_TCP_RST_DEBUG is not set
# CONFIG_RT_LWIP_DEBUG is not set
# CONFIG_RT_USING_AT is not set
#
@ -1273,9 +1245,9 @@ CONFIG_RT_USING_SPIM2=y
CONFIG_RT_USING_SPIM3=y
CONFIG_BSP_USING_CAN=y
CONFIG_RT_USING_CANFD=y
CONFIG_RT_USING_FILTER=y
# CONFIG_RT_USING_FILTER is not set
CONFIG_RT_USING_CAN0=y
CONFIG_RT_USING_CAN1=y
# CONFIG_RT_USING_CAN1 is not set
CONFIG_BSP_USING_GPIO=y
CONFIG_BSP_USING_QSPI=y
CONFIG_RT_USING_QSPI0=y
@ -1313,13 +1285,15 @@ CONFIG_RT_USING_MIO15=y
# CONFIG_I2C_USE_CONTROLLER is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
CONFIG_BSP_USING_SDCARD_PARTITION="sd0"
# CONFIG_USING_SDIF0 is not set
CONFIG_USING_SDIF0=y
# CONFIG_USE_SDIF0_TF is not set
CONFIG_USE_SDIF0_EMMC=y
CONFIG_USING_SDIF1=y
# CONFIG_USING_EMMC is not set
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
# CONFIG_RT_USING_DC_CHANNEL1 is not set
# CONFIG_RT_USING_DC_CHANNEL0 is not set
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1345,6 +1319,7 @@ CONFIG_TARGET_E2000Q=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="e2000"
CONFIG_TARGET_TYPE_NAME="q"
CONFIG_SOC_CORE_NUM=4
@ -1353,7 +1328,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -30,7 +30,6 @@
#define RT_KPRINTF_USING_LONGLONG
#define RT_USING_DEBUG
#define RT_DEBUGING_COLOR
#define RT_DEBUGING_CONTEXT
/* Inter-Thread communication */
@ -240,8 +239,6 @@
#define LWIP_SO_LINGER 0
#define LWIP_NETIF_LOOPBACK 0
#define RT_LWIP_USING_PING
#define RT_LWIP_DEBUG
#define RT_LWIP_NETIF_DEBUG
/* Memory protection */
@ -401,9 +398,7 @@
#define RT_USING_SPIM3
#define BSP_USING_CAN
#define RT_USING_CANFD
#define RT_USING_FILTER
#define RT_USING_CAN0
#define RT_USING_CAN1
#define BSP_USING_GPIO
#define BSP_USING_QSPI
#define RT_USING_QSPI0
@ -417,10 +412,12 @@
#define RT_USING_MIO15
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define BSP_USING_SDCARD_PARTITION "sd0"
#define USING_SDIF0
#define USE_SDIF0_EMMC
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -165,6 +165,7 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_DFS_ELM_USE_EXFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
CONFIG_RT_USING_DFS_PTYFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
# CONFIG_RT_USING_DFS_MQUEUE is not set
@ -195,8 +196,6 @@ CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=64
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
CONFIG_RT_USING_CAN=y
# CONFIG_RT_CAN_USING_HDR is not set
CONFIG_RT_CAN_USING_CANFD=y
@ -419,10 +418,11 @@ CONFIG_RT_CH_MSG_MAX_NR=1024
CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set
CONFIG_RT_USING_LDSO=y
# CONFIG_ELF_DEBUG_ENABLE is not set
# CONFIG_ELF_LOAD_RANDOMIZE is not set
CONFIG_LWP_USING_TERMINAL=y
CONFIG_LWP_PTY_MAX_PARIS_LIMIT=64
#
# Memory management
@ -1307,8 +1307,17 @@ CONFIG_RT_USING_MIO10=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
# CONFIG_BSP_USING_DC is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
# CONFIG_USING_SDIF0 is not set
# CONFIG_USE_SDIF0_TF is not set
# CONFIG_USE_SDIF0_EMMC is not set
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
CONFIG_RT_USING_DC_CHANNEL0=y
CONFIG_RT_USING_DC_CHANNEL1=y
# CONFIG_BSP_USING_XHCI is not set
# CONFIG_BSP_USING_PUSB2 is not set
@ -1334,6 +1343,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
@ -1341,7 +1351,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -122,6 +122,7 @@
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_PTYFS
#define RT_USING_PAGECACHE
/* page cache config */
@ -144,7 +145,6 @@
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_TTY
#define RT_USING_CAN
#define RT_CAN_USING_CANFD
#define RT_USING_I2C
@ -278,6 +278,8 @@
#define LWP_TID_MAX_NR 64
#define RT_LWP_SHM_MAX_NR 64
#define RT_USING_LDSO
#define LWP_USING_TERMINAL
#define LWP_PTY_MAX_PARIS_LIMIT 64
/* Memory management */
@ -438,6 +440,13 @@
#define RT_USING_MIO1
#define RT_USING_MIO2
#define RT_USING_MIO10
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
#define RT_USING_DC_CHANNEL0
#define RT_USING_DC_CHANNEL1
/* Board extended module Drivers */

View File

@ -1279,7 +1279,14 @@ CONFIG_RT_USING_MIO10=y
# CONFIG_RT_USING_MIO14 is not set
# CONFIG_RT_USING_MIO15 is not set
# CONFIG_I2C_USE_CONTROLLER is not set
# CONFIG_BSP_USING_SDIF is not set
CONFIG_BSP_USING_SDIF=y
CONFIG_BSP_USING_SDCARD_FATFS=y
# CONFIG_USING_SDIF0 is not set
# CONFIG_USE_SDIF0_TF is not set
# CONFIG_USE_SDIF0_EMMC is not set
CONFIG_USING_SDIF1=y
CONFIG_USE_SDIF1_TF=y
# CONFIG_USE_SDIF1_EMMC is not set
CONFIG_BSP_USING_DC=y
# CONFIG_RT_USING_DC_CHANNEL0 is not set
# CONFIG_RT_USING_DC_CHANNEL1 is not set
@ -1308,6 +1315,7 @@ CONFIG_TARGET_PHYTIUMPI=y
# CONFIG_TARGET_E2000S is not set
# CONFIG_TARGET_FT2004 is not set
# CONFIG_TARGET_D2000 is not set
# CONFIG_TARGET_PD2308 is not set
CONFIG_SOC_NAME="phytiumpi"
CONFIG_SOC_CORE_NUM=4
CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000
@ -1315,7 +1323,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000
CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000
CONFIG_F64BIT_MEMORY_LENGTH=0x800000000
CONFIG_TARGET_E2000=y
# CONFIG_USE_SPINLOCK is not set
CONFIG_DEFAULT_DEBUG_PRINT_UART1=y
# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set
# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set

View File

@ -410,6 +410,10 @@
#define RT_USING_MIO1
#define RT_USING_MIO2
#define RT_USING_MIO10
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
/* Board extended module Drivers */

View File

@ -410,6 +410,10 @@
#define RT_USING_MIO1
#define RT_USING_MIO2
#define RT_USING_MIO10
#define BSP_USING_SDIF
#define BSP_USING_SDCARD_FATFS
#define USING_SDIF1
#define USE_SDIF1_TF
#define BSP_USING_DC
/* Board extended module Drivers */

View File

@ -0,0 +1,59 @@
# 如何使用 RT-Thread 文件系统
- 文件系统是开发者最常用的操作系统功能之一RT-Thread 中很多功能也依赖文件系统完成,后面以 SD 卡作为文件系统介质,介绍一下 RT-Thread 中文件系统的制作和使用
- 飞腾派如果固件在 SD 卡中,不适用于本文档,可以参考[飞腾派SD文件系统](./use_phytium_pi_sd_image.md)
## 配置 SD 驱动
- 打开配置 BSP_USING_SDIF使能 SD 驱动
- 打开配置 BSP_USING_SDCARD_FATFS使能 SD 文件系统
- 根据板子的实际情况选择 SD 控制器SD0 打开 USING_SDIF0SD1 打开 USING_SDIF1
- 根据 SD 控制器连接的介质选择TF 卡或者 eMMC例如 USE_SDIF1_TF
- 在 mnt_sdcard.c 中指定根目录和 SD 设备
- 进行编译生成镜像
## 识别 SD 设备
- 启动镜像后,输入 list devices查看 SD 设备是否识别成功
```
msh />list device
device type ref count
---------------- -------------------- ----------
sd10 Block Device 0 --> SD1 的第一个分区
sd1 Block Device 1 --> SD1
sd0 Block Device 1
zero Miscellaneous Device 0
urandom Miscellaneous Device 0
random Miscellaneous Device 0
null Miscellaneous Device 0
e0 Network Interface 1
SPI3 SPI Bus 0
SPI2 SPI Bus 0
SPI1 SPI Bus 0
SPI0 SPI Bus 0
PWM6 PWM Device 0
MIO15 I2C Bus 0
DC1 Graphic Device 0
uart1 Character Device 2
uart0 Character Device 0
QSPI0 SPI Bus 0
CAN0 CAN Device 0
```
## 制作 SD 文件系统
- 如果之前 SD 卡里没有 FAT32 文件系统,自动挂载可能不会成功,需要启动 RT-Thread 后格式化一个 SD 设备,然后 mount
```
msh />mkfs sd1 / elm
msh />mount sd1 / elm
mount device sd1(elm) onto / ... succeed!
```
- 文件系统制作好后,下次启动会自动挂载成根目录
## 使用 SD 文件系统
- 参考[RT-Thread 的文件系统使用说明](https://www.rt-thread.org/document/api/group___d_f_s.html)

View File

@ -3,7 +3,6 @@
> 本文主要介绍如何在飞腾派中进行 RT-Thread 程序的开发和固化
- 飞腾派开发板是一款面向广大工程师和爱好者的开源硬件。主板处理器采用飞腾四核处理器,兼容 ARM v8 指令集,主频最高可达 1.8GHz
- 由于默认系统需要 16G 的空间,推荐使用 32G 的 SD 卡开发 RT-Thread 程序
## 开发和调试程序
@ -13,19 +12,19 @@
- 如果需要固化 RT-Thread 程序镜像在 SD 卡中并实现开机自启动可以使用下列的镜像镜像中包含飞腾派的启动固件、飞腾派OS和一个 RT-Thread 的启动分区
- [镜像下载链接](https://pan.baidu.com/s/1eL2ElKeVBU5GOyvzn2kl-A)提取码PIIM
- [镜像下载链接](https://pan.baidu.com/s/1asc3MdcIh71-fkjS6Rptvw)提取码PHYT
- 下载之后解压,使用 sdcard-rtthread.img
```
-----------------------------------------------------------------------------------
| | | |
| 64MB (系统镜像) | 16G (Phytium Pi OS 根文件系统) | 4G (RT-Thread文件系统) |
| (无格式) | ext4格式 | fat32格式 |
----------------------------------------------------------------------------------
------------------------------------------------------
| | |
| 64MB (系统镜像) | 2G (RT-Thread文件系统) |
| (无格式) | fat32格式 |
-----------------------------------------------------
```
- Windows 上使用 balenaEtcher 工具烧入一张 SD 卡>= 32G镜像的格式如下图所示由3个分区组成前 64MB 是二进制无格式的启动镜像,然后 16G 是 Phytium Pi OS 的根文件系统,格式为 ext4最后 4G 是 RT-Thread 文件系统,格式为 fat32
- Windows 上使用 balenaEtcher 工具烧入一张 SD 卡镜像的格式如下图所示由1个分区组成前 64MB 是二进制无格式的启动镜像,后面 2G 是 RT-Thread 文件系统,格式为 fat32
- 在 linux 系统上,可以使用 dd 命令将镜像写入 SD 卡 (/dev/sdd)
@ -36,6 +35,7 @@
- SD 卡烧入完成之后插入飞腾派 SD 卡槽,重启飞腾派就会自动进入 RT-Thread 系统,
```
PHYTIUM MCI: 0, PHYTIUM MCI: 1
Loading Environment from MMC... OK
In: uart@2800d000
Out: uart@2800d000
@ -44,95 +44,72 @@
scanning bus for devices...
SATA link 0 timeout.
AHCI 0001.0301 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
SATA link 0 timeout.
AHCI 0001.0301 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
Hit any key to stop autoboot: 0
739360 bytes read in 206 ms (3.4 MiB/s)
flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
Hit any key to stop autoboot: 0
2740352 bytes read in 578 ms (4.5 MiB/s)
## Starting application at 0x80080000 ...
\ | /
- RT - Thread Operating System
/ | \ 5.1.0 build Nov 9 2023 09:13:25
2006 - 2022 Copyright by RT-Thread team
do components initialization.
initialize rti_board_end:0 done
initialize dfs_init:0 done
initialize rt_work_sys_workqueue_init:0 done
initialize rt_mmcsd_core_init:0 done
/ | \ 5.1.0 build Apr 9 2024 09:17:05
2006 - 2024 Copyright by RT-Thread team
lwIP-2.1.2 initialized!
[I/I2C] I2C bus [MIO15] registered
FXMAC OS Init Success!
Xmac e0 Initiailized!
Set netif e0 ip addr!
[E/drv] Auto negotiation is error.
FXMAC OS Init Success!
Xmac e1 Initiailized!
Set Xmac e1 ip addr!
Start Xmac NUM0
Start Xmac NUM1
[I/sal.skt] Socket Abstraction Layer initialize success.
msh />rt_device_find 0
[I/SDIO] SD card capacity 31178752 KB.
found part[0], begin: 67108864, size: 2.0GB
[I/mnt.filesystem] sd00 mount to '/'
msh />ls /
Directory /:
System Volume Inform<DIR>
rtthread_a64.bin 2740352
msh />df
disk free: 1.9 GB [ 4180704 block, 512 bytes per block ]
msh />
```
## 更新飞腾派 RT-Thread 镜像
- 有两种方式可以更新 SD 卡第三个分区中的 RT-Thread 镜像
- 1. 将 SD 卡插入一台能识别第三个分区的电脑 (Ubuntu 系统能识别Windows 可能不能识别),直接将 RT-Thread 镜像复制入 SD 卡
- 2. 可以通过 u-boot 上传 RT-Thread 镜像,然后保存在 SD 卡第三个分区中,注意保存文件的大小 (0xc0000),要超过 tftpboot 加载的文件大小
```
Phytium-Pi#setenv ipaddr 192.168.4.20;setenv serverip 192.168.4.50;setenv gatewayip 192.168.4.1;
Phytium-Pi#tftpboot 0x90100000 rtthread_a64.bin
ethernet@3200c000: PHY present at 0
ethernet@3200c000: Starting autonegotiation...
ethernet@3200c000: Autonegotiation complete
ethernet@3200c000: link up, 1000Mbps full-duplex (lpa: 0x2800)
ft sgmii speed 1000M!
Using ethernet@3200c000 device
TFTP from server 192.168.4.50; our IP address is 192.168.4.20
Filename 'rtthread_a64.bin'.
Load address: 0x90100000
Loading: #################################################################
#################################################################
###############
133.8 KiB/s
done
Bytes transferred = 739840 (b4a00 hex)
Phytium-Pi#fatls mmc 0:2
rtthread-images/
.Trash-1000/
ram/
System Volume Information/
0 file(s), 4 dir(s)
Phytium-Pi#fatwrite mmc 0:2 0x90100000 rtthread-images/rtthread_a64.bin 0xc0000
786432 bytes written in 398 ms (1.9 MiB/s)
Phytium-Pi#fatls mmc 0:2 rtthread-images
./
../
786432 rtthread_a64.bin
944384 rtsmart_a64.bin
950828 rtsmart_a32.bin
722580 rtthread_a32.bin
4 file(s), 2 dir(s)
Phytium-Pi#
```
## 修改自启动的 RT-Thread 镜像
- 通过在 u-boot 控制台修改 bootcmd可以指定不同的 RT-Thread 镜像自启动,如下所示,指定启动 RT-Smart 镜像 `rtsmart_a64.bin`
- 通过在 u-boot 控制台修改 bootcmd可以指定不同的 RT-Thread 镜像自启动,如下所示,指定启动 RT-Smart 镜像 `rtthread_a64.bin`
```
Phytium-Pi#printenv bootcmd
bootcmd=mw 0x32b301a8 0x275;mmc dev 0;mmc read 0x90000000 0x2000 0x10000;bootm 0x90000000#phytium
Phytium-Pi#setenv bootcmd "fatload mmc 0:2 0x80080000 rtthread-images/rtthread_a64.bin;dcache flush;go 0x80080000;"
Phytium-Pi#saveenv
```
## 切换成 linux 开发模式
- 本文提供的 RT-Thread 开发镜像中,有一个 linux 系统,需要的时候可以修改 bootcmd切换成自启动 linux 系统
```
Phytium-Pi#setenv bootcmd "mw 0x32b301a8 0x275;mmc dev 0;mmc read 0x90000000 0x2000 0x10000;bootm 0x90000000#phytium"
Phytium-Pi#saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
```
```
Phytium-Pi#printenv bootcmd
bootcmd=mw 0x32b301a8 0x275;mmc dev 0;mmc read 0x90000000 0x2000 0x10000;bootm 0x90000000#phytium
Phytium-Pi#setenv bootcmd "fatload mmc 0:1 0x80080000 rtthread_a64.bin;dcache flush;go 0x80080000;"
Phytium-Pi#saveenv
```
## 在 RT-Thread 应用中访问 SD 卡分区
- 如前面介绍的RT-Thread 应用可以使用第二个分区,分区文件系统格式为 FAT32
- 打开配置 BSP_USING_SDCARD_FATFS 后, RT-Thread / RT-Smart 启动过程中会将 SD 卡挂载为根目录,将配置 BSP_USING_SDCARD_PARTITION 设置为 `sd1`,指定第二个分区为 RT-Thread 根目录,启动后创建的文件都会使用这个 SD 分区
- 如前面介绍的,参考 libraries/port/fboard_port/firefly/mnt_sdcard.c启动后会将 SD 卡的第一个分区2GB 大小)自动挂载到根目录下
```
[I/SDIO] SD card capacity 31178752 KB.
found part[0], begin: 67108864, size: 2.0GB
[I/mnt.filesystem] sd00 mount to '/'
msh />
msh />ls
Directory /:
rtthread_a64.bin 2740352
msh />df
disk free: 1.9 GB [ 4180704 block, 512 bytes per block ]
msh />
```
- 如果需要替换 SD 卡中的 RT-Thread 镜像,直接取下 SD 卡插入 Windows/Ubuntu PC 中进行替换即可

View File

@ -49,6 +49,28 @@ if GetDepend(['TARGET_D2000']):
src += Glob(cwd+'/port/soc_port/d2000/*.c')
path += [PHYTIUM_SDK_DIR + '/soc/d2000']
# board port
if GetDepend(['E2000D_DEMO_BOARD']):
path += cwd + '/fboard_port/e2000d_demo'
if GetDepend(['E2000D_DEMO_BOARD']):
path += cwd + '/fboard_port/e2000q_demo'
if GetDepend(['FIREFLY_DEMO_BOARD']):
path += cwd + '/fboard_port/firefly'
if GetDepend(['BSP_USING_SDCARD_FATFS']):
if GetDepend(['E2000D_DEMO_BOARD']):
src += Glob(cwd + '/port/fboard_port/e2000d_demo/mnt_sdcard.c')
if GetDepend(['E2000Q_DEMO_BOARD']):
src += Glob(cwd + '/port/fboard_port/e2000q_demo/mnt_sdcard.c')
if GetDepend(['FIREFLY_DEMO_BOARD']):
src += Glob(cwd + '/port/fboard_port/firefly/mnt_sdcard.c')
else:
src += Glob(cwd + '/port/fboard_port/mnt_ramdisk.c')
# driver
path += [PORT_DRV_DIR]
@ -148,7 +170,6 @@ src += Glob(cwd+'/port/fdriver_port/*.c')
path += [cwd + '/port/fdriver_port']
## fboard port
src += Glob(cwd+'/port/fboard_port/*.c')
path += [cwd + '/port/fboard_port']
## lwip port

View File

@ -228,25 +228,36 @@ menu "On-chip Peripheral Drivers"
select RT_USING_DFS_ELMFAT
default n
if BSP_USING_SDCARD_FATFS
config BSP_USING_SDCARD_PARTITION
string "Set SDCARD (FATFS) partition index"
default "sd0"
config USING_SDIF0
bool "Use SDIF0"
if USING_SDIF0
choice
prompt "Select SD0 Usage"
default USE_SDIF0_TF
config USE_SDIF0_TF
bool "SD0(TF)"
config USE_SDIF0_EMMC
bool "SD0(eMMC)"
endchoice
endif
choice
prompt "Choose a card to mount"
default USING_SDIF1
config USING_SDIF1
bool "Use SDIF1"
config USING_SDIF0
bool "Use SDIF0"
if USING_SDIF1
choice
prompt "Select SD1 Usage"
default USE_SDIF1_TF
config USE_SDIF1_TF
bool "SD1(TF)"
config USING_SDIF1
bool "Use SDIF1"
config USING_EMMC
bool "Use EMMC"
endchoice
config USE_SDIF1_EMMC
bool "SD1(eMMC)"
endchoice
endif
endif

View File

@ -328,7 +328,7 @@ static rt_err_t _can_control(struct rt_can_device *can, int cmd, void *arg)
return RT_EOK;
}
static int _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t box_num)
static rt_ssize_t _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t box_num)
{
RT_ASSERT(can);
RT_ASSERT(buf);
@ -365,7 +365,7 @@ static int _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t
return (FCanSend(&drv_can->can_handle, &can_frame) == RT_EOK) ? RT_EOK : -RT_ERROR;
}
static int _can_recvmsg(struct rt_can_device *can, void *buf, rt_uint32_t fifo)
static rt_ssize_t _can_recvmsg(struct rt_can_device *can, void *buf, rt_uint32_t fifo)
{
RT_ASSERT(can);
RT_ASSERT(buf);

View File

@ -223,19 +223,12 @@ rt_err_t drv_pin_attach_irq(struct rt_device *device, rt_base_t pin,
if (pin_config->en_irq)
{
FGpioSetInterruptMask(pin_instance, FALSE);
FGpioPinId pin_of_ctrl =
{
.ctrl = ctrl_id,
.port = FGPIO_PORT_A,
.pin = FGPIO_PIN_0
};
if (FGPIO_IRQ_BY_CONTROLLER == FGpioGetPinIrqSourceType(pin_of_ctrl)) /* setup for ctrl report interrupt */
if (FGPIO_IRQ_BY_CONTROLLER == FGpioGetPinIrqSourceType(*pin_instance)) /* setup for ctrl report interrupt */
{
FGpioOpsSetupCtrlIRQ(instance);
LOG_I("GPIO-%d report irq by controller", ctrl_id);
}
else if (FGPIO_IRQ_BY_PIN == FGpioGetPinIrqSourceType(pin_of_ctrl))
else if (FGPIO_IRQ_BY_PIN == FGpioGetPinIrqSourceType(*pin_instance))
{
FGpioOpsSetupPinIRQ(instance, pin_instance, pin_config);
LOG_I("GPIO-%d report irq by pin", ctrl_id);

View File

@ -169,11 +169,12 @@ static rt_ssize_t i2c_master_xfer(struct rt_i2c_bus_device *device, struct rt_i2
RT_ASSERT(device);
u32 ret;
struct rt_i2c_msg *pmsg;
rt_ssize_t i;
struct phytium_i2c_bus *i2c_bus;
i2c_bus = (struct phytium_i2c_bus *)(device);
u32 mem_addr;
for (int i = 0; i < num; i++)
for (i = 0; i < num; i++)
{
pmsg = &msgs[i];
for (u32 j = 0; j <FI2C_DEVICE_MEMADDR_LEN; j++)
@ -201,7 +202,7 @@ static rt_ssize_t i2c_master_xfer(struct rt_i2c_bus_device *device, struct rt_i2
}
}
return RT_EOK;
return i;
}
static const struct rt_i2c_bus_device_ops _i2c_ops =

View File

@ -20,7 +20,7 @@
#ifdef DRV_DEBUG
#define DBG_LVL DBG_LOG
#else
#define DBG_LVL DBG_INFO
#define DBG_LVL DBG_ERROR
#endif /* DRV_DEBUG */
#include <rtdbg.h>

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ static struct rt_event rx_done_event;
#define EVENT_RX_DONE (1 << 1)
/*******************************Api Functions*********************************/
static rt_err_t spim_configure(struct rt_spi_device *device, struct rt_spi_configuration *configuration);
static rt_uint32_t spim_xfer(struct rt_spi_device *device, struct rt_spi_message *message);
static rt_ssize_t spim_xfer(struct rt_spi_device *device, struct rt_spi_message *message);
static FError FSpimSetupInterrupt(FSpim *instance_p)
{
@ -147,12 +147,12 @@ static rt_err_t spim_configure(struct rt_spi_device *device,
return ret;
}
static rt_uint32_t spim_xfer(struct rt_spi_device *device, struct rt_spi_message *message)
static rt_ssize_t spim_xfer(struct rt_spi_device *device, struct rt_spi_message *message)
{
RT_ASSERT(device != RT_NULL);
RT_ASSERT(device->parent.user_data != RT_NULL);
RT_ASSERT(message != RT_NULL);
rt_size_t message_length;
rt_ssize_t message_length;
rt_uint8_t *recv_buf;
const rt_uint8_t *send_buf;

View File

@ -19,6 +19,6 @@ def clone_repository(branch, commit_hash):
if __name__ == "__main__":
branch_to_clone = "master"
commit_to_clone = "13657081faf9f2d504592f7110159c4e63dc6f29"
commit_to_clone = "cd15b23000d0c52968dc322b6d99025195bbf446"
clone_repository(branch_to_clone, commit_to_clone)

View File

@ -0,0 +1,133 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Email: opensource_embedded@phytium.com.cn
*
* Change Logs:
* Date Author Notes
* 2023-04-27 huanghe first version
* 2023-07-14 liqiaozhong add SD file sys mount func
* 2024-04-08 zhugengyu define mount table by board
*/
#include <rtthread.h>
#include <dfs_fs.h>
#define DBG_TAG "mnt.filesystem"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#define FS_SD_MOUNT_POINT "/"
#define FS_SD_DEVICE_NAME "sd1"
#define FS_SD_DEVICE_INDEX 1
#define FS_EMMC_MOUNT_POINT "/sd0"
#define FS_EMMC_DEVICE_NAME "sd0"
#define FS_EMMC_DEVICE_INDEX 0
extern void sdif_change(rt_uint32_t id);
extern rt_int32_t sdif_card_inserted(rt_uint32_t id);
static rt_int32_t card_inserted = 0;
static void _sdcard_mount(void)
{
rt_device_t device;
device = rt_device_find(FS_SD_DEVICE_NAME);
rt_kprintf("rt_device_find %x \r\n", device);
if (device == NULL)
{
mmcsd_wait_cd_changed(0);
sdif_change(FS_SD_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
device = rt_device_find(FS_SD_DEVICE_NAME);
}
if (device != RT_NULL)
{
if (dfs_mount(FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT, "elm", 0, 0) == RT_EOK)
{
LOG_I("%s mount to '%s'", FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT);
mkdir(FS_EMMC_MOUNT_POINT, 0);
if (dfs_mount(FS_EMMC_DEVICE_NAME, FS_EMMC_MOUNT_POINT, "elm", 0, 0) == RT_EOK)
{
LOG_I("%s mount to '%s'", FS_EMMC_DEVICE_NAME, FS_EMMC_MOUNT_POINT);
}
card_inserted = 1;
}
else
{
LOG_W("%s mount to '%s' failed!", FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT);
}
}
}
static void _sdcard_unmount(void)
{
rt_thread_mdelay(200);
dfs_unmount(FS_SD_MOUNT_POINT);
LOG_I("Unmount %s", FS_SD_MOUNT_POINT);
mmcsd_wait_cd_changed(0);
sdif_change(FS_SD_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
card_inserted = 0;
}
static void sd_auto_mount(void *parameter)
{
rt_thread_mdelay(20);
/* detect eMMC */
mmcsd_wait_cd_changed(0);
sdif_change(FS_EMMC_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
if ((card_inserted == 0) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 1))
{
_sdcard_mount();
}
while (RT_TRUE)
{
rt_thread_mdelay(200);
if ((card_inserted == 0) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 1))
{
_sdcard_mount();
}
if ((card_inserted == 1) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 0))
{
_sdcard_unmount();
}
}
}
static void sd_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_mount", sd_auto_mount, RT_NULL,
4096, RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
LOG_E("create sd_mount thread err!");
return;
}
}
int filesystem_mount(void)
{
sd_mount();
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);

View File

@ -0,0 +1,133 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Email: opensource_embedded@phytium.com.cn
*
* Change Logs:
* Date Author Notes
* 2023-04-27 huanghe first version
* 2023-07-14 liqiaozhong add SD file sys mount func
* 2024-04-08 zhugengyu define mount table by board
*/
#include <rtthread.h>
#include <dfs_fs.h>
#define DBG_TAG "mnt.filesystem"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#define FS_SD_MOUNT_POINT "/"
#define FS_SD_DEVICE_NAME "sd1"
#define FS_SD_DEVICE_INDEX 1
#define FS_EMMC_MOUNT_POINT "/sd0"
#define FS_EMMC_DEVICE_NAME "sd0"
#define FS_EMMC_DEVICE_INDEX 0
extern void sdif_change(rt_uint32_t id);
extern rt_int32_t sdif_card_inserted(rt_uint32_t id);
static rt_int32_t card_inserted = 0;
static void _sdcard_mount(void)
{
rt_device_t device;
device = rt_device_find(FS_SD_DEVICE_NAME);
rt_kprintf("rt_device_find %x \r\n", device);
if (device == NULL)
{
mmcsd_wait_cd_changed(0);
sdif_change(FS_SD_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
device = rt_device_find(FS_SD_DEVICE_NAME);
}
if (device != RT_NULL)
{
if (dfs_mount(FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT, "elm", 0, 0) == RT_EOK)
{
LOG_I("%s mount to '%s'", FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT);
mkdir(FS_EMMC_MOUNT_POINT, 0);
if (dfs_mount(FS_EMMC_DEVICE_NAME, FS_EMMC_MOUNT_POINT, "elm", 0, 0) == RT_EOK)
{
LOG_I("%s mount to '%s'", FS_EMMC_DEVICE_NAME, FS_EMMC_MOUNT_POINT);
}
card_inserted = 1;
}
else
{
LOG_W("%s mount to '%s' failed!", FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT);
}
}
}
static void _sdcard_unmount(void)
{
rt_thread_mdelay(200);
dfs_unmount(FS_SD_MOUNT_POINT);
LOG_I("Unmount %s", FS_SD_MOUNT_POINT);
mmcsd_wait_cd_changed(0);
sdif_change(FS_SD_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
card_inserted = 0;
}
static void sd_auto_mount(void *parameter)
{
rt_thread_mdelay(20);
/* detect eMMC */
mmcsd_wait_cd_changed(0);
sdif_change(FS_EMMC_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
if ((card_inserted == 0) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 1))
{
_sdcard_mount();
}
while (RT_TRUE)
{
rt_thread_mdelay(200);
if ((card_inserted == 0) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 1))
{
_sdcard_mount();
}
if ((card_inserted == 1) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 0))
{
_sdcard_unmount();
}
}
}
static void sd_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_mount", sd_auto_mount, RT_NULL,
4096, RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
LOG_E("create sd_mount thread err!");
return;
}
}
int filesystem_mount(void)
{
sd_mount();
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);

View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Email: opensource_embedded@phytium.com.cn
*
* Change Logs:
* Date Author Notes
* 2023-04-27 huanghe first version
* 2023-07-14 liqiaozhong add SD file sys mount func
* 2024-04-08 zhugengyu define mount table by board
*/
#include <rtthread.h>
#include <dfs_fs.h>
#define DBG_TAG "mnt.filesystem"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#define FS_SD_MOUNT_POINT "/"
#define FS_SD_DEVICE_NAME "sd00" /* first partition of SD0 */
#define FS_SD_DEVICE_INDEX 0
extern void sdif_change(rt_uint32_t id);
extern rt_int32_t sdif_card_inserted(rt_uint32_t id);
static rt_int32_t card_inserted = 0;
static void _sdcard_mount(void)
{
rt_device_t device;
device = rt_device_find(FS_SD_DEVICE_NAME);
rt_kprintf("rt_device_find %x \r\n", device);
if (device == NULL)
{
mmcsd_wait_cd_changed(0);
sdif_change(FS_SD_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
device = rt_device_find(FS_SD_DEVICE_NAME);
}
if (device != RT_NULL)
{
if (dfs_mount(FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT, "elm", 0, 0) == RT_EOK)
{
LOG_I("%s mount to '%s'", FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT);
card_inserted = 1;
}
else
{
LOG_W("%s mount to '%s' failed!", FS_SD_DEVICE_NAME, FS_SD_MOUNT_POINT);
}
}
}
static void _sdcard_unmount(void)
{
rt_thread_mdelay(200);
dfs_unmount(FS_SD_MOUNT_POINT);
LOG_I("Unmount %s", FS_SD_MOUNT_POINT);
mmcsd_wait_cd_changed(0);
sdif_change(FS_SD_DEVICE_INDEX);
mmcsd_wait_cd_changed(RT_WAITING_FOREVER);
card_inserted = 0;
}
static void sd_auto_mount(void *parameter)
{
rt_thread_mdelay(20);
if ((card_inserted == 0) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 1))
{
_sdcard_mount();
}
while (RT_TRUE)
{
rt_thread_mdelay(200);
if ((card_inserted == 0) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 1))
{
_sdcard_mount();
}
if ((card_inserted == 1) && (sdif_card_inserted(FS_SD_DEVICE_INDEX) == 0))
{
_sdcard_unmount();
}
}
}
static void sd_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_mount", sd_auto_mount, RT_NULL,
4096, RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
LOG_E("create sd_mount thread err!");
return;
}
}
int filesystem_mount(void)
{
sd_mount();
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Email: opensource_embedded@phytium.com.cn
*
* Change Logs:
* Date Author Notes
* 2023-04-27 huanghe first version
* 2023-07-14 liqiaozhong add SD file sys mount func
*
*/
#include <rtthread.h>
#include <rtdbg.h>
#ifndef RT_USING_SMART
#include <dfs_fs.h>
#include <dfs_file.h>
static int ram_disk_mount(const char *mount_point)
{
extern struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size);
rt_uint8_t *pool = RT_NULL;
rt_size_t size = 8 * 1024 * 1024;
pool = rt_malloc(size);
if (pool == RT_NULL)
{
LOG_E("Malloc fail!");
}
if (dfs_mount(RT_NULL, mount_point, "ram", 0, (const void *)dfs_ramfs_create(pool, size)) == 0)
{
LOG_I("RAM file system initializated!");
}
else
{
LOG_E("RAM file system initializate failed!");
}
return RT_EOK;
}
static int filesystem_mount(void)
{
return ram_disk_mount("/"); /* mount ramdisk as / */
}
INIT_APP_EXPORT(filesystem_mount);
#endif