fw.bin 使用 sbl.bin 中的 sbl_printf 函数

This commit is contained in:
2024-10-29 15:26:43 +08:00
parent 8b0435853d
commit 99537d5bd9
8 changed files with 28 additions and 4 deletions

View File

@@ -938,6 +938,8 @@ if [ "${DEF_CORE_TYPE}" == "ampplc" ]; then
../tools/rom_img/make_ld.sh --addrs ../ap/.output/cus/lib/ht_${DEF_IMAGE_TYPE}.out \
../startup/ldscripts/riscv3/amp_cus_symbol > ../startup/ldscripts/riscv3/cus.addrs.ld
fi
../tools/rom_img/make_ld.sh --addrs ../sbl/.output/plc/lib/kunlun_sbl.out \
../tools/rom_img/sbl_symbol > ../startup/ldscripts/riscv3/sbl.addrs.ld
build_obj_func ${DEF_IMAGE_TYPE} ${DEF_PLC_APP} PLC
# 删除 cfg_log.txt

View File

@@ -22,6 +22,8 @@ Information is free from patent or copyright infringement.
#define SBL_DEBUG_UART_PORT 0
extern struct uart_ctrl uart_e_ctrl;
// 这个定义在其他文件
extern uint32_t g_is_print_enable;
static int (*format_str_v_fn)(const str_format_context *ctxt, const char *format,
@@ -65,6 +67,13 @@ int8_t getc(void)
return (int8_t)c;
}
extern str_format_context rom_log_ctxt;
extern int rom_format_str_v(const str_format_context *ctxt, const char *format,
va_list ap);
int sbl_printf_init(void *sbl_format_str_v, void *sbl_log_ctxt)
{
format_str_v_fn = sbl_format_str_v;
@@ -81,6 +90,9 @@ int32_t sbl_printf(const char *fmt, ...)
if (g_is_print_enable == 0)
return 0;
if(!format_str_v_fn){
sbl_printf_init(rom_format_str_v, &rom_log_ctxt);
}
va_start(ap, fmt);
res = format_str_v_fn(p_log_ctxt, fmt, ap);

View File

@@ -178,4 +178,5 @@ SECTIONS
}
INCLUDE "rom.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "sbl.addrs.ld"

View File

@@ -186,4 +186,5 @@ SECTIONS
}
INCLUDE "sec_cpu_sta.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "sbl.addrs.ld"

View File

@@ -185,4 +185,5 @@ SECTIONS
}
INCLUDE "sec_cpu_cco.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "sbl.addrs.ld"

View File

@@ -185,4 +185,5 @@ SECTIONS
}
INCLUDE "sec_cpu_sta.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "rom.addrs.ld"
INCLUDE "sbl.addrs.ld"

View File

@@ -126,10 +126,15 @@ int32_t iot_module_start(void)
return 0;
}
extern int32_t sbl_printf(const char *fmt, ...);
uint32_t iot_plc_entry(iot_build_info_t *info)
{
sbl_param_input_t param = {0};
sbl_printf("enter fw...\n");
iot_system_get_fw_boot_param(&param);
// 设置app的build_info
iot_version_set_user_build_info(info);

1
tools/rom_img/sbl_symbol Normal file
View File

@@ -0,0 +1 @@
sbl_printf