diff --git a/src/platforms/stlink/platform.c b/src/platforms/stlink/platform.c index 54b80461..a38b0a7f 100644 --- a/src/platforms/stlink/platform.c +++ b/src/platforms/stlink/platform.c @@ -61,11 +61,11 @@ void platform_init(void) srst_pin = SRST_PIN_V2; } /* Setup GPIO ports */ - gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_INPUT_FLOAT, TMS_PIN); - gpio_set_mode(TCK_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(TCK_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, TCK_PIN); - gpio_set_mode(TDI_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(TDI_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, TDI_PIN); platform_srst_set_val(false); @@ -90,7 +90,7 @@ void platform_init(void) void platform_srst_set_val(bool assert) { if (assert) { - gpio_set_mode(SRST_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(SRST_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, srst_pin); gpio_clear(SRST_PORT, srst_pin); } else { diff --git a/src/platforms/stlink/platform.h b/src/platforms/stlink/platform.h index 280d0aac..99e3555f 100644 --- a/src/platforms/stlink/platform.h +++ b/src/platforms/stlink/platform.h @@ -78,7 +78,7 @@ int usbuart_debug_write(const char *buf, size_t len); # define SWD_CR_MULT (1 << ((14 - 8) << 2)) #define TMS_SET_MODE() \ - gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_50_MHZ, \ + gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_2_MHZ, \ GPIO_CNF_OUTPUT_PUSHPULL, TMS_PIN); #define SWDIO_MODE_FLOAT() do { \ uint32_t cr = SWD_CR; \ diff --git a/src/platforms/swlink/platform.c b/src/platforms/swlink/platform.c index 18efbf3a..a11ea55b 100644 --- a/src/platforms/swlink/platform.c +++ b/src/platforms/swlink/platform.c @@ -67,11 +67,11 @@ void platform_init(void) data |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_OFF; AFIO_MAPR = data; /* Setup JTAG GPIO ports */ - gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_INPUT_FLOAT, TMS_PIN); - gpio_set_mode(TCK_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(TCK_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, TCK_PIN); - gpio_set_mode(TDI_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(TDI_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, TDI_PIN); gpio_set_mode(TDO_PORT, GPIO_MODE_INPUT, @@ -118,7 +118,7 @@ void platform_srst_set_val(bool assert) { /* We reuse JSRST as SRST.*/ if (assert) { - gpio_set_mode(JRST_PORT, GPIO_MODE_OUTPUT_50_MHZ, + gpio_set_mode(JRST_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, JRST_PIN); /* Wait until requested value is active.*/ while (gpio_get(JRST_PORT, JRST_PIN)) diff --git a/src/platforms/swlink/platform.h b/src/platforms/swlink/platform.h index 50baf059..aadf0428 100644 --- a/src/platforms/swlink/platform.h +++ b/src/platforms/swlink/platform.h @@ -72,7 +72,7 @@ int usbuart_debug_write(const char *buf, size_t len); # define SWD_CR_MULT (1 << ((13 - 8) << 2)) #define TMS_SET_MODE() \ - gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_50_MHZ, \ + gpio_set_mode(TMS_PORT, GPIO_MODE_OUTPUT_2_MHZ, \ GPIO_CNF_OUTPUT_PUSHPULL, TMS_PIN); #define SWDIO_MODE_FLOAT() do { \ uint32_t cr = SWD_CR; \