MXC-A36_2024.04.18/fr3092_mcu/components/tools/keil/debug_xip_flash.ini

64 lines
2.3 KiB
INI
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 使用说明
1使用xip_flash.sct作为链接文件
2工程选项的Debug标签页中初始化文件(Initialization File)选择debug_xip_flash.ini
3【重要】Utilities标签页中取消选择Update Target before Debugging
*/
/*----------------------------------------------------------------------------
* Name: debug_xip_flash.ini
* Purpose: XIP Debug Initialization File
*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
Setup() configure PC & SP for RAM Debug
*----------------------------------------------------------------------------*/
FUNC void Setup (void) {
_WDWORD(0xE0050020, 0xffffffff);
_WDWORD(0xE0050024, 0xffffffff);
_WDWORD(0xE0050028, 0xffffffff);
_WDWORD(0xE005002c, 0xffffffff);
_WDWORD(0xE0050030, 0xffffffff);
_WDWORD(0xE0050034, 0xffffffff);
_WDWORD(0xE0050038, 0xffffffff);
_WDWORD(0xE005003c, 0xffffffff);
_WDWORD(0xE0050040, 0xffffffff);
_WDWORD(0xE0050044, 0xffffffff);
SP = _RDWORD(0x08002000); // Setup Stack Pointer
PC = _RDWORD(0x08002004); // Setup Program Counter
_WDWORD(0xE000ED08, 0x08002000); // Setup Vector Table Offset Register
// Enable Cache
if ((_RDWORD(0xE00B0004) & 0x03) == 0x00) {
_WDWORD(0xE00B0000, 0x00000038);
_WDWORD(0xE00B0000, 0x0000003C);
_WDWORD(0x20000000, 0x12345678);
_WDWORD(0x20000004, 0x12345678);
_WDWORD(0x20000008, 0x12345678);
_WDWORD(0x2000000c, 0x12345678);
_WDWORD(0x20000010, 0x12345678);
_WDWORD(0x20000014, 0x12345678);
_WDWORD(0x20000018, 0x12345678);
_WDWORD(0x2000001c, 0x12345678);
_WDWORD(0xE00B0000, 0x0000003E);
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0x20000000, _RDWORD(0x20000000));
_WDWORD(0xE00B0000, 0x0000003D);
}
}
FUNC void OnResetExec (void) { // executes upon software RESET
Setup(); // Setup for Running
}
load %L incremental
Setup(); // Setup for Running
//g, main