在线时间57 小时
UID3080775
注册时间2014-12-5
NXP金币0
该用户从未签到
中级会员
 
- 积分
- 357
- 最后登录
- 2015-12-1
|
这两天在看OPENSDA的源代码,在OPENSDA的源码目录中有CMSIS-DAP-master\interface\flash_algo_mdk\MKXXX这个目录,我的理解是通过这个keil工程生成目标板的flash算法。最终会生成跟CMSIS-DAP-master\interface\target\hal\DBG_Freescale\DBG_KL25Z目录中对应的target_flash.inc文件。
但是,按照这个猜测,并没有生成target_flash.inc文件。请教各位大神,如何在opensda的源码中生成目标板的flash算法镜像?
下面是我的做法:
按照这个猜测,我编译了keil工程中的MKL25Z128_Pflash这个工程,生成了MKL25Z128.afx仿真文件,然后到CMSIS-DAP-master\interface\flash_algo_mdk\MKXXX目录中执行gen_flash_algos.sh脚本,最终在CMSIS-DAP-master\interface\flash_algo_mdk\MKXXX目录中生成了MKL25Z128.txt文件,打开文件查看其中的内容:
const uint32_t flash_algo_blob[] = {
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
0x492cb510, 0x60082000, 0x4448482b, 0xf8a8f000, 0xd0002800, 0xbd102001, 0x47702000, 0xb5104826,
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
0x40020004, 0x00000000,
};
static const TARGET_FLASH flash = {
0x20000021, // Init
0x20000039, // UnInit
0x2000003D, // EraseChip
0x20000061, // EraseSector
0x2000008F, // ProgramPage
跟target_flash.inc相比,TARGET_FLASH这个结构体还有几个成员变量没有生成。static const TARGET_FLASH flash = {
0x20000021, // Init
0x20000039, // UnInit
0x2000003D, // EraseChip
0x2000005F, // EraseSector
0x2000008B, // ProgramPage
// breakpoint = RAM start + 1
// RSB : base address is address of Execution Region PrgData in map file
// to access global/static data
// RSP : Initial stack pointer
{
0x20000001, // breakpoint instruction address
0x20000000 + 0x20 + 0x470, // static base register value (image start + header + static base offset)
0x20000800 // initial stack pointer
},
0x20000a00, // program_buffer, any valid RAM location with +512 bytes of headroom
0x20000000, // algo_start, start of RAM
sizeof(KL25Z_FLM), // algo_size, size of array above
KL25Z_FLM, // image, flash algo instruction array
512 // ram_to_flash_bytes_to_be_written
};
|
|