编译ram.bin
This commit is contained in:
@@ -6,12 +6,12 @@
|
||||
OUTPUT_TYPE = 0
|
||||
OUTPUT_NAME = mfgtool
|
||||
|
||||
SUB_DIRS = ah oem_tool lzma clzma bootram
|
||||
SUB_DIRS = ah oem_tool lzma clzma bootram ram
|
||||
|
||||
# Kl3 compiles ram.bin separately to improve compilation speed.
|
||||
ifneq ($(target), kunlun3)
|
||||
SUB_DIRS += ram
|
||||
endif
|
||||
# ifneq ($(target), kunlun3)
|
||||
# SUB_DIRS += ram
|
||||
# endif
|
||||
|
||||
# .h files dir
|
||||
ADD_INCLUDE += $(TOPDIR)/inc $(TOPDIR)/inc/compiler/gcc $(TOPDIR)/inc/utils $(TOPDIR)/inc/os_shim
|
||||
|
@@ -70,14 +70,16 @@ else ifeq ($(ram_build_type), ram_type_chipburn)
|
||||
endif
|
||||
else
|
||||
RAM_TYPE = smoke
|
||||
OUTPUT_NAME = kl_ram
|
||||
ifeq ($(target), kunlun2)
|
||||
OUTPUT_NAME = kl2_ram
|
||||
OUTPUT_DIR = $(TOPDIR)/mfgtool/ram/.output/lib
|
||||
TARGET_DIR = .output/lib
|
||||
else ifeq ($(target), kunlun3)
|
||||
OUTPUT_NAME = kl3_ram
|
||||
OUTPUT_DIR = $(TOPDIR)/mfgtool/ram/.output/plc/lib
|
||||
TARGET_DIR = .output/plc/lib
|
||||
else
|
||||
OUTPUT_NAME = kl1_ram
|
||||
OUTPUT_DIR = $(TOPDIR)/mfgtool/ram/.output/lib
|
||||
TARGET_DIR = .output/lib
|
||||
endif
|
||||
@@ -102,6 +104,7 @@ PRE_MARCO += IOT_BUILD_TYPE=IOT_BUILD_TYPE_RAM
|
||||
|
||||
SUB_DIRS = ../ram/src ../ram/src/$(hw_dep) $(TOPDIR)/mfgtool/clzma $(TOPDIR)/mfgtool/io_lib
|
||||
|
||||
ADD_INCLUDE += inc inc/$(hw_dep)
|
||||
ADD_INCLUDE += $(TOPDIR)/inc/os_shim $(TOPDIR)/inc/compiler/gcc $(TOPDIR)/inc/utils
|
||||
ADD_INCLUDE += $(TOPDIR)/mfgtool/ram/inc $(TOPDIR)/mfgtool/ram/inc/$(hw_dep) $(TOPDIR)/inc $(TOPDIR)/driver/inc $(TOPDIR)/inc/driver $(TOPDIR)/inc/pib $(TOPDIR)/mfgtool/clzma
|
||||
ADD_INCLUDE += $(TOPDIR)/driver/src/$(hw_dep)/inc
|
||||
@@ -188,7 +191,7 @@ ADD_LIB = clzma io_lib
|
||||
|
||||
#####################################################
|
||||
.PHONY: TARGET
|
||||
TARGET: $(TARGET_DIR)/$(OUTPUT_NAME).out ram_copy_check
|
||||
TARGET: ram_copy_check
|
||||
|
||||
ifdef TOPDIR
|
||||
include $(TOPDIR)/build/makefile.cfg
|
||||
@@ -198,7 +201,7 @@ TOPDIR = $(CURDIR)
|
||||
export TOPDIR
|
||||
endif
|
||||
|
||||
ram_copy_check:
|
||||
ram_copy_check: $(TARGET_DIR)/$(OUTPUT_NAME).out
|
||||
@mkdir -p $(TOPDIR)/tools/ram/$(RAM_TYPE)
|
||||
@cp $(OUTPUT_DIR)/$(OUTPUT_NAME).bin $(TOPDIR)/tools/ram/$(RAM_TYPE)/$(OUTPUT_NAME).bin
|
||||
@md5sum $(TOPDIR)/tools/ram/$(RAM_TYPE)/$(OUTPUT_NAME).bin | cut -d " " -f1 > $(TOPDIR)/tools/ram/$(RAM_TYPE)/$(OUTPUT_NAME).md5
|
||||
|
@@ -18,7 +18,7 @@ Information is free from patent or copyright infringement.
|
||||
#include "chip_reg_base.h"
|
||||
#include "uart.h"
|
||||
#include "uart_e.h"
|
||||
#include "sha256.h"
|
||||
#include "../inc/sha256.h"
|
||||
#include "clk.h"
|
||||
#include "gd25q32xx.h"
|
||||
#include "sfc.h"
|
||||
@@ -2353,6 +2353,7 @@ static void ramHwInit(void)
|
||||
{
|
||||
RAM_SYSCLK_SET_AS_150M();
|
||||
|
||||
// 初始化串口0
|
||||
ram_printf_init();
|
||||
|
||||
iot_delay_us(10000);
|
||||
@@ -2404,6 +2405,7 @@ void ramStart(void)
|
||||
|
||||
ramModuleInfoPrint();
|
||||
|
||||
// 擦除指定区域, layout是写死在程序中的, 需要和fw中的保持一致,所以fw中修改了layout,ram需要同步重新编译
|
||||
ram_error_no |= ramFlashEraseParam(gFlashSize);
|
||||
ram_error_no |= ramFlashEraseFw(gFlashSize);
|
||||
|
||||
|
@@ -69,6 +69,7 @@ void ram_print_config(bool_t enable)
|
||||
|
||||
int ram_printf_init(void)
|
||||
{
|
||||
// 字符串格式化函数,在rom.addrs.ld中定义
|
||||
format_str_v_fn = RAM_FORMAT_STR_V;
|
||||
p_log_ctxt = &RAM_LOG_CTXT;
|
||||
p_log_ctxt->write_str = ram_uart_printf;
|
||||
|
Reference in New Issue
Block a user