From b12b8e98a1d996e5bff5b788ed02cad627d68a6a Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 26 Dec 2023 22:06:30 +0800 Subject: [PATCH] [ci][stm32f407] add attach config CI check --- .../HAL_Drivers/drivers/drv_soft_spi.c | 1 + .../.ci/attachconfig/eeprom.attach | 1 + .../.ci/attachconfig/esp8266.attach | 1 + .../.ci/attachconfig/ethernet.attach | 1 + .../.ci/attachconfig/lvgl.attach | 2 + .../.ci/attachconfig/sdcard.attach | 2 + .../stm32f407-atk-explorer/board/Kconfig | 1 + .../board/ports/drv_lcd.c | 3 +- .../board/ports/phy_reset.c | 1 + components/dfs/Kconfig | 5 +++ .../dfs/dfs_v1/filesystems/romfs/SConscript | 4 -- .../dfs/dfs_v1/filesystems/romfs/dfs_romfs.c | 27 +++++++++++++ .../dfs/dfs_v1/filesystems/romfs/dfs_romfs.h | 5 ++- .../dfs/dfs_v1/filesystems/romfs/romfs.c | 38 ------------------- .../dfs/dfs_v2/filesystems/romfs/SConscript | 4 -- tools/ci/bsp_buildings.py | 2 +- 16 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/eeprom.attach create mode 100644 bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/esp8266.attach create mode 100644 bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/ethernet.attach create mode 100644 bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/lvgl.attach create mode 100644 bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/sdcard.attach delete mode 100644 components/dfs/dfs_v1/filesystems/romfs/romfs.c diff --git a/bsp/stm32/libraries/HAL_Drivers/drivers/drv_soft_spi.c b/bsp/stm32/libraries/HAL_Drivers/drivers/drv_soft_spi.c index fae3841a6f7..ad186e3bcd1 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drivers/drv_soft_spi.c +++ b/bsp/stm32/libraries/HAL_Drivers/drivers/drv_soft_spi.c @@ -8,6 +8,7 @@ * 2022-6-14 solar first version */ #include +#include #include "drv_soft_spi.h" #include "drv_config.h" diff --git a/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/eeprom.attach b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/eeprom.attach new file mode 100644 index 00000000000..fc5e97f3b72 --- /dev/null +++ b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/eeprom.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_EEPROM=y diff --git a/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/esp8266.attach b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/esp8266.attach new file mode 100644 index 00000000000..4a388a990a4 --- /dev/null +++ b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/esp8266.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_AT_ESP8266=y diff --git a/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/ethernet.attach b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/ethernet.attach new file mode 100644 index 00000000000..d99c88a0714 --- /dev/null +++ b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/ethernet.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_ETH=y diff --git a/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/lvgl.attach b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/lvgl.attach new file mode 100644 index 00000000000..d90eeb40aee --- /dev/null +++ b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/lvgl.attach @@ -0,0 +1,2 @@ +CONFIG_BSP_USING_LVGL=y +CONFIG_BSP_USING_LVGL_DEMO=y diff --git a/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/sdcard.attach b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/sdcard.attach new file mode 100644 index 00000000000..d87e0ee6655 --- /dev/null +++ b/bsp/stm32/stm32f407-atk-explorer/.ci/attachconfig/sdcard.attach @@ -0,0 +1,2 @@ +CONFIG_BSP_USING_FS=y +BSP_USING_SDCARD_FATFS=y diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig index c8302e8c87b..a00d5ddafdc 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig +++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig @@ -127,6 +127,7 @@ menu "Onboard Peripheral Drivers" bool "Enable File System" select RT_USING_DFS select RT_USING_DFS_ROMFS + select RT_USING_DFS_ROMFS_USER_ROOT default n if BSP_USING_FS diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_lcd.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_lcd.c index fcabf1a8141..48ed4c22e97 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_lcd.c +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/drv_lcd.c @@ -12,7 +12,8 @@ #include #include "drv_lcd.h" -#include "string.h" +#include +#include //#define DRV_DEBUG #define LOG_TAG "drv.lcd" diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/phy_reset.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/phy_reset.c index ec5c61f1b00..0620ed1de09 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/phy_reset.c +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/phy_reset.c @@ -9,6 +9,7 @@ */ #include +#include #define RESET_IO GET_PIN(D, 3) diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig index 7a6a49859dc..6af2555a143 100644 --- a/components/dfs/Kconfig +++ b/components/dfs/Kconfig @@ -165,6 +165,11 @@ endif bool "Enable ReadOnly file system on flash" default n + config RT_USING_DFS_ROMFS_USER_ROOT + bool "Use user's romfs root" + depends on RT_USING_DFS_ROMFS + default n + config RT_USING_DFS_CROMFS bool "Enable ReadOnly compressed file system on flash" default n diff --git a/components/dfs/dfs_v1/filesystems/romfs/SConscript b/components/dfs/dfs_v1/filesystems/romfs/SConscript index bfd633ce912..59599d02fb4 100644 --- a/components/dfs/dfs_v1/filesystems/romfs/SConscript +++ b/components/dfs/dfs_v1/filesystems/romfs/SConscript @@ -6,10 +6,6 @@ cwd = GetCurrentDir() src = Glob('*.c') CPPPATH = [cwd] -if GetDepend('DFS_ROMFS_ROOT'): - # A new ROMFS root has been defined, we should remove the romfs.c - SrcRemove(src, ['romfs.c']) - group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS','RT_USING_DFS_ROMFS'], CPPPATH = CPPPATH) Return('group') diff --git a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c index 1ae48c27ed6..b84c0498eb2 100644 --- a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c @@ -382,3 +382,30 @@ int dfs_romfs_init(void) } INIT_COMPONENT_EXPORT(dfs_romfs_init); +#ifndef RT_USING_DFS_ROMFS_USER_ROOT +static const unsigned char _dummy_dummy_txt[] = +{ + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a, +}; + +static const struct romfs_dirent _dummy[] = +{ + {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_dummy_txt, sizeof(_dummy_dummy_txt)}, +}; + +static const unsigned char _dummy_txt[] = +{ + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a, +}; + +rt_weak const struct romfs_dirent _root_dirent[] = +{ + {ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy) / sizeof(_dummy[0])}, + {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)}, +}; + +rt_weak const struct romfs_dirent romfs_root = +{ + ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent) / sizeof(_root_dirent[0]) +}; +#endif diff --git a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h index affa4bf9934..829e17dc33a 100644 --- a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h +++ b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h @@ -26,6 +26,9 @@ struct romfs_dirent }; int dfs_romfs_init(void); + +#ifndef RT_USING_DFS_ROMFS_USER_ROOT extern const struct romfs_dirent romfs_root; +#endif /* RT_USING_DFS_ROMFS_USER_ROOT */ -#endif +#endif /* __DFS_ROMFS_H__ */ diff --git a/components/dfs/dfs_v1/filesystems/romfs/romfs.c b/components/dfs/dfs_v1/filesystems/romfs/romfs.c deleted file mode 100644 index 0ca17766c89..00000000000 --- a/components/dfs/dfs_v1/filesystems/romfs/romfs.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2006-2022, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ - -#include -#include - -static const unsigned char _dummy_dummy_txt[] = -{ - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a, -}; - -static const struct romfs_dirent _dummy[] = -{ - {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_dummy_txt, sizeof(_dummy_dummy_txt)}, -}; - -static const unsigned char _dummy_txt[] = -{ - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a, -}; - -rt_weak const struct romfs_dirent _root_dirent[] = -{ - {ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy) / sizeof(_dummy[0])}, - {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)}, -}; - -rt_weak const struct romfs_dirent romfs_root = -{ - ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent) / sizeof(_root_dirent[0]) -}; - diff --git a/components/dfs/dfs_v2/filesystems/romfs/SConscript b/components/dfs/dfs_v2/filesystems/romfs/SConscript index bfd633ce912..59599d02fb4 100644 --- a/components/dfs/dfs_v2/filesystems/romfs/SConscript +++ b/components/dfs/dfs_v2/filesystems/romfs/SConscript @@ -6,10 +6,6 @@ cwd = GetCurrentDir() src = Glob('*.c') CPPPATH = [cwd] -if GetDepend('DFS_ROMFS_ROOT'): - # A new ROMFS root has been defined, we should remove the romfs.c - SrcRemove(src, ['romfs.c']) - group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS','RT_USING_DFS_ROMFS'], CPPPATH = CPPPATH) Return('group') diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 39351d76419..d14d2ef89db 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -67,7 +67,7 @@ def build_bsp(bsp): nproc = multiprocessing.cpu_count() os.chdir(rtt_root) - __, res = run_cmd(f'scons -C bsp/{bsp} -j{nproc}') + __, res = run_cmd(f'scons -C bsp/{bsp} -j{nproc}', output_info=False) if res != 0: success = False