From c5b4022ed8b1cd518fc26093a11d0408c88452a1 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Wed, 7 Dec 2011 20:57:10 +1300 Subject: Default to DTR=1 if no request received. This is needed on Mac where opening the port doesn't assert DTR. Thanks to Mike Smith. --- src/stm32/cdcacm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stm32/cdcacm.c b/src/stm32/cdcacm.c index 4198af5..690081e 100644 --- a/src/stm32/cdcacm.c +++ b/src/stm32/cdcacm.c @@ -47,7 +47,7 @@ static char *get_dev_unique_id(char *serial_no); static int configured; -static int cdcacm_gdb_dtr; +static int cdcacm_gdb_dtr = 1; static const struct usb_device_descriptor dev = { .bLength = USB_DT_DEVICE_SIZE, -- cgit v1.2.3 From 45eee497d078a2f55abed6587b486d01b63f49fd Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Wed, 14 Dec 2011 22:57:50 +1300 Subject: stm32f4: Improve behaviour when a section doesn't end on a word boundary. This may not be an acceptable fix. It may be possible for the linker to place another section on the remainder of the offending work. --- src/stm32f4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stm32f4.c b/src/stm32f4.c index edb45b0..e83daa9 100644 --- a/src/stm32f4.c +++ b/src/stm32f4.c @@ -158,7 +158,7 @@ static int stm32f4_flash_erase(struct target_s *target, uint32_t addr, int len) uint32_t cr; uint32_t pagesize; - addr &= 0x07E00000; + addr &= 0x07FFC000; /* Enable FPEC controller access */ adiv5_ap_mem_write(t->ap, FLASH_KEYR, KEY1); @@ -207,13 +207,13 @@ static int stm32f4_flash_write_words(struct target_s *target, uint32_t dest, uint16_t sr; /* Construct data buffer used by stub */ - data[0] = dest & 0xFFFFFFFE; - data[1] = len & 0xFFFFFFFE; + data[0] = dest & 0xFFFFFFFC; + data[1] = (len + 3) & 0xFFFFFFFC; memcpy(&data[2], src, len); /* Write stub and data to target ram and set PC */ target_mem_write_words(target, 0x20000000, (void*)stm32f4_flash_write_stub, 0x30); - target_mem_write_words(target, 0x20000030, data, len + 8); + target_mem_write_words(target, 0x20000030, data, len + 11); target_pc_write(target, 0x20000000); if(target_check_error(target)) return -1; -- cgit v1.2.3