fc10ef2e10
GD32F470ZGT6 based project with full peripheral support: - SDRAM (W9825G6KH) via EXMC - LCD NT35510 (480x800) via EXMC NOR/PSRAM - Flash (W25Q64) via SPI - UART (USART0) debug console - LED indicators - CMSIS-DAP debug interface - CMake + ARM GCC toolchain build system
63 lines
1.6 KiB
INI
63 lines
1.6 KiB
INI
# OpenOCD configuration for GD32F470ZGT6 on LiangShanPi board
|
|
# Uses CMSIS-DAP debugger (onboard)
|
|
|
|
# Interface - onboard CMSIS-DAP
|
|
source [find interface/cmsis-dap.cfg]
|
|
|
|
# If using external ST-Link:
|
|
# source [find interface/stlink.cfg]
|
|
# If using external J-Link:
|
|
# source [find interface/jlink.cfg]
|
|
|
|
# Transport: SWD
|
|
transport select swd
|
|
|
|
# Target: GD32F470 (Cortex-M4 with FPU, similar to STM32F4)
|
|
set CHIPNAME gd32f470
|
|
set ENDIAN little
|
|
|
|
# Target configuration
|
|
source [find target/stm32f4x.cfg]
|
|
|
|
# GD32F470 specific configuration
|
|
# Flash: 1024KB, RAM: 192KB + 64KB TCM
|
|
# Note: Using STM32F4 config as base - adjust flash size
|
|
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x30000
|
|
|
|
# Reset configuration
|
|
reset_config srst_nogate
|
|
|
|
# Flash bank: 1MB internal flash
|
|
set _FLASHNAME $_CHIPNAME.flash
|
|
flash bank $_FLASHNAME stm32f2x 0x08000000 0 0 0 $_TARGETNAME
|
|
|
|
# SDRAM is at 0xC0000000, not mapped in OpenOCD (external)
|
|
|
|
proc program_elf {elf_file} {
|
|
echo "Programming: $elf_file"
|
|
reset init
|
|
flash write_image erase $elf_file
|
|
verify_image $elf_file
|
|
reset run
|
|
}
|
|
|
|
proc program_hex {hex_file} {
|
|
echo "Programming: $hex_file"
|
|
reset init
|
|
flash write_image erase $hex_file
|
|
reset run
|
|
}
|
|
|
|
proc program_bin {bin_file addr} {
|
|
echo "Programming: $bin_file at 0x$addr"
|
|
reset init
|
|
flash write_image erase $bin_file $addr
|
|
reset run
|
|
}
|
|
|
|
echo "GD32F470ZGT6 OpenOCD configuration loaded"
|
|
echo "Commands:"
|
|
echo " program_elf <file> - Program ELF file"
|
|
echo " program_hex <file> - Program HEX file"
|
|
echo " program_bin <file> <addr> - Program BIN file"
|