From e380ced5171dc3c9098005924f61051a43b79428 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Sun, 8 Mar 2015 11:51:59 -0700 Subject: [PATCH] Change STM32F1 driver to use generated stub. --- flashstub/stm32.stub | 1 + src/stm32f1.c | 35 +---------------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) create mode 100644 flashstub/stm32.stub diff --git a/flashstub/stm32.stub b/flashstub/stm32.stub new file mode 100644 index 0000000..755f445 --- /dev/null +++ b/flashstub/stm32.stub @@ -0,0 +1 @@ +0x4809, 0x490A, 0x467A, 0x322C, 0x4B09, 0x2501, 0x2B00, 0xD00A, 0x6105, 0x8814, 0x800C, 0x68C4, 0x2601, 0x4234, 0xD1FB, 0x3B02, 0x3102, 0x3202, 0xE7F2, 0xBE00, 0x2000, 0x4002, 0x0000, 0x0000, 0x000C, 0x0000, 0xAAAA, 0xAAAA, 0xBBBB, 0xBBBB, 0xCCCC, 0xCCCC, \ No newline at end of file diff --git a/src/stm32f1.c b/src/stm32f1.c index a746d5d..0e87c21 100644 --- a/src/stm32f1.c +++ b/src/stm32f1.c @@ -120,40 +120,7 @@ static const char stm32hd_xml_memory_map[] = "" #define DBGMCU_IDCODE_F0 0x40015800 static const uint16_t stm32f1_flash_write_stub[] = { -// _start: - 0x4809, // ldr r0, [pc, #36] // _flashbase - 0x490a, // ldr r1, [pc, #40] // _addr - 0x467a, // mov r2, pc - 0x322c, // adds r2, #44 - 0x4b09, // ldr r3, [pc, #36] // _size - 0x2501, // movs r5, #1 -// _next: - 0x2b00, // cmp r3, #0 - 0xd00a, // beq _done - 0x6105, // str r5, [r0, #16] - 0x8814, // ldrh r4, [r2] - 0x800c, // strh r4, [r1] -// _wait: - 0x68c4, // ldr r4, [r0, #12] - 0x2601, // movs r6, #1 - 0x4234, // tst r4, r6 - 0xd1fb, // bne _wait - - 0x3b02, // subs r3, #2 - 0x3102, // adds r1, #2 - 0x3202, // adds r2, #2 - 0xe7f2, // b _next -// _done: - 0xbe00, // bkpt -// .org 0x28 -// _flashbase: - 0x2000, 0x4002, // .word 0x40022000 (FPEC_BASE) -// _addr: -// 0x0000, 0x0000, -// _size: -// 0x0000, 0x0000, -// _data: -// ... +#include "../flashstub/stm32.stub" }; bool stm32f1_probe(struct target_s *target)