; ===================================================== ; bdiGDB configuration for STMicro STM32L152-EVAL board ; ===================================================== ; ; Info about the JTAG clock frequency: ; ------------------------------------ ; BDI2000: ; 0=Adaptive, ; 1=16MHz, 2=8MHz, 3=4MHz, ; 4= 1MHz, 5=500kHz, 6=200kHz, 7=100kHz, 8=50kHz, ; 9=20kHz, 10=10kHz, 11=5kHz, 12=2kHz, 13=1kHz ; BDI3000: ; 0=Adaptive, ; 1=32MHz, 2=16MHz, 3=11MHz, 4=8MHz, 5=5MHz, 6=4MHz, ; 7=1MHz, 8=500kHz, 9=200kHz, 10=100kHz, 11=50kHz, ; 12=20kHz, 13=10kHz, 14=5kHz, 15=2kHz, 16=1kHz, ; [INIT] WGPR 13 0x20003ffc ;set SP to top of internal 16kB SRAM ; ; switch to 8Mhz HSE oscillator ;WM32 0x40023800 0x00010100 ;RCC_CR : enable HSE oscillator ;DELAY 200 ;let HSE oscillator start-up ;WM32 0x40023808 0x00000002 ;RCC_CFGR: select HSE as system clock ; [TARGET] CPUTYPE CORTEX-M3 ;CLOCK 2 ;BDI2000: JTAG clock 8MHz CLOCK 6 ;BDI3000: JTAG clock 4MHz ;CLOCK 2 6 ;BDI3000: start with 4MHz then use 16MHz POWERUP 2000 ;start delay after power-up detected in ms RESET HARD 100 ;assert reset for 100 ms WAKEUP 100 ;wait after reset released STARTUP HALT ;halt immediately at the reset vector ENDIAN LITTLE ;memory model (LITTLE | BIG) BREAKMODE HARD ;SOFT or HARD ;MEMACCESS AHB 2 ;memory access via AHB (16 TCK's access delay) MEMACCESS AHB 10 ;Flash programming: needs 80 TCK's access delay for slow core clock ; SCANPRED 1 5 ;count for TMC TAP (remove this line for SWD) SCANSUCC 0 0 ;no device after ARM core (remove this line for SWD) [HOST] IP 151.120.25.112 PROMPT STM32L> FILE E:/temp/dump16k.bin FORMAT BIN 0x20000000 [FLASH] ; Flash programming speed can be optimized by increasing ARM core clock ; and then increasing JTAG clock and/or decreasing MEMACCESS delay. ; If flash programming fails, then the BDI is too fast, adjust CLOCK and/or MEMACCESS. ; ; Programming Speed BDI2000 @ 8MHz = 16 kByte / sec ; Programming Speed BDI3000 @ 4MHz = 18 kByte / sec ; Programming Speed BDI3000 @ 16MHz = 25 kByte / sec ; CHIPTYPE STM32L15 CHIPSIZE 0x20000 ;128 kB FLASH BUSWIDTH 32 ;32 bit flash access FILE E:/temp/dump64k.bin FORMAT BIN 0x08010000 ERASE 0x08010000 256 256 ;erase 64kbyte (256 x 256 byte pages) [REGS] FILE $regSTM32L.def