diff --git a/build/build_time_cost_test.py b/build/build_time_cost_test.py index 8d124ec..4ad2329 100755 --- a/build/build_time_cost_test.py +++ b/build/build_time_cost_test.py @@ -13,12 +13,12 @@ if __name__ == "__main__": cmd=f"{' '.join(sys.argv[1:])} > build_log.log" if not ('not_clean' in sys.argv[1:]): os.system("python3 ../clear_output.py > /dev/null") - try: - os.remove("../make_flags.txt") - os.remove("../python_script_log.log") - except Exception as e: - print(e) - # os.system("python3 ../praper_vscode.py clear >> ../python_script_log.log") + try: + os.remove("../make_flags.txt") + os.remove("../python_script_log.log") + except Exception as e: + print(e) + os.system("python3 ../praper_vscode.py clear >> ../python_script_log.log") path="../tools/gen_img/customer" if os.path.exists(path): shutil.rmtree(path) diff --git a/common/os_shim/freertos/src/os_malloc.c b/common/os_shim/freertos/src/os_malloc.c index 7f11de6..c5ba964 100755 --- a/common/os_shim/freertos/src/os_malloc.c +++ b/common/os_shim/freertos/src/os_malloc.c @@ -51,9 +51,12 @@ void *os_mem_malloc(module_id_t module_id, size_t size) #endif { (void)module_id; // avoid warning. to be fixed. - void *buf = pvPortMalloc(size); #if IOT_OS_MALLOC_DEBUG - iot_printf("%s:%d malloc.\n", file, line); + iot_printf("os_mem_malloc: size=%d\n", size); +#endif + void* buf = pvPortMalloc(size); +#if IOT_OS_MALLOC_DEBUG + iot_printf("%s:%d malloc. p=%p\n", file, line, buf); #endif if (buf) { os_mem_set(buf, 0, size); diff --git a/driver/src/hw3/inc/hw_mem_map.h b/driver/src/hw3/inc/hw_mem_map.h index 36a683d..3dcf956 100644 --- a/driver/src/hw3/inc/hw_mem_map.h +++ b/driver/src/hw3/inc/hw_mem_map.h @@ -24,6 +24,7 @@ extern unsigned int _heap_start; #define MEM_MAP_PART_0_ADDR ((int)&_heap_start) #define MEM_MAP_PART_0_LENTH ((size_t)((unsigned char *)&_heap_end - \ (unsigned char*)&_heap_start)) +#define OS_DUMP_START ((int)&_heap_end) #if (IOT_STA_CONTROL_MODE == IOT_STA_CONTROL_TYPE_STA) @@ -31,8 +32,24 @@ extern unsigned int _heap_start; #else /* (IOT_STA_CONTROL_MODE == IOT_STA_CONTROL_TYPE_STA) */ +#if (IOT_MP_SUPPORT == 0) + +#if RUN_IN_PSRAM + +#define MEM_MAP_RESERVED_BUF_SZ (300 * 1024) + +#else /* RUN_IN_PSRAM */ + +#define MEM_MAP_RESERVED_BUF_SZ (128 * 1024) + +#endif /* RUN_IN_PSRAM */ + +#else /* IOT_MP_SUPPORT == 0 */ + #define MEM_MAP_RESERVED_BUF_SZ (64 * 1024) +#endif /* IOT_MP_SUPPORT == 0 */ + #endif /* (IOT_STA_CONTROL_MODE == IOT_STA_CONTROL_TYPE_STA) */ #if (RUN_IN_PSRAM) @@ -108,7 +125,6 @@ extern unsigned int _heap_start; MEM_MAP_PART_1_ADDR, MEM_MAP_PART_1_LENTH, \ MEM_MAP_PART_2_ADDR, MEM_MAP_PART_2_LENTH, \ MEM_MAP_PART_3_ADDR, MEM_MAP_PART_3_LENTH} - #else /* (BUILD_AMP_TYPE == IOT_BUILD_AMP_NONE) */ #define MEM_MAP_PART_1_ADDR (0x70000000) diff --git a/dtest/dtest3/mac_phy/double_cpu/kl3_core1/Makefile b/dtest/dtest3/mac_phy/double_cpu/kl3_core1/Makefile index 5290d85..7af223a 100644 --- a/dtest/dtest3/mac_phy/double_cpu/kl3_core1/Makefile +++ b/dtest/dtest3/mac_phy/double_cpu/kl3_core1/Makefile @@ -52,7 +52,7 @@ ADD_LIB += os driver common rf_mac .PHONY: TARGET TARGET: .output/plc/lib/kl3_core1.out @echo "const char plc_core1[] = {" > plc_core1.h - @./bin2hex_frame ../kl3_core1/.output/plc/lib/kl3_core1.bin tmp.txt + @./bin2hex_frame ../kl3_core1/.output/plc/lib/kl3_core1.bin tmp.txt > /dev/null @cat tmp.txt >> plc_core1.h @echo "};" >> plc_core1.h @mv plc_core1.h ../kl3_core0 diff --git a/export/inc/bsp/iot_board_api.h b/export/inc/bsp/iot_board_api.h index a694f2b..6ce9f25 100644 --- a/export/inc/bsp/iot_board_api.h +++ b/export/inc/bsp/iot_board_api.h @@ -41,7 +41,7 @@ extern "C" { #define GPIO_RS485_TXE 7 #define GPIO_IR_TXD 8 #define GPIO_IR_RXD 9 -#define GPIO_GEODE_OVT 10 +#define GPIO_GEODE_OVT 10 // 外部pa的gpio中断 #define GPIO_SMART_BOOT_SEL 11 #define GPIO_PM_CHARGE_EN 12 #define GPIO_RST_CTRL 13 diff --git a/export/inc/config/plc_config_api.h b/export/inc/config/plc_config_api.h index cafc232..4cae0dc 100644 --- a/export/inc/config/plc_config_api.h +++ b/export/inc/config/plc_config_api.h @@ -85,7 +85,7 @@ extern "C" { #if ((TARGET_VERSION == TARGET_KUNLUN3) && !SUPPORT_SOUTHERN_POWER_GRID) /* #define number of nodes supported in the PLC network must be (n * 8 - 1) */ -#define PLC_NETWORK_SCALE 2039 +#define PLC_NETWORK_SCALE 1535 #else /* (TARGET_VERSION == TARGET_KUNLUN3) */ diff --git a/export/inc/iot_config_api.h b/export/inc/iot_config_api.h index 59152b0..15e886e 100755 --- a/export/inc/iot_config_api.h +++ b/export/inc/iot_config_api.h @@ -40,7 +40,8 @@ extern "C" { #define TARGET_KUNLUN3 3 #ifndef TARGET_VERSION -#define TARGET_VERSION TARGET_KUNLUN +#define TARGET_VERSION 5 +#error "please define TARGET_VERSION in Makefile" #endif /* production line defination, plc by default */ diff --git a/os/freertos/src/portable/MemMang/heap_5/heap_5.c b/os/freertos/src/portable/MemMang/heap_5/heap_5.c index d6df62f..bdb75f2 100755 --- a/os/freertos/src/portable/MemMang/heap_5/heap_5.c +++ b/os/freertos/src/portable/MemMang/heap_5/heap_5.c @@ -233,13 +233,13 @@ void heap_alloc_caps_init(unsigned int reserved_sz); void *pvPortMallocTagged( size_t xWantedSize, BaseType_t tag ) { -BlockLink_tag_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink; -void *pvReturn = NULL; + BlockLink_tag_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink; + void *pvReturn = NULL; /* The heap must be initialised before the first call to prvPortMalloc(). */ //configASSERT( tagpxEnd ); - + // 这里实际分配内存 vTaskSuspendAll(); { if (NULL == tagpxEnd) { @@ -274,7 +274,8 @@ void *pvReturn = NULL; one of adequate size is found. */ pxPreviousBlock = &tagxStart; pxBlock = tagxStart.pxNextFreeBlock; - while( ( ( pxBlock->xTag != tag ) || ( pxBlock->xBlockSize < xWantedSize ) ) && ( pxBlock->pxNextFreeBlock != NULL ) ) + // 从第一个内存池开始 找到一个能够分配指定内存大小的内存池 + while (((pxBlock->xTag != tag) || (pxBlock->xBlockSize < xWantedSize)) && (pxBlock->pxNextFreeBlock != NULL)) { pxPreviousBlock = pxBlock; pxBlock = pxBlock->pxNextFreeBlock;