fw.bin 使用 sbl.bin 中的 sbl_printf 函数
This commit is contained in:
@@ -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 \
|
../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
|
../startup/ldscripts/riscv3/amp_cus_symbol > ../startup/ldscripts/riscv3/cus.addrs.ld
|
||||||
fi
|
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
|
build_obj_func ${DEF_IMAGE_TYPE} ${DEF_PLC_APP} PLC
|
||||||
|
|
||||||
# 删除 cfg_log.txt
|
# 删除 cfg_log.txt
|
||||||
|
@@ -22,6 +22,8 @@ Information is free from patent or copyright infringement.
|
|||||||
#define SBL_DEBUG_UART_PORT 0
|
#define SBL_DEBUG_UART_PORT 0
|
||||||
|
|
||||||
extern struct uart_ctrl uart_e_ctrl;
|
extern struct uart_ctrl uart_e_ctrl;
|
||||||
|
|
||||||
|
// 这个定义在其他文件
|
||||||
extern uint32_t g_is_print_enable;
|
extern uint32_t g_is_print_enable;
|
||||||
|
|
||||||
static int (*format_str_v_fn)(const str_format_context *ctxt, const char *format,
|
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;
|
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)
|
int sbl_printf_init(void *sbl_format_str_v, void *sbl_log_ctxt)
|
||||||
{
|
{
|
||||||
format_str_v_fn = sbl_format_str_v;
|
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)
|
if (g_is_print_enable == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
if(!format_str_v_fn){
|
||||||
|
sbl_printf_init(rom_format_str_v, &rom_log_ctxt);
|
||||||
|
}
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
res = format_str_v_fn(p_log_ctxt, fmt, ap);
|
res = format_str_v_fn(p_log_ctxt, fmt, ap);
|
||||||
|
@@ -178,4 +178,5 @@ SECTIONS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE "rom.addrs.ld"
|
INCLUDE "rom.addrs.ld"
|
||||||
|
INCLUDE "sbl.addrs.ld"
|
@@ -186,4 +186,5 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE "sec_cpu_sta.addrs.ld"
|
INCLUDE "sec_cpu_sta.addrs.ld"
|
||||||
INCLUDE "rom.addrs.ld"
|
INCLUDE "rom.addrs.ld"
|
||||||
|
INCLUDE "sbl.addrs.ld"
|
@@ -185,4 +185,5 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE "sec_cpu_cco.addrs.ld"
|
INCLUDE "sec_cpu_cco.addrs.ld"
|
||||||
INCLUDE "rom.addrs.ld"
|
INCLUDE "rom.addrs.ld"
|
||||||
|
INCLUDE "sbl.addrs.ld"
|
@@ -185,4 +185,5 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE "sec_cpu_sta.addrs.ld"
|
INCLUDE "sec_cpu_sta.addrs.ld"
|
||||||
INCLUDE "rom.addrs.ld"
|
INCLUDE "rom.addrs.ld"
|
||||||
|
INCLUDE "sbl.addrs.ld"
|
@@ -126,10 +126,15 @@ int32_t iot_module_start(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int32_t sbl_printf(const char *fmt, ...);
|
||||||
|
|
||||||
|
|
||||||
uint32_t iot_plc_entry(iot_build_info_t *info)
|
uint32_t iot_plc_entry(iot_build_info_t *info)
|
||||||
{
|
{
|
||||||
sbl_param_input_t param = {0};
|
sbl_param_input_t param = {0};
|
||||||
|
|
||||||
|
sbl_printf("enter fw...\n");
|
||||||
|
|
||||||
iot_system_get_fw_boot_param(¶m);
|
iot_system_get_fw_boot_param(¶m);
|
||||||
// 设置app的build_info
|
// 设置app的build_info
|
||||||
iot_version_set_user_build_info(info);
|
iot_version_set_user_build_info(info);
|
||||||
|
1
tools/rom_img/sbl_symbol
Normal file
1
tools/rom_img/sbl_symbol
Normal file
@@ -0,0 +1 @@
|
|||||||
|
sbl_printf
|
Reference in New Issue
Block a user