diff --git a/USDK/component/soc/realtek/8195a/fwlib/ram_lib/rtl_boot.c b/USDK/component/soc/realtek/8195a/fwlib/ram_lib/rtl_boot.c index 76f5fb8..0f6dc56 100644 --- a/USDK/component/soc/realtek/8195a/fwlib/ram_lib/rtl_boot.c +++ b/USDK/component/soc/realtek/8195a/fwlib/ram_lib/rtl_boot.c @@ -559,14 +559,14 @@ LOCAL uint32 BOOT_RAM_TEXT_SECTION load_segs(uint32 faddr, PIMG2HEAD hdr, uint8 || seg_id == SEG_ID_SDRAM)) { #if CONFIG_DEBUG_LOG > 1 DBG_8195A("Load Flash seg%d: 0x%08x -> %s: 0x%08x, size: %d\n", - segnum, faddr, txt_tab_seg[seg_id], hdr->seg.ldaddr, + segnum, fnextaddr, txt_tab_seg[seg_id], hdr->seg.ldaddr, hdr->seg.size); #endif fnextaddr += flashcpy(fnextaddr, (void *)hdr->seg.ldaddr, hdr->seg.size); } else if (seg_id) { #if CONFIG_DEBUG_LOG > 2 DBG_8195A("Skip Flash seg%d: 0x%08x -> %s: 0x%08x, size: %d\n", segnum, - faddr, txt_tab_seg[seg_id], hdr->seg.ldaddr, hdr->seg.size); + fnextaddr, txt_tab_seg[seg_id], hdr->seg.ldaddr, hdr->seg.size); #endif fnextaddr += hdr->seg.size; } else { @@ -574,7 +574,7 @@ LOCAL uint32 BOOT_RAM_TEXT_SECTION load_segs(uint32 faddr, PIMG2HEAD hdr, uint8 fnextaddr -= 8; break; } - fnextaddr += flashcpy(fnextaddr, hdr, sizeof(IMGSEGHEAD)) + 8; + fnextaddr += flashcpy(fnextaddr, hdr, sizeof(IMGSEGHEAD)); segnum++; } return fnextaddr; @@ -590,6 +590,7 @@ LOCAL int BOOT_RAM_TEXT_SECTION loadUserImges(int imgnum) { DBG_8195A("Selected Image %d.\n", imgnum); while (1) { + // новая image только с нового сектора flash faddr = (faddr + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1)); uint32 img_id = load_img2_head(faddr, &hdr); if ((img_id >> 8) > 4 && (uint8) img_id != 0) { // есть подпись "RTKW" + RUN или SWP, сегмент != unknown @@ -603,7 +604,7 @@ LOCAL int BOOT_RAM_TEXT_SECTION loadUserImges(int imgnum) { DBG_8195A("No Image%d! Trying Image0...\n", imgnum); // пробуем загрузить image по умолчанию, по записи в секторе установок flashcpy(FLASH_SYSTEM_DATA_ADDR, &faddr, sizeof(faddr)); - if (faddr < 0x8000000) + if (faddr < 0x08000000) faddr += SPI_FLASH_BASE; if (get_seg_id(faddr, 0x100) == SEG_ID_FLASH) { // если указывает в область flash diff --git a/USDK/component/soc/realtek/8195a/misc/iar_utility/common/tools/rtlaimage.exe b/USDK/component/soc/realtek/8195a/misc/iar_utility/common/tools/rtlaimage.exe index 8136730..686ba47 100644 Binary files a/USDK/component/soc/realtek/8195a/misc/iar_utility/common/tools/rtlaimage.exe and b/USDK/component/soc/realtek/8195a/misc/iar_utility/common/tools/rtlaimage.exe differ diff --git a/USDK/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_libgloss_retarget.c b/USDK/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_libgloss_retarget.c index 40d3175..90a7d97 100644 --- a/USDK/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_libgloss_retarget.c +++ b/USDK/component/soc/realtek/8195a/misc/rtl_std_lib/lib_rtlstd/ram_libgloss_retarget.c @@ -97,9 +97,9 @@ int ram_libgloss_write(int file, const char *ptr, int len) { //----- ram_libgloss_open() int ram_libgloss_open(char *file, int flags, int mode) { // file->_p - int result = rtl_strcmp(file, "/stdin"); + int result; - if (result) { + if (rtl_strcmp(file, "/stdin")) { if (rtl_strcmp(file, "/stdout")) { if (rtl_strcmp(file, "/stderr")) result = -1; diff --git a/project/src/console/wifi_console.c b/project/src/console/wifi_console.c index db33702..9ae9b14 100644 --- a/project/src/console/wifi_console.c +++ b/project/src/console/wifi_console.c @@ -350,4 +350,3 @@ MON_RAM_TAB_SECTION COMMAND_TABLE console_cmd_wifi_api[] = { {"ATSN", 0, fATSN, ": Scan networks"} }; - diff --git a/tools/rtlaimage/rtlaimage.py b/tools/rtlaimage/rtlaimage.py index da81ce5..dec78c8 100644 --- a/tools/rtlaimage/rtlaimage.py +++ b/tools/rtlaimage/rtlaimage.py @@ -10,7 +10,7 @@ import os import struct import sys -__version__ = "20.01.18" +__version__ = "22.01.18" PYTHON2 = sys.version_info[0] < 3 # True if on pre-Python 3 @@ -295,7 +295,7 @@ def elf2image(args): for s in image: if s.hm & HM_IS_OTA: chks = s.save_ota(f, fn, chks) - f.write(struct.pack('