diff --git a/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_flash.gdb b/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_flash.gdb index a0fb3fd20..4e8375b5f 100644 --- a/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_flash.gdb +++ b/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_flash.gdb @@ -1,33 +1,37 @@ #******************************************************* # -# Connect to J-Link and debug application in flash. +# Connect to J-Link and debug application in flash on SAM3X. # -# define 'reset' command +# Define 'reset' command define reset # Connect to the J-Link gdb server target remote localhost:2331 + # Reset the chip to get to a known state monitor reset # Select flash device -monitor flash device = AT91SAM3U4E +monitor flash device = AT91SAM3X8E + # Enable flash download and flash breakpoints monitor flash download = 1 + # Load the program load -# Reset peripheral (RSTC_CR) -set *0x400e1200 = 0xA5000004 +# Reset peripheral (RSTC_CR) +set *0x400e1a00 = 0xA5000004 -# Initializing PC and stack pointer +# Initialize PC and stack pointer mon reg sp=(0x80000) -set *0x80004 = *0x80004 & 0xFFFFFFFE +#set *0x80004 = *0x80004 & 0xFFFFFFFE mon reg pc=(0x80004) + info reg break main -# end of 'reset' command +# End of 'reset' command end diff --git a/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_sram.gdb b/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_sram.gdb index c7cc015ba..15a1792a9 100644 --- a/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_sram.gdb +++ b/hardware/arduino/sam/variants/arduino_due_x/debug_scripts/gcc/arduino_due_sram.gdb @@ -1,23 +1,37 @@ -#************************************************* +#******************************************************* # -# Connect to J-Link and debug application in sram on SAM3U +# Connect to J-Link and debug application in sram on SAM3X. # -# Note: -# First,users should do Step1 and Step2 according to your project, -# then do Step3. -# Step1: Connect to the J-Link gdb server -#target remote localhost:2331 -#mon reset +# Define 'reset' command +define reset -# Step2: Load file(eg. getting-started project) -#load bin/basic-dhrystone-project-at91sam3u-ek-at91sam3u4-sram.elf -#symbol-file bin/basic-dhrystone-project-at91sam3u-ek-at91sam3u4-sram.elf +# Connect to the J-Link gdb server +target remote localhost:2331 -# Step3: Initializing PC and stack pointer -# Perpheral reset RSTC_CR -set *0x400e1200 = 0xA5000004 -# Modify pc value to even before writing pc register +# Reset the chip to get to a known state +monitor reset + +# Select flash device +monitor flash device = AT91SAM3X8E + +# Enable flash download and flash breakpoints +monitor flash download = 1 + +# Load the program +load + +# Reset peripheral (RSTC_CR) +set *0x400e1a00 = 0xA5000004 + +# Initialize PC and stack pointer mon reg sp=(0x20000000) -set *0x20000004 = *0x20000004 & 0xFFFFFFFE +#set *0x20000004 = *0x20000004 & 0xFFFFFFFE mon reg pc=(0x20000004) + +info reg + +break main + +# End of 'reset' command +end diff --git a/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_flash.gdb b/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_flash.gdb index a0fb3fd20..caf3b3cee 100644 --- a/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_flash.gdb +++ b/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_flash.gdb @@ -1,33 +1,37 @@ #******************************************************* # -# Connect to J-Link and debug application in flash. +# Connect to J-Link and debug application in flash on SAM3X. # -# define 'reset' command +# Define 'reset' command define reset # Connect to the J-Link gdb server target remote localhost:2331 + # Reset the chip to get to a known state monitor reset # Select flash device -monitor flash device = AT91SAM3U4E +monitor flash device = AT91SAM3X8H + # Enable flash download and flash breakpoints monitor flash download = 1 + # Load the program load -# Reset peripheral (RSTC_CR) -set *0x400e1200 = 0xA5000004 +# Reset peripheral (RSTC_CR) +set *0x400e1a00 = 0xA5000004 -# Initializing PC and stack pointer +# Initialize PC and stack pointer mon reg sp=(0x80000) -set *0x80004 = *0x80004 & 0xFFFFFFFE +#set *0x80004 = *0x80004 & 0xFFFFFFFE mon reg pc=(0x80004) + info reg break main -# end of 'reset' command +# End of 'reset' command end diff --git a/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_sram.gdb b/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_sram.gdb index 5fa44e23c..595b46b6c 100644 --- a/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_sram.gdb +++ b/hardware/atmel/sam/variants/sam3x_ek/debug_scripts/gcc/sam3x_ek_sram.gdb @@ -1,29 +1,37 @@ #******************************************************* # -# Connect to J-Link and debug application in flash. +# Connect to J-Link and debug application in sram on SAM3X. # -# define 'reset' command +# Define 'reset' command define reset # Connect to the J-Link gdb server target remote localhost:2331 + # Reset the chip to get to a known state monitor reset +# Select flash device +monitor flash device = AT91SAM3X8H + +# Enable flash download and flash breakpoints +monitor flash download = 1 + # Load the program load -# Reset peripheral (RSTC_CR) -set *0x400e1200 = 0xA5000004 +# Reset peripheral (RSTC_CR) +set *0x400e1a00 = 0xA5000004 -# Initializing PC and stack pointer +# Initialize PC and stack pointer mon reg sp=(0x20000000) -set *0x20000004 = *0x20000004 & 0xFFFFFFFE +#set *0x20000004 = *0x20000004 & 0xFFFFFFFE mon reg pc=(0x20000004) + info reg break main -# end of 'reset' command +# End of 'reset' command end