800*320工程文件+初始demo提交
This commit is contained in:
BIN
SW/examples/common/dsp/dsp_code_flash
Normal file
BIN
SW/examples/common/dsp/dsp_code_flash
Normal file
Binary file not shown.
7056
SW/examples/common/dsp/dsp_code_flash.c
Normal file
7056
SW/examples/common/dsp/dsp_code_flash.c
Normal file
File diff suppressed because it is too large
Load Diff
10
SW/examples/common/dsp/dsp_code_flash.s
Normal file
10
SW/examples/common/dsp/dsp_code_flash.s
Normal file
@ -0,0 +1,10 @@
|
||||
AREA RO,DATA,READONLY
|
||||
|
||||
; dsp_code_flash is compiled based on ROM code is stored in XIP flash
|
||||
EXPORT DSP_CODE_FLASH_BASE
|
||||
EXPORT DSP_CODE_FLASH_END
|
||||
DSP_CODE_FLASH_BASE
|
||||
incbin dsp_code_flash
|
||||
DSP_CODE_FLASH_END
|
||||
|
||||
END
|
BIN
SW/examples/common/dsp/dsp_code_rom
Normal file
BIN
SW/examples/common/dsp/dsp_code_rom
Normal file
Binary file not shown.
8022
SW/examples/common/dsp/dsp_code_rom.c
Normal file
8022
SW/examples/common/dsp/dsp_code_rom.c
Normal file
File diff suppressed because it is too large
Load Diff
10
SW/examples/common/dsp/dsp_code_rom.s
Normal file
10
SW/examples/common/dsp/dsp_code_rom.s
Normal file
@ -0,0 +1,10 @@
|
||||
AREA RO,DATA,READONLY
|
||||
|
||||
; dsp_code_flash is compiled based on ROM code is stored in IROM
|
||||
EXPORT DSP_CODE_ROM_BASE
|
||||
EXPORT DSP_CODE_ROM_END
|
||||
DSP_CODE_ROM_BASE
|
||||
incbin dsp_code_rom
|
||||
DSP_CODE_ROM_END
|
||||
|
||||
END
|
44
SW/examples/common/dsp/dsp_post_process.py
Normal file
44
SW/examples/common/dsp/dsp_post_process.py
Normal file
@ -0,0 +1,44 @@
|
||||
import os
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
|
||||
def fill_header(f_in_file,
|
||||
f_out_file,
|
||||
version):
|
||||
code_length = os.path.getsize(f_in_file)
|
||||
f_out = open(f_out_file, 'wb')
|
||||
f_out.write(struct.pack('I', 0xAA5555AA))
|
||||
f_out.write(struct.pack('I', version))
|
||||
f_out.write(struct.pack('I', code_length))
|
||||
f_in = open(f_in_file, 'rb')
|
||||
array = f_in.read(code_length)
|
||||
image_crc = zlib.crc32(array)
|
||||
|
||||
f_out.write(struct.pack('I', image_crc))
|
||||
f_out.seek(0x10)
|
||||
f_out.write(array)
|
||||
|
||||
def binary_to_c_array(input_file, output_file, array_name):
|
||||
with open(input_file, 'rb') as f:
|
||||
binary_data = f.read()
|
||||
|
||||
with open(output_file, 'w') as f:
|
||||
f.write('#include <stdint.h>\n')
|
||||
f.write('const uint8_t {}[] = {{\n'.format(array_name))
|
||||
counter = 0
|
||||
for byte in binary_data:
|
||||
if counter == 0:
|
||||
f.write(' ')
|
||||
f.write('0x{:02X}, '.format(byte))
|
||||
counter = counter + 1
|
||||
if counter == 16:
|
||||
counter = 0
|
||||
f.write('\n')
|
||||
f.write('\n};')
|
||||
|
||||
fill_header("dsp_code_flash", "dsp_code_flash_burn.bin", 0x00010000)
|
||||
fill_header("dsp_code_rom", "dsp_code_rom_burn.bin", 0x00010000)
|
||||
|
||||
binary_to_c_array("dsp_code_flash", "dsp_code_flash.c", "dsp_code_flash_buffer")
|
||||
binary_to_c_array("dsp_code_rom", "dsp_code_rom.c", "dsp_code_rom_buffer")
|
Reference in New Issue
Block a user