Skip to content

Commit

Permalink
blackpill-f4: Change slew rate at high SWCLK frequencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTracer committed Jan 28, 2025
1 parent fa5388f commit 3773ef9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/platforms/common/blackpill-f4/blackpill-f4.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ uint32_t platform_target_voltage_sense(void)
}
#endif

void platform_ospeed_update(const uint32_t frequency)
{
const uint8_t ospeed = (frequency > 2097152U) ? GPIO_OSPEED_25MHZ : GPIO_OSPEED_2MHZ;

gpio_set_output_options(TCK_PORT, GPIO_OTYPE_PP, ospeed, TCK_PIN);
gpio_set_output_options(TMS_PORT, GPIO_OTYPE_PP, ospeed, TMS_PIN);
gpio_set_output_options(TDI_PORT, GPIO_OTYPE_PP, ospeed, TDI_PIN);
}

void platform_target_clk_output_enable(bool enable)
{
if (enable) {
Expand Down

0 comments on commit 3773ef9

Please sign in to comment.