Add STM32F03X and STM32F07X handling.

This commit is contained in:
bon@elektron.ikp.physik.tu-darmstadt.de 2014-01-23 15:51:13 +01:00 committed by Gareth McMullin
parent 0c9d5d8166
commit d27c50c601
1 changed files with 17 additions and 3 deletions

View File

@ -58,7 +58,9 @@ static int stm32f1_flash_write(struct target_s *target, uint32_t dest,
static const char stm32f1_driver_str[] = "STM32, Medium density."; static const char stm32f1_driver_str[] = "STM32, Medium density.";
static const char stm32hd_driver_str[] = "STM32, High density."; static const char stm32hd_driver_str[] = "STM32, High density.";
static const char stm32f3_driver_str[] = "STM32F3xx"; static const char stm32f3_driver_str[] = "STM32F3xx";
static const char stm32f0_driver_str[] = "STM32F0xx"; static const char stm32f03_driver_str[] = "STM32F03x";
static const char stm32f05_driver_str[] = "STM32F05x";
static const char stm32f07_driver_str[] = "STM32F07x";
static const char stm32f1_xml_memory_map[] = "<?xml version=\"1.0\"?>" static const char stm32f1_xml_memory_map[] = "<?xml version=\"1.0\"?>"
/* "<!DOCTYPE memory-map " /* "<!DOCTYPE memory-map "
@ -190,8 +192,20 @@ bool stm32f1_probe(struct target_s *target)
target->idcode = adiv5_ap_mem_read(adiv5_target_ap(target), DBGMCU_IDCODE_F0) & 0xfff; target->idcode = adiv5_ap_mem_read(adiv5_target_ap(target), DBGMCU_IDCODE_F0) & 0xfff;
switch(target->idcode) { switch(target->idcode) {
case 0x440: /* STM32F0 */ case 0x444: /* STM32F03 */
target->driver = stm32f0_driver_str; case 0x440: /* STM32F05 */
case 0x448: /* STM32F07 */
switch(target->idcode) {
case 0x444: /* STM32F03 */
target->driver = stm32f03_driver_str;
break;
case 0x440: /* STM32F05 */
target->driver = stm32f05_driver_str;
break;
case 0x448: /* STM32F07 */
target->driver = stm32f07_driver_str;
break;
}
target->xml_mem_map = stm32f1_xml_memory_map; target->xml_mem_map = stm32f1_xml_memory_map;
target->flash_erase = stm32md_flash_erase; target->flash_erase = stm32md_flash_erase;
target->flash_write = stm32f1_flash_write; target->flash_write = stm32f1_flash_write;