mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
add debug needed file
This commit is contained in:
parent
40ddb76a4c
commit
2ac3ca6914
69
bsp/pico/MDK/mdk/RP2040.sct
Normal file
69
bsp/pico/MDK/mdk/RP2040.sct
Normal file
@ -0,0 +1,69 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
#define FLASH_SIZE 0x00200000
|
||||
#define SRAM_SIZE (1024*248)
|
||||
|
||||
#define STACK_0_SIZE (1024*4)
|
||||
#define STACK_1_SIZE (1024*1)
|
||||
|
||||
#define HEAP_0_SIZE (1024*32)
|
||||
#define HEAP_1_SIZE (1024*1)
|
||||
|
||||
#define RAMSIZE_VALID (SRAM_SIZE - \
|
||||
STACK_1_SIZE - HEAP_1_SIZE - \
|
||||
STACK_0_SIZE - HEAP_0_SIZE - 0x100)
|
||||
|
||||
LR_STAGE2_BOOT 0x10000000 0x100 {
|
||||
ER_STAGE2_BOOT +0 0x100 {
|
||||
compile_time_choice.o (+RO)
|
||||
}
|
||||
ER_FILL ImageLimit(ER_STAGE2_BOOT) FILL 0xDEADBEEF 0x100 - ImageLength(ER_STAGE2_BOOT) {
|
||||
}
|
||||
}
|
||||
|
||||
LR_IROM1 0x10000100 FLASH_SIZE - ImageLength(LR_STAGE2_BOOT) { ; load region size_region
|
||||
|
||||
ER_FLASH +0 0x00200000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
* (+RO-DATA)
|
||||
|
||||
startup_RP2040.o (+RO)
|
||||
* (+RO-CODE)
|
||||
* (+XO)
|
||||
}
|
||||
|
||||
ER_RAM_VECTOR_TABLE 0x20000000 {
|
||||
* (.ram_vector_table)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK +0 ALIGN 8 EMPTY STACK_0_SIZE {
|
||||
}
|
||||
|
||||
ARM_LIB_STACK_ONE +0 ALIGN 8 EMPTY STACK_1_SIZE {
|
||||
}
|
||||
ARM_LIB_HEAP +0 ALIGN 8 EMPTY HEAP_0_SIZE {
|
||||
}
|
||||
ARM_LIB_HEAP_ONE +0 ALIGN 8 EMPTY HEAP_1_SIZE {
|
||||
}
|
||||
|
||||
ER_MUTEX_ARRAY +0 {
|
||||
* (.mutex_array.*)
|
||||
* (.mutex_array)
|
||||
}
|
||||
|
||||
;ER_PREINIT_ARRAY +0 {
|
||||
; * (.preinit_array.*)
|
||||
; * (.preinit_array)
|
||||
;}
|
||||
|
||||
RW_IRAM +0 RAMSIZE_VALID { ; RW data
|
||||
* (+RW +ZI)
|
||||
}
|
||||
|
||||
}
|
||||
|
85
bsp/pico/MDK/mdk/RP2040_debug_in_sram.sct
Normal file
85
bsp/pico/MDK/mdk/RP2040_debug_in_sram.sct
Normal file
@ -0,0 +1,85 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
#define FLASH_SIZE 0x00200000
|
||||
#define SRAM_SIZE (1024*248)
|
||||
|
||||
#define STACK_0_SIZE (1024*4)
|
||||
#define STACK_1_SIZE (1024*1)
|
||||
|
||||
#define HEAP_0_SIZE (1024*32)
|
||||
#define HEAP_1_SIZE (1024*1)
|
||||
|
||||
#define RAMSIZE_VALID (SRAM_SIZE - \
|
||||
STACK_1_SIZE - HEAP_1_SIZE - \
|
||||
STACK_0_SIZE - HEAP_0_SIZE - 0x100)
|
||||
|
||||
;LR_STAGE2_BOOT 0x10000000 0x100 {
|
||||
; ER_STAGE2_BOOT +0 0x100 {
|
||||
; compile_time_choice.o (+RO)
|
||||
; }
|
||||
; ER_FILL ImageLimit(ER_STAGE2_BOOT) FILL 0xDEADBEEF 0x100 - ImageLength(ER_STAGE2_BOOT) {
|
||||
; }
|
||||
;}
|
||||
|
||||
LR_IROM1 0x20000000 SRAM_SIZE { ; load region size_region
|
||||
|
||||
ER_BINRAY_INFO +0 {
|
||||
* (:gdef:Reset_Handler) //!< please always make sure that Reset_Handler is placed here.
|
||||
* (.binary_info_header)
|
||||
}
|
||||
|
||||
;ER_RAM_VECTOR_TABLE +0 ALIGN 256 {
|
||||
; * (.ram_vector_table)
|
||||
;}
|
||||
|
||||
|
||||
ER_FLASH +0 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
* (+RO-DATA)
|
||||
startup_RP2040.o (+RO)
|
||||
}
|
||||
|
||||
ER_MUTEX_ARRAY +0 {
|
||||
* (.mutex_array.*)
|
||||
* (.mutex_array)
|
||||
}
|
||||
|
||||
RW_IRAM_CODE +0 {
|
||||
* (+RO-CODE)
|
||||
* (+XO)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK +0 ALIGN 8 EMPTY STACK_0_SIZE {
|
||||
}
|
||||
|
||||
ARM_LIB_STACK_ONE +0 ALIGN 8 EMPTY STACK_1_SIZE {
|
||||
}
|
||||
ARM_LIB_HEAP +0 ALIGN 8 EMPTY HEAP_0_SIZE {
|
||||
}
|
||||
ARM_LIB_HEAP_ONE +0 ALIGN 8 EMPTY HEAP_1_SIZE {
|
||||
}
|
||||
|
||||
|
||||
|
||||
;ER_PREINIT_ARRAY +0 {
|
||||
; * (.preinit_array.*)
|
||||
; * (.preinit_array)
|
||||
;}
|
||||
|
||||
RW_IRAM +0 { ; RW data
|
||||
* (+RW +ZI)
|
||||
}
|
||||
|
||||
RW_IRAM_UNINIT +0 UNINIT {
|
||||
*(.uninitialized_data*)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
68
bsp/pico/MDK/mdk/RP2040_run_in_sram.sct
Normal file
68
bsp/pico/MDK/mdk/RP2040_run_in_sram.sct
Normal file
@ -0,0 +1,68 @@
|
||||
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
|
||||
; command above MUST be in first line (no comment above!)
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
#define FLASH_SIZE 0x00200000
|
||||
#define SRAM_SIZE (1024*248)
|
||||
|
||||
#define STACK_0_SIZE (1024*4)
|
||||
#define STACK_1_SIZE (1024*1)
|
||||
|
||||
#define HEAP_0_SIZE (1024*32)
|
||||
#define HEAP_1_SIZE (1024*1)
|
||||
|
||||
#define RAMSIZE_VALID (SRAM_SIZE - \
|
||||
STACK_1_SIZE - HEAP_1_SIZE - \
|
||||
STACK_0_SIZE - HEAP_0_SIZE - 0x100)
|
||||
|
||||
LR_STAGE2_BOOT 0x10000000 0x100 {
|
||||
ER_STAGE2_BOOT +0 0x100 {
|
||||
compile_time_choice.o (+RO)
|
||||
}
|
||||
ER_FILL ImageLimit(ER_STAGE2_BOOT) FILL 0xDEADBEEF 0x100 - ImageLength(ER_STAGE2_BOOT) {
|
||||
}
|
||||
}
|
||||
|
||||
LR_IROM1 0x10000100 FLASH_SIZE - ImageLength(LR_STAGE2_BOOT) { ; load region size_region
|
||||
|
||||
ER_FLASH +0 0x00200000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
* (+RO-DATA)
|
||||
startup_RP2040.o (+RO)
|
||||
}
|
||||
|
||||
ER_RAM_VECTOR_TABLE 0x20000000 {
|
||||
* (.ram_vector_table)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK +0 ALIGN 8 EMPTY STACK_0_SIZE {
|
||||
}
|
||||
|
||||
ARM_LIB_STACK_ONE +0 ALIGN 8 EMPTY STACK_1_SIZE {
|
||||
}
|
||||
ARM_LIB_HEAP +0 ALIGN 8 EMPTY HEAP_0_SIZE {
|
||||
}
|
||||
ARM_LIB_HEAP_ONE +0 ALIGN 8 EMPTY HEAP_1_SIZE {
|
||||
}
|
||||
|
||||
ER_MUTEX_ARRAY +0 {
|
||||
* (.mutex_array.*)
|
||||
* (.mutex_array)
|
||||
}
|
||||
|
||||
;ER_PREINIT_ARRAY +0 {
|
||||
; * (.preinit_array.*)
|
||||
; * (.preinit_array)
|
||||
;}
|
||||
|
||||
RW_IRAM +0 RAMSIZE_VALID { ; RW data
|
||||
* (+RW +ZI)
|
||||
* (+RO-CODE)
|
||||
* (+XO)
|
||||
}
|
||||
|
||||
}
|
||||
|
10
bsp/pico/MDK/mdk/debug_with_cmsis-dap.ini
Normal file
10
bsp/pico/MDK/mdk/debug_with_cmsis-dap.ini
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
FUNC void reset_pico(void)
|
||||
{
|
||||
exec("RESET");
|
||||
exec("G, Reset_Handler");
|
||||
}
|
||||
|
||||
DEFINE BUTTON "Reset Pico", "reset_pico()"
|
||||
|
||||
reset_pico();
|
36
bsp/pico/MDK/mdk/debug_with_cmsis-dap_in_ram.ini
Normal file
36
bsp/pico/MDK/mdk/debug_with_cmsis-dap_in_ram.ini
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
|
||||
FUNC void debug_from_ram(void)
|
||||
{
|
||||
//extern unsigned int Image$$ARM_LIB_STACK$$ZI$$Limit;
|
||||
|
||||
printf("Entry Point: %08x\r\n", Reset_Handler);
|
||||
printf("Main Stack Pointer: %08x\r\n", Image$$ARM_LIB_STACK$$ZI$$Limit);
|
||||
|
||||
/*
|
||||
typedef struct {
|
||||
unsigned int ctrl;
|
||||
unsigned int load;
|
||||
unsigned int reason;
|
||||
unsigned int scratch[8];
|
||||
unsigned int tick;
|
||||
} watchdog_hw_t;
|
||||
|
||||
#define watchdog_hw ((watchdog_hw_t *const)0x40058000)
|
||||
*/
|
||||
|
||||
_WWORD(0x4005801C ,0xb007c0d3); //! scratch 4
|
||||
_WWORD(0x40058020 ,-0xb007c0d3 ^ (Reset_Handler | 0x01)); //! scratch 5
|
||||
_WWORD(0x40058024 ,Image$$ARM_LIB_STACK$$ZI$$Limit); //! scratch 6
|
||||
_WWORD(0x40058028 ,Reset_Handler | 0x01); //! scratch 7
|
||||
|
||||
exec("RESET");
|
||||
|
||||
exec("G, Reset_Handler");
|
||||
|
||||
}
|
||||
|
||||
DEFINE BUTTON "Reset Pico", "debug_from_ram()"
|
||||
|
||||
debug_from_ram();
|
1486
bsp/pico/MDK/mdk/template.uvoptx
Normal file
1486
bsp/pico/MDK/mdk/template.uvoptx
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user