405 rtt: 部分配置调整

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
2024-07-26 09:03:23 +08:00
parent ec86a22bb1
commit 49fcacf9cc
9 changed files with 75 additions and 106 deletions

View File

@@ -77,7 +77,7 @@ CONFIG_RT_USING_DEVICE=y
# CONFIG_RT_USING_INTERRUPT_INFO is not set # CONFIG_RT_USING_INTERRUPT_INFO is not set
CONFIG_RT_USING_CONSOLE=y CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=128 CONFIG_RT_CONSOLEBUF_SIZE=128
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1" CONFIG_RT_CONSOLE_DEVICE_NAME="block_r"
CONFIG_RT_VER_NUM=0x50000 CONFIG_RT_VER_NUM=0x50000
CONFIG_ARCH_ARM=y CONFIG_ARCH_ARM=y
CONFIG_RT_USING_CPU_FFS=y CONFIG_RT_USING_CPU_FFS=y
@@ -142,8 +142,8 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
# CONFIG_RT_USING_DFS_ROMFS is not set # CONFIG_RT_USING_DFS_ROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set # CONFIG_RT_USING_DFS_RAMFS is not set
CONFIG_RT_USING_FAL=y CONFIG_RT_USING_FAL=y
CONFIG_FAL_DEBUG_CONFIG=y # CONFIG_FAL_DEBUG_CONFIG is not set
CONFIG_FAL_DEBUG=1 CONFIG_FAL_DEBUG=0
CONFIG_FAL_PART_HAS_TABLE_CFG=y CONFIG_FAL_PART_HAS_TABLE_CFG=y
# CONFIG_FAL_USING_SFUD_PORT is not set # CONFIG_FAL_USING_SFUD_PORT is not set
# CONFIG_RT_USING_LWP is not set # CONFIG_RT_USING_LWP is not set
@@ -254,9 +254,7 @@ CONFIG_RT_USING_CPLUSPLUS=y
# #
# Utilities # Utilities
# #
CONFIG_RT_USING_RYM=y # CONFIG_RT_USING_RYM is not set
# CONFIG_YMODEM_USING_CRC_TABLE is not set
CONFIG_YMODEM_USING_FILE_TRANSFER=y
# CONFIG_RT_USING_ULOG is not set # CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set # CONFIG_RT_USING_UTEST is not set
# CONFIG_RT_USING_VAR_EXPORT is not set # CONFIG_RT_USING_VAR_EXPORT is not set

View File

@@ -60,7 +60,7 @@ objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SCons
# include drivers # include drivers
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript')))
objs.extend(SConscript(os.path.join(SDK_ROOT, 'iap', 'SConscript'))) # objs.extend(SConscript(os.path.join(SDK_ROOT, 'iap', 'SConscript')))
objs.extend(SConscript(os.path.join(SDK_ROOT, 'packages', 'SConscript'))) objs.extend(SConscript(os.path.join(SDK_ROOT, 'packages', 'SConscript')))

View File

@@ -59,8 +59,8 @@ void SystemClock_Config(void)
HAL_RCC_EnableCSS(); HAL_RCC_EnableCSS();
} }
#include "shell.h" //#include "shell.h"
INIT_APP_EXPORT(finsh_system_init); //INIT_APP_EXPORT(finsh_system_init);
extern void fal(uint8_t argc, char **argv); extern void fal(uint8_t argc, char **argv);
MSH_CMD_EXPORT(fal, FAL (Flash Abstraction Layer) operate.); MSH_CMD_EXPORT(fal, FAL (Flash Abstraction Layer) operate.);

View File

