From ff1d8f698ad5d8b8b38fe27fe47fdb33ed667837 Mon Sep 17 00:00:00 2001 From: andy <1414772332@qq.com> Date: Fri, 1 Nov 2024 19:16:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=B0=83=E7=94=A8=20sbl=5Fpr?= =?UTF-8?q?intf=20=E7=9A=84=E5=9C=B0=E6=96=B9=E5=8F=AF=E4=BB=A5=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=87=BD=E6=95=B0=E6=8C=87=E9=92=88=E6=9D=A5=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.txt | 11 +++++++++-- driver/src/hw3/gpio_mtx.c | 8 ++++++-- inc/iot_config.h | 7 +++++++ mfgtool/ram/src/hw/ram_hw.c | 3 ++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index 07bac33..c491a28 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -9,8 +9,15 @@ c_cpp_properties.json 中指定了编译器路径之后 如果此编译器不在path路径中 则会出现类似找不到 stdarg.h 的问题 指定了 riscv 的编译器之后 clear_csr write_csr 宏可以正常找到 -2024.410.27 +2024.10.27 要解决 oem分区空间不够的问题, 如果把超出的部分添加在fw分区后面 应该是需要修改 ram.bin 的, 因为ram.bin 写入数据的长度是读取的分区size 这个size不能动 因为解压也需要使用这个参数 - 或者考虑添加在未压缩的ht.bin 文件后面? \ No newline at end of file + 或者考虑添加在未压缩的ht.bin 文件后面? +2024.11.1 + 如果函数在库中被调用 则这个函数不能使用 extern 到链接脚本的函数 + 例如 gpio_pin_select 函数在 driver 库中被调用 则不能使用 sbl_parintf + 但 board_load_oem_cfg 没有在库中被调用 可以使用 sbl_parintf + 要解决个问题 可以用一个函数指针来强行定位到这个函数的地址 调用这个函数指针即可 +2024.11.1 + layout_index 并不最终决定使用的layout ,获取layout时会根据 flash psram 来重新指定 \ No newline at end of file diff --git a/driver/src/hw3/gpio_mtx.c b/driver/src/hw3/gpio_mtx.c index bb7f4ab..59482c6 100644 --- a/driver/src/hw3/gpio_mtx.c +++ b/driver/src/hw3/gpio_mtx.c @@ -21,6 +21,7 @@ Information is free from patent or copyright infringement. #include "pin_rf.h" #include "gpio_mtx_hw.h" #include "apb.h" +#include "iot_config.h" #define GPIO_MTX_CHECK(a) \ if (!(a)) { \ @@ -118,7 +119,9 @@ void gpio_pin_oinv(uint32_t pin, uint32_t val) PIN_RF_WRITE_REG(offset, tmp); } -void gpio_pin_select(uint32_t pin, uint32_t func) +static_printf_def(0x10001b9e) + +void gpio_pin_select(uint32_t pin , uint32_t func) { uint32_t tmp; uint32_t offset; @@ -127,7 +130,8 @@ void gpio_pin_select(uint32_t pin, uint32_t func) offset = PIN_GET_OFFSET(pin); tmp = PIN_RF_READ_REG(offset); REG_FIELD_SET(GPIO_FUNC_SEL, tmp, func); - PIN_RF_WRITE_REG(offset, tmp); + PIN_RF_WRITE_REG(offset , tmp); + sbl_printf("gpio pin=%d , fun=%d\n" , pin , func); } uint8_t gpio_pin_get_select(uint32_t pin) diff --git a/inc/iot_config.h b/inc/iot_config.h index 92d3ca6..85f6840 100644 --- a/inc/iot_config.h +++ b/inc/iot_config.h @@ -142,4 +142,11 @@ Information is free from patent or copyright infringement. /* FTM configuration end ******************************************************/ +// 定义本地用于打印的函数指针 +#define static_printf_def(addr) \ +typedef int32_t (*static_printf)(const char *fmt, ...);\ +static static_printf sbl_printf= (static_printf)addr; + + + #endif /* IOT_CONFIG_H */ diff --git a/mfgtool/ram/src/hw/ram_hw.c b/mfgtool/ram/src/hw/ram_hw.c index f943187..eb0ef84 100644 --- a/mfgtool/ram/src/hw/ram_hw.c +++ b/mfgtool/ram/src/hw/ram_hw.c @@ -210,7 +210,8 @@ void ramImageTableUpgrade(uint8_t flash_size, uint8_t psram_flag, } } -void ramReloadFlashBurnImageTable(uint8_t flash_size, uint8_t psram_flag, +// 这个函数会根据实际配置重新指定layout_index +void ramReloadFlashBurnImageTable(uint8_t flash_size , uint8_t psram_flag , uint8_t pkt_type, uint8_t layout_index) { if (layout_index != FLASH_LAYOUT_INDEX_INVALID_VALUE) {