Merge branch 'master' of git://github.com/gsmcmullin/blackmagic

This commit is contained in:
Mike Smith 2011-12-14 23:10:53 -08:00
commit bba42ff6c9
2 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@
static char *get_dev_unique_id(char *serial_no); static char *get_dev_unique_id(char *serial_no);
static int configured; static int configured;
static int cdcacm_gdb_dtr; static int cdcacm_gdb_dtr = 1;
static const struct usb_device_descriptor dev = { static const struct usb_device_descriptor dev = {
.bLength = USB_DT_DEVICE_SIZE, .bLength = USB_DT_DEVICE_SIZE,

View File

@ -158,7 +158,7 @@ static int stm32f4_flash_erase(struct target_s *target, uint32_t addr, int len)
uint32_t cr; uint32_t cr;
uint32_t pagesize; uint32_t pagesize;
addr &= 0x07E00000; addr &= 0x07FFC000;
/* Enable FPEC controller access */ /* Enable FPEC controller access */
adiv5_ap_mem_write(t->ap, FLASH_KEYR, KEY1); 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; uint16_t sr;
/* Construct data buffer used by stub */ /* Construct data buffer used by stub */
data[0] = dest & 0xFFFFFFFE; data[0] = dest & 0xFFFFFFFC;
data[1] = len & 0xFFFFFFFE; data[1] = (len + 3) & 0xFFFFFFFC;
memcpy(&data[2], src, len); memcpy(&data[2], src, len);
/* Write stub and data to target ram and set PC */ /* 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, 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); target_pc_write(target, 0x20000000);
if(target_check_error(target)) if(target_check_error(target))
return -1; return -1;