@@ -10,7 +10,6 @@
<TargetName>rt-thread</TargetName> <TargetName>rt-thread</TargetName>
<ToolsetNumber>0x4</ToolsetNumber> <ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName> <ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6> <uAC6>0</uAC6>
<TargetOption> <TargetOption>
<TargetCommonOption> <TargetCommonOption>
@@ -339,7 +338,7 @@
<MiscControls></MiscControls> <MiscControls></MiscControls>
<Define>__STDC_LIMIT_MACROS, USE_HAL_DRIVER, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, STM32F405xx, RT_USING_ARM_LIBC</Define> <Define>__STDC_LIMIT_MACROS, USE_HAL_DRIVER, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, __RTTHREAD__, STM32F405xx, RT_USING_ARM_LIBC</Define>
<Undefine></Undefine> <Undefine></Undefine>
<IncludePath>..\rt-thread\components\drivers\usb\usbdevice;..\rt-thread\components\utilities\ymodem;..\rt-thread\components\libc\compilers\common\extension;..\rt-thread\components\libc\posix\io\poll;..\rt-thread\components\drivers\include;..\libraries\HAL_Drivers\CMSIS\Include;..\rt-thread\components\libc\posix\io\stdio;..\rt-thread\components\drivers\include;..\rt-thread\include;..\iap;..\rt-thread\components\drivers\spi;..\libraries\HAL_Drivers\config;board;..\rt-thread\components\dfs\include;..\rt-thread\components\drivers\include;..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Include;..\rt-thread\components\drivers\include;..\libraries\HAL_Drivers\drv_flash;board\CubeMX_Config\Inc;..\rt-thread\components\finsh;..\rt-thread\components\dfs\filesystems\elmfat;..\rt-thread\components\libc\cplusplus;..\rt-thread\libcpu\arm\cortex-m4;..\rt-thread\components\drivers\include;..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc;..\rt-thread\components\libc\posix\ipc;..\rt-thread\components\libc\compilers\common\include;..\rt-thread\components\drivers\include;.;..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\rt-thread\components\fal\inc;..\rt-thread\libcpu\arm\common;..\libraries\HAL_Drivers</IncludePath> <IncludePath>..\rt-thread\components\drivers\usb\usbdevice;..\rt-thread\components\libc\compilers\common\extension;..\rt-thread\components\libc\posix\io\poll;..\rt-thread\components\drivers\include;..\libraries\HAL_Drivers\CMSIS\Include;..\rt-thread\components\libc\posix\io\stdio;..\rt-thread\components\drivers\include;..\rt-thread\include;..\rt-thread\components\drivers\spi;..\libraries\HAL_Drivers\config;board;..\rt-thread\components\dfs\include;..\rt-thread\components\drivers\include;..\libraries\STM32F4xx_HAL\CMSIS\Device\ST\STM32F4xx\Include;..\rt-thread\components\drivers\include;..\libraries\HAL_Drivers\drv_flash;board\CubeMX_Config\Inc;..\rt-thread\components\finsh;..\rt-thread\components\dfs\filesystems\elmfat;..\rt-thread\components\libc\cplusplus;..\rt-thread\libcpu\arm\cortex-m4;..\rt-thread\components\drivers\include;..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc;..\rt-thread\components\libc\posix\ipc;..\rt-thread\components\libc\compilers\common\include;..\rt-thread\components\drivers\include;.;..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\rt-thread\components\fal\inc;..\rt-thread\libcpu\arm\common;..\libraries\HAL_Drivers</IncludePath>
</VariousControls> </VariousControls>
</Cads> </Cads>
<Aads> <Aads>
@@ -428,20 +427,20 @@
<Group> <Group>
<GroupName>CPlusPlus</GroupName> <GroupName>CPlusPlus</GroupName>
<Files> <Files>
<File>
<FileName>cxx_crt.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\rt-thread\components\libc\cplusplus\cxx_crt.cpp</FilePath>
</File>
<File> <File>
<FileName>cxx_Mutex.cpp</FileName> <FileName>cxx_Mutex.cpp</FileName>
<FileType>8</FileType> <FileType>8</FileType>
<FilePath>..\rt-thread\components\libc\cplusplus\cxx_Mutex.cpp</FilePath> <FilePath>..\rt-thread\components\libc\cplusplus\cxx_Mutex.cpp</FilePath>
</File> </File>
<File> <File>
<FileName>cxx_crt_init.c</FileName> <FileName>cxx_Thread.cpp</FileName>
<FileType>1</FileType> <FileType>8</FileType>
<FilePath>..\rt-thread\components\libc\cplusplus\cxx_crt_init.c</FilePath> <FilePath>..\rt-thread\components\libc\cplusplus\cxx_Thread.cpp</FilePath>
</File>
<File>
<FileName>cxx_crt.cpp</FileName>
<FileType>8</FileType>
<FilePath>..\rt-thread\components\libc\cplusplus\cxx_crt.cpp</FilePath>
</File> </File>
<File> <File>
<FileName>cxx_Semaphore.cpp</FileName> <FileName>cxx_Semaphore.cpp</FileName>
@@ -449,9 +448,9 @@
<FilePath>..\rt-thread\components\libc\cplusplus\cxx_Semaphore.cpp</FilePath> <FilePath>..\rt-thread\components\libc\cplusplus\cxx_Semaphore.cpp</FilePath>
</File> </File>
<File> <File>
<FileName>cxx_Thread.cpp</FileName> <FileName>cxx_crt_init.c</FileName>
<FileType>8</FileType> <FileType>1</FileType>
<FilePath>..\rt-thread\components\libc\cplusplus\cxx_Thread.cpp</FilePath> <FilePath>..\rt-thread\components\libc\cplusplus\cxx_crt_init.c</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>
@@ -638,6 +637,11 @@
<Group> <Group>
<GroupName>Fal</GroupName> <GroupName>Fal</GroupName>
<Files> <Files>
<File>
<FileName>fal_flash.c</FileName>
<FileType>1</FileType>
<FilePath>..\rt-thread\components\fal\src\fal_flash.c</FilePath>
</File>
<File> <File>
<FileName>fal_rtt.c</FileName> <FileName>fal_rtt.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@@ -653,11 +657,6 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\rt-thread\components\fal\src\fal_partition.c</FilePath> <FilePath>..\rt-thread\components\fal\src\fal_partition.c</FilePath>
</File> </File>
<File>
<FileName>fal_flash.c</FileName>
<FileType>1</FileType>
<FilePath>..\rt-thread\components\fal\src\fal_flash.c</FilePath>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>
@@ -730,16 +729,6 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>IAP</GroupName>
<Files>
<File>
<FileName>iap.c</FileName>
<FileType>1</FileType>
<FilePath>..\iap\iap.c</FilePath>
</File>
</Files>
</Group>
<Group> <Group>
<GroupName>Kernel</GroupName> <GroupName>Kernel</GroupName>
<Files> <Files>
@@ -1000,21 +989,6 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>Utilities</GroupName>
<Files>
<File>
<FileName>ry_sy.c</FileName>
<FileType>1</FileType>
<FilePath>..\rt-thread\components\utilities\ymodem\ry_sy.c</FilePath>
</File>
<File>
<FileName>ymodem.c</FileName>
<FileType>1</FileType>
<FilePath>..\rt-thread\components\utilities\ymodem\ymodem.c</FilePath>
</File>
</Files>
</Group>
</Groups> </Groups>
</Target> </Target>
</Targets> </Targets>

