70 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
		
		
			
		
	
	
			70 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
|  | #!/bin/sh
 | ||
|  | 
 | ||
|  | cd build/ | ||
|  | ./build_kl2_flash_ai.sh | ||
|  | cd - | ||
|  | source build/env_flash_ai_kl2.sh | ||
|  | make dtest | ||
|  | 
 | ||
|  | OUTPUT_SDK=./output_sdk | ||
|  | 
 | ||
|  | mkdir ${OUTPUT_SDK} | ||
|  | 
 | ||
|  | mkdir ${OUTPUT_SDK}/bin | ||
|  | mkdir ${OUTPUT_SDK}/bin/ai | ||
|  | mkdir ${OUTPUT_SDK}/cmake | ||
|  | mkdir ${OUTPUT_SDK}/examples | ||
|  | mkdir ${OUTPUT_SDK}/ld | ||
|  | mkdir ${OUTPUT_SDK}/tools | ||
|  | 
 | ||
|  | # cp xxx.bin | ||
|  | cp ./tools/gen_img/customer/2M/kl2/ai/out/KL2AI01_OEM.bin ${OUTPUT_SDK}/bin/ai/oem.bin | ||
|  | cp ./tools/gen_img/customer/2M/kl2/ai/out/KL2AI01_PIB.bin ${OUTPUT_SDK}/bin/ai/pib.bin | ||
|  | cp ./tools/gen_img/customer/2M/kl2/ai/out/kl_ram.bin ${OUTPUT_SDK}/bin/ai/ram.bin | ||
|  | cp ./tools/gen_img/customer/2M/kl2/ai/out/kunlun_sbl.bin ${OUTPUT_SDK}/bin/ai/sbl.bin | ||
|  | cp ./tools/gen_img/customer/2M/kl2/ai/out/sp_fw.bin ${OUTPUT_SDK}/bin/ai/sp.bin | ||
|  | 
 | ||
|  | # cp lib inc tool | ||
|  | cp ./export/* ${OUTPUT_SDK}/ -r | ||
|  | cp ./tools/gen_img/ah ${OUTPUT_SDK}/tools/ | ||
|  | cp ./tools/gen_img/elzma ${OUTPUT_SDK}/tools/ | ||
|  | cp ./tools/kl2_gdbinit ${OUTPUT_SDK}/tools/ | ||
|  | cp ./tools/ftdi_openocd.cfg ${OUTPUT_SDK}/tools/ | ||
|  | cp ./dtest/download_file_test/.output/lib/download_file_test.out ${OUTPUT_SDK}/tools/ | ||
|  | cp ./dtest/ddr_training_test/.output/lib/ddr_training_test.out ${OUTPUT_SDK}/tools/ | ||
|  | 
 | ||
|  | # cp fatfs include file | ||
|  | mkdir ${OUTPUT_SDK}/inc/fatfs | ||
|  | cp ./import/fatfs/inc/ff.h ${OUTPUT_SDK}/inc/fatfs/ | ||
|  | cp ./import/fatfs/inc/ffconf.h ${OUTPUT_SDK}/inc/fatfs/ | ||
|  | cp ./import/fatfs/inc/integer.h ${OUTPUT_SDK}/inc/fatfs/ | ||
|  | 
 | ||
|  | rm ${OUTPUT_SDK}/lib/* | ||
|  | cp ./export/lib/libht_ai.a ./export/lib/README ${OUTPUT_SDK}/lib/ | ||
|  | 
 | ||
|  | # cp ld | ||
|  | cp ./startup/ldscripts/riscv2/link_ai_32m.lds ${OUTPUT_SDK}/ld/link.lds | ||
|  | cp ./startup/ldscripts/riscv2/link_cpu0.lds ${OUTPUT_SDK}/ld/ | ||
|  | cp ./startup/ldscripts/riscv2/link_cpu2.lds ${OUTPUT_SDK}/ld/ | ||
|  | 
 | ||
|  | # cp sdk | ||
|  | cp ../SDKCmake/cmake/riscv64.toolchain.cmake  ${OUTPUT_SDK}/cmake/ | ||
|  | cp ../SDKCmake/iot_kl2_sample_app/iot_cpp_app  ${OUTPUT_SDK}/examples/ -r | ||
|  | cp ./app/cpp_demo ${OUTPUT_SDK}/examples/iot_cpp_app/ -r | ||
|  | 
 | ||
|  | # cp app | ||
|  | # cpp app | ||
|  | cp ../SDKCmake/iot_kl2_sample_app/iot_cpp_app  ${OUTPUT_SDK}/examples/ -r | ||
|  | # c app | ||
|  | cp ../SDKCmake/iot_kl2_sample_app/iot_test_app  ${OUTPUT_SDK}/examples/ -r | ||
|  | # amp app | ||
|  | cp ../SDKCmake/iot_kl2_sample_app/iot_test_app_amp  ${OUTPUT_SDK}/examples/ -r | ||
|  | # uart demo app | ||
|  | cp ../SDKCmake/iot_kl2_sample_app/iot_uart_app  ${OUTPUT_SDK}/examples/ -r | ||
|  | 
 | ||
|  | # add exe | ||
|  | chmod +x ${OUTPUT_SDK}/examples/iot_cpp_app/scripts/build-ai.sh | ||
|  | chmod +x ${OUTPUT_SDK}/examples/iot_test_app/scripts/build-ai.sh | ||
|  | chmod +x ${OUTPUT_SDK}/examples/iot_test_app_amp/scripts/build-ai.sh | ||
|  | 
 |