From 5f5b6a9acbd99df06b2107f671ac069bd0c79ec7 Mon Sep 17 00:00:00 2001 From: "Wenlong.Fan" Date: Fri, 29 Mar 2019 10:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9D=83=E4=BF=A1?= =?UTF-8?q?=E6=81=AF,=E5=AE=8C=E5=96=84=E4=B8=80=E4=BA=9B=E7=BB=86?= =?UTF-8?q?=E8=8A=82,=E4=BF=AE=E6=94=B9IAR=E4=B8=8D=E8=83=BD=E6=89=93?= =?UTF-8?q?=E5=8C=85=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/w60x/applications/SConscript | 4 +- bsp/w60x/applications/main.c | 2 +- bsp/w60x/drivers/board.c | 8 +- bsp/w60x/drivers/board.h | 4 +- bsp/w60x/drivers/drv_adc.c | 4 +- bsp/w60x/drivers/drv_adc.h | 4 +- bsp/w60x/drivers/drv_hw_timer.c | 4 +- bsp/w60x/drivers/drv_hw_timer.h | 4 +- bsp/w60x/drivers/drv_i2c.c | 2 +- bsp/w60x/drivers/drv_i2c.h | 2 +- bsp/w60x/drivers/drv_pin.c | 2 +- bsp/w60x/drivers/drv_pin.h | 2 +- bsp/w60x/drivers/drv_pwm.c | 4 +- bsp/w60x/drivers/drv_pwm.h | 4 +- bsp/w60x/drivers/drv_rtc.c | 2 +- bsp/w60x/drivers/drv_rtc.h | 2 +- bsp/w60x/drivers/drv_spi.c | 4 +- bsp/w60x/drivers/drv_spi.h | 4 +- bsp/w60x/drivers/drv_spiflash.c | 4 +- bsp/w60x/drivers/drv_spiflash.h | 4 +- bsp/w60x/drivers/drv_standby.c | 2 +- bsp/w60x/drivers/drv_standby.h | 2 +- bsp/w60x/drivers/drv_uart.c | 4 +- bsp/w60x/drivers/drv_uart.h | 4 +- bsp/w60x/drivers/drv_wdt.c | 6 +- bsp/w60x/drivers/drv_wifi.c | 4 +- bsp/w60x/drivers/drv_wifi.h | 4 +- bsp/w60x/drivers/pin_map.c | 4 +- bsp/w60x/drivers/pin_map.h | 4 +- bsp/w60x/makeimg.bat | 312 +++++++++++++++---------------- 30 files changed, 202 insertions(+), 214 deletions(-) diff --git a/bsp/w60x/applications/SConscript b/bsp/w60x/applications/SConscript index 01eb940dfb..a526af2c75 100644 --- a/bsp/w60x/applications/SConscript +++ b/bsp/w60x/applications/SConscript @@ -2,9 +2,9 @@ Import('RTT_ROOT') Import('rtconfig') from building import * -cwd = os.path.join(str(Dir('#')), 'applications') +cwd = GetCurrentDir() src = Glob('*.c') -CPPPATH = [cwd, str(Dir('#'))] +CPPPATH = [cwd] group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/w60x/applications/main.c b/bsp/w60x/applications/main.c index ca04e6aab9..dafcbaebac 100644 --- a/bsp/w60x/applications/main.c +++ b/bsp/w60x/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/board.c b/bsp/w60x/drivers/board.c index 01a602cb00..eedf113fa2 100644 --- a/bsp/w60x/drivers/board.c +++ b/bsp/w60x/drivers/board.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-09-15 flyingcys add w600 + * 2018-09-15 flyingcys 1st version */ #include @@ -50,25 +50,21 @@ const unsigned int HZ = RT_TICK_PER_SECOND; struct tls_ethif *tls_netif_get_ethif(void) { - rt_kprintf("===============%s %d\r\n", __FUNCTION__, __LINE__); return RT_NULL; } int tls_os_get_type(void) { - rt_kprintf("===============%s %d\r\n", __FUNCTION__, __LINE__); return 0; } err_t tls_dhcp_stop(void) { - rt_kprintf("===============%s %d\r\n", __FUNCTION__, __LINE__); return 0; } u8 tls_get_isr_count(void) { - rt_kprintf("===============%s %d\r\n", __FUNCTION__, __LINE__); return 0; } diff --git a/bsp/w60x/drivers/board.h b/bsp/w60x/drivers/board.h index a49d53e6d1..65442c0a3b 100644 --- a/bsp/w60x/drivers/board.h +++ b/bsp/w60x/drivers/board.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-09-15 flyingcys add w600 + * 2018-09-15 flyingcys 1st version */ #ifndef __BOARD_H__ diff --git a/bsp/w60x/drivers/drv_adc.c b/bsp/w60x/drivers/drv_adc.c index 0d2047d887..ea700101da 100644 --- a/bsp/w60x/drivers/drv_adc.c +++ b/bsp/w60x/drivers/drv_adc.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-23 fanwenl 1st version + * 2018-11-23 fanwenl 1st version */ #include diff --git a/bsp/w60x/drivers/drv_adc.h b/bsp/w60x/drivers/drv_adc.h index 1a59c42aed..64d383c817 100644 --- a/bsp/w60x/drivers/drv_adc.h +++ b/bsp/w60x/drivers/drv_adc.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-22 fanwenl 1st version + * 2018-11-22 fanwenl 1st version */ #ifndef __DRV_ADC_H__ diff --git a/bsp/w60x/drivers/drv_hw_timer.c b/bsp/w60x/drivers/drv_hw_timer.c index a59491c479..30ed4c04c4 100644 --- a/bsp/w60x/drivers/drv_hw_timer.c +++ b/bsp/w60x/drivers/drv_hw_timer.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-19 fanwenl 1st version + * 2018-11-19 fanwenl 1st version */ #include diff --git a/bsp/w60x/drivers/drv_hw_timer.h b/bsp/w60x/drivers/drv_hw_timer.h index e6f1dc20c8..2856b5f5e4 100644 --- a/bsp/w60x/drivers/drv_hw_timer.h +++ b/bsp/w60x/drivers/drv_hw_timer.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-19 fanwenl 1st version + * 2018-11-19 fanwenl 1st version */ #ifndef __DRV_HWTIMER_H__ diff --git a/bsp/w60x/drivers/drv_i2c.c b/bsp/w60x/drivers/drv_i2c.c index a68ea4bbb5..688f23394d 100644 --- a/bsp/w60x/drivers/drv_i2c.c +++ b/bsp/w60x/drivers/drv_i2c.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_i2c.h b/bsp/w60x/drivers/drv_i2c.h index 00cb887f83..9977f3c35b 100644 --- a/bsp/w60x/drivers/drv_i2c.h +++ b/bsp/w60x/drivers/drv_i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_pin.c b/bsp/w60x/drivers/drv_pin.c index 4e8ffe15ce..e55087c44f 100644 --- a/bsp/w60x/drivers/drv_pin.c +++ b/bsp/w60x/drivers/drv_pin.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_pin.h b/bsp/w60x/drivers/drv_pin.h index bd8fc5a11c..7cbba97fd3 100644 --- a/bsp/w60x/drivers/drv_pin.h +++ b/bsp/w60x/drivers/drv_pin.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_pwm.c b/bsp/w60x/drivers/drv_pwm.c index f1794429fb..9d73228ee2 100644 --- a/bsp/w60x/drivers/drv_pwm.c +++ b/bsp/w60x/drivers/drv_pwm.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-22 fanwenl 1st version + * 2018-11-22 fanwenl 1st version */ #include diff --git a/bsp/w60x/drivers/drv_pwm.h b/bsp/w60x/drivers/drv_pwm.h index da7f215333..a58fc0050d 100644 --- a/bsp/w60x/drivers/drv_pwm.h +++ b/bsp/w60x/drivers/drv_pwm.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-22 fanwenl 1st version + * 2018-11-22 fanwenl 1st version */ #ifndef __DRV_PWM_H__ diff --git a/bsp/w60x/drivers/drv_rtc.c b/bsp/w60x/drivers/drv_rtc.c index 8418800467..7affae875c 100644 --- a/bsp/w60x/drivers/drv_rtc.c +++ b/bsp/w60x/drivers/drv_rtc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_rtc.h b/bsp/w60x/drivers/drv_rtc.h index e3357fee76..f1c55172ff 100644 --- a/bsp/w60x/drivers/drv_rtc.h +++ b/bsp/w60x/drivers/drv_rtc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_spi.c b/bsp/w60x/drivers/drv_spi.c index 4540a508cc..88eef8b15a 100644 --- a/bsp/w60x/drivers/drv_spi.c +++ b/bsp/w60x/drivers/drv_spi.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-12 fanwenl 1st version + * 2018-11-12 fanwenl 1st version */ #include diff --git a/bsp/w60x/drivers/drv_spi.h b/bsp/w60x/drivers/drv_spi.h index 1f735d6696..e22d9d2743 100644 --- a/bsp/w60x/drivers/drv_spi.h +++ b/bsp/w60x/drivers/drv_spi.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-12 fanwenl 1st version + * 2018-11-12 fanwenl 1st version */ #ifndef __DRV_SPI_BUS_H__ diff --git a/bsp/w60x/drivers/drv_spiflash.c b/bsp/w60x/drivers/drv_spiflash.c index fd04bbda9e..51203ee894 100644 --- a/bsp/w60x/drivers/drv_spiflash.c +++ b/bsp/w60x/drivers/drv_spiflash.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-12 fanwenl 1st version + * 2018-11-12 fanwenl 1st version */ #include diff --git a/bsp/w60x/drivers/drv_spiflash.h b/bsp/w60x/drivers/drv_spiflash.h index 635c022737..602635fa96 100644 --- a/bsp/w60x/drivers/drv_spiflash.h +++ b/bsp/w60x/drivers/drv_spiflash.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-12 fanwenl 1st version + * 2018-11-12 fanwenl 1st version */ #ifndef __DRV_SPI_FLASH_H_ diff --git a/bsp/w60x/drivers/drv_standby.c b/bsp/w60x/drivers/drv_standby.c index a4858d23e4..1c3de4bc3a 100644 --- a/bsp/w60x/drivers/drv_standby.c +++ b/bsp/w60x/drivers/drv_standby.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_standby.h b/bsp/w60x/drivers/drv_standby.h index fbfa16e2db..fbcb9de290 100644 --- a/bsp/w60x/drivers/drv_standby.h +++ b/bsp/w60x/drivers/drv_standby.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_uart.c b/bsp/w60x/drivers/drv_uart.c index 18dd90a003..9cf9472447 100644 --- a/bsp/w60x/drivers/drv_uart.c +++ b/bsp/w60x/drivers/drv_uart.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-09-15 flyingcys add w600 uart drvice + * 2018-09-15 flyingcys 1st version */ #include diff --git a/bsp/w60x/drivers/drv_uart.h b/bsp/w60x/drivers/drv_uart.h index 3b2f77a954..dbf1b4b50f 100644 --- a/bsp/w60x/drivers/drv_uart.h +++ b/bsp/w60x/drivers/drv_uart.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-09-15 flyingcys add w600 uart drvice + * 2018-09-15 flyingcys 1st version */ #ifndef __DRV_UART_H__ diff --git a/bsp/w60x/drivers/drv_wdt.c b/bsp/w60x/drivers/drv_wdt.c index a19e12b43c..ded572007a 100644 --- a/bsp/w60x/drivers/drv_wdt.c +++ b/bsp/w60x/drivers/drv_wdt.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: - * Date Author Notes - * 2018-11-9 fanwenl 1st version + * Date Author Notes + * 2018-11-9 fanwenl 1st version */ #include diff --git a/bsp/w60x/drivers/drv_wifi.c b/bsp/w60x/drivers/drv_wifi.c index ebf6871d8f..b7bc9eb459 100644 --- a/bsp/w60x/drivers/drv_wifi.c +++ b/bsp/w60x/drivers/drv_wifi.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-09-15 flyingcys add w600 wifi driver + * 2018-09-15 flyingcys 1st version */ #include diff --git a/bsp/w60x/drivers/drv_wifi.h b/bsp/w60x/drivers/drv_wifi.h index 0c3cae2097..8da059fa03 100644 --- a/bsp/w60x/drivers/drv_wifi.h +++ b/bsp/w60x/drivers/drv_wifi.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-09-15 flyingcys add w600 wifi driver + * 2018-09-15 flyingcys 1st version */ #ifndef __DRV_WIFI_H__ diff --git a/bsp/w60x/drivers/pin_map.c b/bsp/w60x/drivers/pin_map.c index 8033a17262..b6e31eb75f 100644 --- a/bsp/w60x/drivers/pin_map.c +++ b/bsp/w60x/drivers/pin_map.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-21 fanwenl first version + * 2018-11-21 fanwenl first version */ #include diff --git a/bsp/w60x/drivers/pin_map.h b/bsp/w60x/drivers/pin_map.h index f21c4f16c6..9299c7d806 100644 --- a/bsp/w60x/drivers/pin_map.h +++ b/bsp/w60x/drivers/pin_map.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018-11-21 fanwenl first version + * 2018-11-21 fanwenl first version */ #ifndef __PIN_MAP_H__ diff --git a/bsp/w60x/makeimg.bat b/bsp/w60x/makeimg.bat index ade6439350..26cce9c219 100644 --- a/bsp/w60x/makeimg.bat +++ b/bsp/w60x/makeimg.bat @@ -1,160 +1,152 @@ -@rem 参数0: exe -@rem 参数1: 输入bin文件 ,原始文件或者压缩档文件 -@rem 参数2: 输出文件(目标生成文件) -@rem 参数3: 输入文件类型,0是旧参数布局的image文件,3是新参数布局的image文件 -@rem 参数4: 是否压缩文件:0:plain文件,1:压缩类型文件 -@rem 参数5: 版本号文件 -@rem 参数6:升级文件再FLASH里的存放位置(相对位置) -@rem 参数7:升级后的文件启动位置(相对位置) -@rem 参数8:原始bin文件 - -@echo off - -@rem if debug_info=1, Debugging Print Information will be turned on -set debug_info=0 -@rem if make_fal=1, Partition tables are put into firmware -set make_fal=0 -@rem Setting firmware output directory -set out_path=.\Bin -@rem Setting the bin file path -set bin_file=.\rtthread.bin -@rem Setting winnermicro libraries path -set wmlib_path=.\packages\wm_libraries- -@rem Setting the 1M flash layout file -set layout_1M_file=. -@rem Setting the 2M flash layout file -set layout_2M_file=. -@rem Setting the makeimg by adding rtt flash original fls -set makeimg_new_fls=. - -@rem find winnermicro libraries full path -for /f "delims=" %%i in ('dir /ad /b /s %wmlib_path%*') do (set wmlib_path_full=%%i) -@rem Setting the version.txt file path -set version_file=%wmlib_path_full%\Tools\version.txt -@rem Setting the secboot.img file path -set secboot_file=%wmlib_path_full%\Tools\secboot.img -@rem Setting the wm_gzip.exe file path -set wm_gzip_file=%wmlib_path_full%\Tools\wm_gzip.exe -@rem Setting the makeimg.exe file path -set makeimg_file=%wmlib_path_full%\Tools\makeimg.exe -@rem Setting the makeimg_all.exe file path -set makeimg_all_file=%wmlib_path_full%\Tools\makeimg_all.exe - -@rem Prepare to generate firmware - -@rem Get the full path -if "%out_path:~0,1%" == "." (set out_path=%~dp0%out_path%) -if "%bin_file:~0,1%" == "." (set bin_file=%~dp0%bin_file%) - -@rem Create output folder -if not exist "%out_path%" (md "%out_path%") - -@rem Copy the required files -if exist "%bin_file%" (copy "%bin_file%" "%out_path%") else (echo makeimg err! No bin file found: %bin_file% & goto end) -if exist "%version_file%" (copy "%version_file%" "%out_path%") else (echo makeimg err! No version file found: %version_file% & goto end) -if exist "%secboot_file%" (copy "%secboot_file%" "%out_path%") else (echo makeimg err! No secboot file found: %secboot_file% & goto end) - -@rem Check the existence of firmware generation tools -if not exist "%wm_gzip_file%" (echo makeimg err! No wm_gzip file found: "%wm_gzip_file%" & goto end) -if not exist "%makeimg_file%" (echo makeimg err! No makeimg file found: "%makeimg_file%" & goto end) -if not exist "%makeimg_all_file%" (echo makeimg err! No makeimg_all file found: "%makeimg_all_file%" & goto end) - -@rem Get File Names and File Extensions -for /f "delims=" %%A in ('dir /b %bin_file%') do set "bin_file_name=%%A" -for /f "delims=." %%A in ('dir /b %bin_file%') do set bin_name=%%A -for /f "delims=%bin_name%" %%A in ('dir /b %bin_file%') do set bin_extend=%%A -for /f "delims=" %%A in ('dir /b %version_file%') do set "version_file_name=%%A" -for /f "delims=" %%A in ('dir /b %secboot_file%') do set "secboot_file_name=%%A" - -@rem Print Debug Information -if not "%debug_info%"=="0" (echo bin_file_name:%bin_file_name% & echo bin_name:%bin_name% & echo bin_extend:%bin_extend% & echo version_file_name:%version_file_name% & echo secboot_file_name:%secboot_file_name%) - -echo makeimg 1M Flash... - -@rem Start making 1M flash firmware -set file_pos_1M=_1M - -@rem Create command parameters -set wm_gzip_cmd="%out_path%\%bin_file_name%" -set makeimg_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%%file_pos_1M%.img" 0 0 "%out_path%\%version_file_name%" 90000 10100 -set makeimg_gz_img_cmd="%out_path%\%bin_file_name%.gz" "%out_path%\%bin_name%_GZ%file_pos_1M%.img" 0 1 "%out_path%\%version_file_name%" 90000 10100 "%out_path%\%bin_file_name%" -set makeimg_sec_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%_SEC%file_pos_1M%.img" 0 0 "%out_path%\%version_file_name%" 90000 10100 -set makeimg_all_cmd="%out_path%\%secboot_file_name%" "%out_path%\%bin_name%%file_pos_1M%.img" "%out_path%\%bin_name%%file_pos_1M%.FLS" - -@rem Print command Information -if not "%debug_info%"=="0" (echo wm_gzip %wm_gzip_cmd%) -if not "%debug_info%"=="0" (echo makeimg %makeimg_img_cmd%) -if not "%debug_info%"=="0" (echo makeimg %makeimg_gz_img_cmd%) -if not "%debug_info%"=="0" (echo makeimg %makeimg_sec_img_cmd%) -if not "%debug_info%"=="0" (echo makeimg_all %makeimg_all_cmd%) - -@rem Execute firmware generation commands -"%wm_gzip_file%" %wm_gzip_cmd% -"%makeimg_file%" %makeimg_img_cmd% -"%makeimg_file%" %makeimg_gz_img_cmd% -"%makeimg_file%" %makeimg_sec_img_cmd% -"%makeimg_all_file%" %makeimg_all_cmd% - -@rem Delete temporary files -if exist "%out_path%\%bin_name%%file_pos_1M%.img" (del "%out_path%\%bin_name%%file_pos_1M%.img") -if exist "%out_path%\%bin_file_name%.gz" (del "%out_path%\%bin_file_name%.gz") - -@rem Start making 2M flash firmware -echo makeimg 2M Flash... - -set file_pos_2M=_2M - -@rem Create command parameters -set wm_gzip_cmd="%out_path%\%bin_file_name%" -set makeimg_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%%file_pos_2M%.img" 3 0 "%out_path%\%version_file_name%" 100000 10100 -set makeimg_gz_img_cmd="%out_path%\%bin_file_name%.gz" "%out_path%\%bin_name%_GZ%file_pos_2M%.img" 3 1 "%out_path%\%version_file_name%" 100000 10100 "%out_path%\%bin_file_name%" -set makeimg_sec_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%_SEC%file_pos_2M%.img" 3 0 "%out_path%\%version_file_name%" 100000 10100 -set makeimg_all_cmd="%out_path%\%secboot_file_name%" "%out_path%\%bin_name%%file_pos_2M%.img" "%out_path%\%bin_name%%file_pos_2M%.FLS" - -@rem Print command Information -if not "%debug_info%"=="0" (echo wm_gzip %wm_gzip_cmd%) -if not "%debug_info%"=="0" (echo makeimg %makeimg_img_cmd%) -if not "%debug_info%"=="0" (echo makeimg %makeimg_gz_img_cmd%) -if not "%debug_info%"=="0" (echo makeimg %makeimg_sec_img_cmd%) -if not "%debug_info%"=="0" (echo makeimg_all %makeimg_all_cmd%) - -@rem Execute firmware generation commands -"%wm_gzip_file%" %wm_gzip_cmd% -"%makeimg_file%" %makeimg_img_cmd% -"%makeimg_file%" %makeimg_gz_img_cmd% -"%makeimg_file%" %makeimg_sec_img_cmd% -"%makeimg_all_file%" %makeimg_all_cmd% - -@rem Delete temporary files -if exist "%out_path%\%bin_name%%file_pos_2M%.img" (del "%out_path%\%bin_name%%file_pos_2M%.img") -if exist "%out_path%\%bin_file_name%.gz" (del "%out_path%\%bin_file_name%.gz") - -@rem Partition tables are put into firmware -if not "%make_fal%"=="1" ( goto end) - -@rem Get the full path -if "%layout_1M_file:~0,1%" == "." (set layout_1M_file=%~dp0%layout_1M_file%) -if "%layout_2M_file:~0,1%" == "." (set layout_2M_file=%~dp0%layout_2M_file%) -if "%makeimg_new_fls:~0,1%" == "." (set makeimg_new_fls=%~dp0%makeimg_new_fls%) - -@rem Check whether the file exists -if not exist "%layout_1M_file%" (echo makeimg err! No makeimg file found: "%layout_1M_file%" & goto end) -if not exist "%layout_2M_file%" (echo makeimg err! No makeimg file found: "%layout_2M_file%" & goto end) -if not exist "%makeimg_new_fls%" (echo makeimg err! No makeimg file found: "%makeimg_new_fls%" & goto end) - -@rem Create command parameters to new fls -set makeimg_new_cmd_1M="%out_path%\%bin_name%%file_pos_1M%.FLS" "%layout_1M_file%" "%out_path%\%bin_name%_layout%file_pos_1M%.FLS" -@rem Execute generation fls cmd -"%makeimg_new_fls%" %makeimg_new_cmd_1M% - -@rem Create command parameters to new fls -set makeimg_new_cmd_2M="%out_path%\%bin_name%%file_pos_2M%.FLS" "%layout_2M_file%" "%out_path%\%bin_name%_layout%file_pos_2M%.FLS" -@rem Execute generation fls cmd -"%makeimg_new_fls%" %makeimg_new_cmd_2M% - -@rem Delete temporary files -if exist "%out_path%\%bin_name%_1M.FLS" (del "%out_path%\%bin_name%%file_pos_1M%.FLS") -if exist "%out_path%\%bin_name%_2M.FLS" (del "%out_path%\%bin_name%%file_pos_2M%.FLS") - -:end -echo end +@echo off + +@rem if debug_info=1, Debugging Print Information will be turned on +set debug_info=0 +@rem if make_fal=1, Partition tables are put into firmware +set make_fal=0 +@rem Setting firmware output directory +set out_path=.\Bin +@rem Setting the bin file path +set bin_file=.\rtthread.bin +@rem Setting winnermicro libraries path +set wmlib_path=.\packages\wm_libraries- +@rem Setting the 1M flash layout file +set layout_1M_file=. +@rem Setting the 2M flash layout file +set layout_2M_file=. +@rem Setting the makeimg by adding rtt flash original fls +set makeimg_new_fls=. + +if "%wmlib_path:~0,1%" == "." (set wmlib_path=%~dp0%wmlib_path%) +@rem find winnermicro libraries full path +for /f "delims=" %%i in ('dir /ad /b /s %wmlib_path%*') do (set wmlib_path_full=%%i) +@rem Setting the version.txt file path +set version_file=%wmlib_path_full%\Tools\version.txt +@rem Setting the secboot.img file path +set secboot_file=%wmlib_path_full%\Tools\secboot.img +@rem Setting the wm_gzip.exe file path +set wm_gzip_file=%wmlib_path_full%\Tools\wm_gzip.exe +@rem Setting the makeimg.exe file path +set makeimg_file=%wmlib_path_full%\Tools\makeimg.exe +@rem Setting the makeimg_all.exe file path +set makeimg_all_file=%wmlib_path_full%\Tools\makeimg_all.exe + +@rem Prepare to generate firmware + +@rem Get the full path +if "%out_path:~0,1%" == "." (set out_path=%~dp0%out_path%) +if "%bin_file:~0,1%" == "." (set bin_file=%~dp0%bin_file%) + +@rem Create output folder +if not exist "%out_path%" (md "%out_path%") + +@rem Copy the required files +if exist "%bin_file%" (copy "%bin_file%" "%out_path%") else (echo makeimg err! No bin file found: %bin_file% & goto end) +if exist "%version_file%" (copy "%version_file%" "%out_path%") else (echo makeimg err! No version file found: %version_file% & goto end) +if exist "%secboot_file%" (copy "%secboot_file%" "%out_path%") else (echo makeimg err! No secboot file found: %secboot_file% & goto end) + +@rem Check the existence of firmware generation tools +if not exist "%wm_gzip_file%" (echo makeimg err! No wm_gzip file found: "%wm_gzip_file%" & goto end) +if not exist "%makeimg_file%" (echo makeimg err! No makeimg file found: "%makeimg_file%" & goto end) +if not exist "%makeimg_all_file%" (echo makeimg err! No makeimg_all file found: "%makeimg_all_file%" & goto end) + +@rem Get File Names and File Extensions +for /f "delims=" %%A in ('dir /b %bin_file%') do set "bin_file_name=%%A" +for /f "delims=." %%A in ('dir /b %bin_file%') do set bin_name=%%A +for /f "delims=%bin_name%" %%A in ('dir /b %bin_file%') do set bin_extend=%%A +for /f "delims=" %%A in ('dir /b %version_file%') do set "version_file_name=%%A" +for /f "delims=" %%A in ('dir /b %secboot_file%') do set "secboot_file_name=%%A" + +@rem Print Debug Information +if not "%debug_info%"=="0" (echo bin_file_name:%bin_file_name% & echo bin_name:%bin_name% & echo bin_extend:%bin_extend% & echo version_file_name:%version_file_name% & echo secboot_file_name:%secboot_file_name%) + +echo makeimg 1M Flash... + +@rem Start making 1M flash firmware +set file_pos_1M=_1M + +@rem Create command parameters +set wm_gzip_cmd="%out_path%\%bin_file_name%" +set makeimg_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%%file_pos_1M%.img" 0 0 "%out_path%\%version_file_name%" 90000 10100 +set makeimg_gz_img_cmd="%out_path%\%bin_file_name%.gz" "%out_path%\%bin_name%_GZ%file_pos_1M%.img" 0 1 "%out_path%\%version_file_name%" 90000 10100 "%out_path%\%bin_file_name%" +set makeimg_sec_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%_SEC%file_pos_1M%.img" 0 0 "%out_path%\%version_file_name%" 90000 10100 +set makeimg_all_cmd="%out_path%\%secboot_file_name%" "%out_path%\%bin_name%%file_pos_1M%.img" "%out_path%\%bin_name%%file_pos_1M%.FLS" + +@rem Print command Information +if not "%debug_info%"=="0" (echo wm_gzip %wm_gzip_cmd%) +if not "%debug_info%"=="0" (echo makeimg %makeimg_img_cmd%) +if not "%debug_info%"=="0" (echo makeimg %makeimg_gz_img_cmd%) +if not "%debug_info%"=="0" (echo makeimg %makeimg_sec_img_cmd%) +if not "%debug_info%"=="0" (echo makeimg_all %makeimg_all_cmd%) + +@rem Execute firmware generation commands +"%wm_gzip_file%" %wm_gzip_cmd% +"%makeimg_file%" %makeimg_img_cmd% +"%makeimg_file%" %makeimg_gz_img_cmd% +"%makeimg_file%" %makeimg_sec_img_cmd% +"%makeimg_all_file%" %makeimg_all_cmd% + +@rem Delete temporary files +if exist "%out_path%\%bin_name%%file_pos_1M%.img" (del "%out_path%\%bin_name%%file_pos_1M%.img") +if exist "%out_path%\%bin_file_name%.gz" (del "%out_path%\%bin_file_name%.gz") + +@rem Start making 2M flash firmware +echo makeimg 2M Flash... + +set file_pos_2M=_2M + +@rem Create command parameters +set wm_gzip_cmd="%out_path%\%bin_file_name%" +set makeimg_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%%file_pos_2M%.img" 3 0 "%out_path%\%version_file_name%" 100000 10100 +set makeimg_gz_img_cmd="%out_path%\%bin_file_name%.gz" "%out_path%\%bin_name%_GZ%file_pos_2M%.img" 3 1 "%out_path%\%version_file_name%" 100000 10100 "%out_path%\%bin_file_name%" +set makeimg_sec_img_cmd="%out_path%\%bin_file_name%" "%out_path%\%bin_name%_SEC%file_pos_2M%.img" 3 0 "%out_path%\%version_file_name%" 100000 10100 +set makeimg_all_cmd="%out_path%\%secboot_file_name%" "%out_path%\%bin_name%%file_pos_2M%.img" "%out_path%\%bin_name%%file_pos_2M%.FLS" + +@rem Print command Information +if not "%debug_info%"=="0" (echo wm_gzip %wm_gzip_cmd%) +if not "%debug_info%"=="0" (echo makeimg %makeimg_img_cmd%) +if not "%debug_info%"=="0" (echo makeimg %makeimg_gz_img_cmd%) +if not "%debug_info%"=="0" (echo makeimg %makeimg_sec_img_cmd%) +if not "%debug_info%"=="0" (echo makeimg_all %makeimg_all_cmd%) + +@rem Execute firmware generation commands +"%wm_gzip_file%" %wm_gzip_cmd% +"%makeimg_file%" %makeimg_img_cmd% +"%makeimg_file%" %makeimg_gz_img_cmd% +"%makeimg_file%" %makeimg_sec_img_cmd% +"%makeimg_all_file%" %makeimg_all_cmd% + +@rem Delete temporary files +if exist "%out_path%\%bin_name%%file_pos_2M%.img" (del "%out_path%\%bin_name%%file_pos_2M%.img") +if exist "%out_path%\%bin_file_name%.gz" (del "%out_path%\%bin_file_name%.gz") + +@rem Partition tables are put into firmware +if not "%make_fal%"=="1" ( goto end) + +@rem Get the full path +if "%layout_1M_file:~0,1%" == "." (set layout_1M_file=%~dp0%layout_1M_file%) +if "%layout_2M_file:~0,1%" == "." (set layout_2M_file=%~dp0%layout_2M_file%) +if "%makeimg_new_fls:~0,1%" == "." (set makeimg_new_fls=%~dp0%makeimg_new_fls%) + +@rem Check whether the file exists +if not exist "%layout_1M_file%" (echo makeimg err! No makeimg file found: "%layout_1M_file%" & goto end) +if not exist "%layout_2M_file%" (echo makeimg err! No makeimg file found: "%layout_2M_file%" & goto end) +if not exist "%makeimg_new_fls%" (echo makeimg err! No makeimg file found: "%makeimg_new_fls%" & goto end) + +@rem Create command parameters to new fls +set makeimg_new_cmd_1M="%out_path%\%bin_name%%file_pos_1M%.FLS" "%layout_1M_file%" "%out_path%\%bin_name%_layout%file_pos_1M%.FLS" +@rem Execute generation fls cmd +"%makeimg_new_fls%" %makeimg_new_cmd_1M% + +@rem Create command parameters to new fls +set makeimg_new_cmd_2M="%out_path%\%bin_name%%file_pos_2M%.FLS" "%layout_2M_file%" "%out_path%\%bin_name%_layout%file_pos_2M%.FLS" +@rem Execute generation fls cmd +"%makeimg_new_fls%" %makeimg_new_cmd_2M% + +@rem Delete temporary files +if exist "%out_path%\%bin_name%_1M.FLS" (del "%out_path%\%bin_name%%file_pos_1M%.FLS") +if exist "%out_path%\%bin_name%_2M.FLS" (del "%out_path%\%bin_name%%file_pos_2M%.FLS") + +:end +echo end +