View File

@@ -43,7 +43,7 @@
#define RT_USING_DEVICE #define RT_USING_DEVICE
#define RT_USING_CONSOLE #define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128 #define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart1" #define RT_CONSOLE_DEVICE_NAME "block_r"
#define RT_VER_NUM 0x50000 #define RT_VER_NUM 0x50000
#define ARCH_ARM #define ARCH_ARM
#define RT_USING_CPU_FFS #define RT_USING_CPU_FFS
@@ -91,8 +91,7 @@
#define RT_DFS_ELM_REENTRANT #define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000 #define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_FAL #define RT_USING_FAL
#define FAL_DEBUG_CONFIG #define FAL_DEBUG 0
#define FAL_DEBUG 1
#define FAL_PART_HAS_TABLE_CFG #define FAL_PART_HAS_TABLE_CFG
/* Device Drivers */ /* Device Drivers */
@@ -143,8 +142,6 @@
/* Utilities */ /* Utilities */
#define RT_USING_RYM
#define YMODEM_USING_FILE_TRANSFER
/* RT-Thread online packages */ /* RT-Thread online packages */

View File

@@ -110,8 +110,8 @@ CONFIG_FINSH_USING_DESCRIPTION=y
CONFIG_FINSH_ARG_MAX=10 CONFIG_FINSH_ARG_MAX=10
# CONFIG_RT_USING_DFS is not set # CONFIG_RT_USING_DFS is not set
CONFIG_RT_USING_FAL=y CONFIG_RT_USING_FAL=y
CONFIG_FAL_DEBUG_CONFIG=y # CONFIG_FAL_DEBUG_CONFIG is not set
CONFIG_FAL_DEBUG=1 CONFIG_FAL_DEBUG=0
CONFIG_FAL_PART_HAS_TABLE_CFG=y CONFIG_FAL_PART_HAS_TABLE_CFG=y
# CONFIG_FAL_USING_SFUD_PORT is not set # CONFIG_FAL_USING_SFUD_PORT is not set
# CONFIG_RT_USING_LWP is not set # CONFIG_RT_USING_LWP is not set

