From 56dd57f4a0a3ae9c1762c83c1c59874cc22ae42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 14 Jun 2022 17:28:00 +0200 Subject: [PATCH] [beken-72xx] Remove unused components --- boards/_base/beken-72xx.json | 5 +- builder/frameworks/beken-72xx-sdk.py | 22 +------- platform/beken-72xx/fixups/arch_main.c | 72 +++----------------------- platform/beken-72xx/fixups/ate_app.c | 7 +++ 4 files changed, 19 insertions(+), 87 deletions(-) create mode 100644 platform/beken-72xx/fixups/ate_app.c diff --git a/boards/_base/beken-72xx.json b/boards/_base/beken-72xx.json index 36c7941..54d447b 100644 --- a/boards/_base/beken-72xx.json +++ b/boards/_base/beken-72xx.json @@ -11,7 +11,10 @@ "protocols": [ "openocd" ], - "openocd_config": "bk72xx.cfg" + "openocd_config": "bk72xx.cfg", + "gdb_init": [ + "mem 0x000000 0x200000 ro" + ] }, "frameworks": [ "beken-72xx-sdk" diff --git a/builder/frameworks/beken-72xx-sdk.py b/builder/frameworks/beken-72xx-sdk.py index b85c30f..d6593e7 100644 --- a/builder/frameworks/beken-72xx-sdk.py +++ b/builder/frameworks/beken-72xx-sdk.py @@ -113,12 +113,8 @@ env.AddLibrary( base_dir=ROOT_DIR, srcs=[ "+", - "+", "+", - "+", "+", - "+", - "+", "+", *srcs_core, ], @@ -126,7 +122,6 @@ env.AddLibrary( "+", "+", "+", - "+", "+", "+", "+", @@ -140,6 +135,7 @@ env.AddLibrary( base_dir="$PARENT_DIR/fixups", srcs=[ "+", + "+", "+", *srcs_fixups, ], @@ -354,22 +350,6 @@ env.AddLibrary( ), ) -# Sources - demos TODO remove this -env.AddLibrary( - name="bdk_demos", - base_dir="$SDK_DIR", - srcs=[ - "+", - "-", - "-", - "-", - ], - includes=[ - "+", - "+", - ], -) - # Sources - chip-specific drivers if SOC in [SOC_BK7231U, SOC_BK7251]: env.AddLibrary( diff --git a/platform/beken-72xx/fixups/arch_main.c b/platform/beken-72xx/fixups/arch_main.c index 192ff36..7c43e00 100644 --- a/platform/beken-72xx/fixups/arch_main.c +++ b/platform/beken-72xx/fixups/arch_main.c @@ -10,15 +10,11 @@ **************************************************************************************** */ #include "app.h" -#include "ate_app.h" #include "driver_pub.h" #include "func_pub.h" #include "include.h" #include "start_type_pub.h" -beken_semaphore_t extended_app_sema = NULL; -uint32_t extended_app_stack_size = 2048; - extern void user_main_entry(void); #if CFG_SUPPORT_BOOTLOADER @@ -27,58 +23,9 @@ void entry_set_world_flag(void) { } #endif // CFG_SUPPORT_BOOTLOADER -void extended_app_launch_over(void) { - OSStatus ret; - ret = rtos_set_semaphore(&extended_app_sema); - (void)ret; -} - -void extended_app_waiting_for_launch(void) { - OSStatus ret; - ret = rtos_get_semaphore(&extended_app_sema, BEKEN_WAIT_FOREVER); - ASSERT(kNoErr == ret); - (void)ret; -} - -static void extended_app_task_handler(void *arg) { - func_init_extended(); - if (get_ate_mode_state()) { - ate_start(); - } else { - app_start(); - } - extended_app_launch_over(); - rtos_delete_thread(NULL); -} - -void extended_app_init(void) { - OSStatus ret; - ret = rtos_init_semaphore(&extended_app_sema, 1); - ASSERT(kNoErr == ret); -} - -void extended_app_uninit(void) { - OSStatus ret; - ret = rtos_deinit_semaphore(&extended_app_sema); - ASSERT(kNoErr == ret); -} - -void extended_app_launch(void) { - OSStatus ret; - ret = rtos_create_thread( - NULL, - THD_EXTENDED_APP_PRIORITY, - "extended_app", - (beken_thread_function_t)extended_app_task_handler, - extended_app_stack_size, - (beken_thread_arg_t)0 - ); - ASSERT(kNoErr == ret); -} +extern void main(void); void entry_main(void) { - // check GPIO0 and start ATE app - ate_app_init(); // compatibility with BK7231S_1.0.5 #if CFG_SUPPORT_BOOTLOADER entry_set_world_flag(); @@ -89,16 +36,11 @@ void entry_main(void) { driver_init(); // reboot the board if start_type == RESET_SOURCE_CRASH_PER_XAT0 bk_misc_check_start_type(); - // init flash and intc + // init drivers func_init_basic(); - // init semaphore for extended_app_launch - extended_app_init(); - // run task with init_app_thread - user_main_entry(); - // run task with extended_app_task_handler - extended_app_launch(); - // start FreeRTOS -#if (CFG_OS_FREERTOS) - vTaskStartScheduler(); -#endif + func_init_extended(); + // run core initialization tasks + app_pre_start(); + // run the app + main(); } diff --git a/platform/beken-72xx/fixups/ate_app.c b/platform/beken-72xx/fixups/ate_app.c new file mode 100644 index 0000000..2dad5e9 --- /dev/null +++ b/platform/beken-72xx/fixups/ate_app.c @@ -0,0 +1,7 @@ +/* Copyright (c) Kuba SzczodrzyƄski 2022-06-14. */ + +#include "include.h" + +uint32_t get_ate_mode_state(void) { + return 0; +}