View File

@@ -70,8 +70,7 @@
#define FINSH_USING_DESCRIPTION #define FINSH_USING_DESCRIPTION
#define FINSH_ARG_MAX 10 #define FINSH_ARG_MAX 10
#define RT_USING_FAL #define RT_USING_FAL
#define FAL_DEBUG_CONFIG #define FAL_DEBUG 0
#define FAL_DEBUG 1
#define FAL_PART_HAS_TABLE_CFG #define FAL_PART_HAS_TABLE_CFG
/* Device Drivers */ /* Device Drivers */

View File

@@ -149,23 +149,7 @@ static const char *port_list[] = {
#define PORTS_NUM (sizeof(port_list)/sizeof(port_list[0])) #define PORTS_NUM (sizeof(port_list)/sizeof(port_list[0]))
void rt_hw_shell_relink(const char *name, rt_uint32_t baud) void rt_hw_shell_relink(const char *name, rt_uint32_t baud);
{
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
config.baud_rate = baud;
rt_device_t dev = rt_device_find(name);
RT_ASSERT(dev);
rt_device_control(dev, RT_DEVICE_CTRL_CONFIG, &config);
rt_console_set_device(name);
rt_thread_t tid = rt_thread_find(FINSH_THREAD_NAME);
if (tid)
{
rt_thread_resume(tid);
rt_schedule();
}
}
static rt_device_t _read_ports(rt_device_t ports[], rt_uint8_t want) static rt_device_t _read_ports(rt_device_t ports[], rt_uint8_t want)
{ {
@@ -621,18 +605,6 @@ static void _cmd_iap(void)
} }
MSH_CMD_EXPORT_ALIAS(_cmd_iap, iap, iap bootloader / app start); MSH_CMD_EXPORT_ALIAS(_cmd_iap, iap, iap bootloader / app start);
static void shell_relink(int argc, char **argv)
{
if (argc < 2)
{
rt_kprintf("%s prt_name\n", argv[0]);
return;
}
rt_hw_shell_relink(argv[1], BAUD_RATE_460800);
}
MSH_CMD_EXPORT(shell_relink, relink msh to other port);
#ifdef IAP_DBG #ifdef IAP_DBG
void iap_log() void iap_log()
{ {
@@ -650,19 +622,3 @@ void iap_log()
} }
MSH_CMD_EXPORT(iap_log, iap log); MSH_CMD_EXPORT(iap_log, iap log);
#endif #endif
static struct rt_device blocked_reader_ = {0};
static rt_size_t _blocked_reader_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
{
return 0;
}
int init_block_reader()
{
blocked_reader_.read = _blocked_reader_read;
rt_device_register(&blocked_reader_, "block_r", RT_DEVICE_FLAG_RDWR);
return 0;
}
INIT_BOARD_EXPORT(init_block_reader);

View File

@@ -214,3 +214,48 @@ void rt_hw_board_init(void)
#endif #endif
} }
static struct rt_device blocked_reader_ = {0};
static rt_size_t _blocked_reader_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
{
return 0;
}
int init_block_reader()
{
blocked_reader_.read = _blocked_reader_read;
rt_device_register(&blocked_reader_, "block_r", RT_DEVICE_FLAG_RDWR);
return 0;
}
INIT_BOARD_EXPORT(init_block_reader);
void rt_hw_shell_relink(const char *name, rt_uint32_t baud)
{
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
config.baud_rate = baud;
rt_device_t dev = rt_device_find(name);
RT_ASSERT(dev);
rt_device_control(dev, RT_DEVICE_CTRL_CONFIG, &config);
rt_console_set_device(name);
rt_thread_t tid = rt_thread_find(FINSH_THREAD_NAME);
if (tid)
{
rt_thread_resume(tid);
rt_schedule();
}
}
static void shell_relink(int argc, char **argv)
{
if (argc < 2)
{
rt_kprintf("%s prt_name\n", argv[0]);
return;
}
rt_hw_shell_relink(argv[1], BAUD_RATE_460800);
}
MSH_CMD_EXPORT(shell_relink, relink msh to other port);