Skip to main content
Dmitry Bravikov
Associate
November 12, 2016
Question

STM32CubeMX disables SWD by default for F1

  • November 12, 2016
  • 2 replies
  • 2199 views
Posted on November 12, 2016 at 23:43

I use STM32CubeMX 4.17.0. I create a new project and select any F1. Then, I generate a source code. In function HAL_MspInit() I see following lines:

    /**DISABLE: JTAG-DP Disabled and SW-DP Disabled 

    */

  __HAL_AFIO_REMAP_SWJ_DISABLE();

STM32CubeMX disables SWD by default. Is this a bug?

#feature #stupid-as-designed #bug-stm32cubemx
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
November 13, 2016
Posted on November 13, 2016 at 01:44

Is this a bug?

No I think it is a feature. I believe it is a check box item.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Bill Lewis
Associate III
May 10, 2017
Posted on May 10, 2017 at 22:34

Clive,

When is it desirable to do that?

Bill

slimen
Visitor II
November 14, 2016
Posted on November 14, 2016 at 10:37

Hello,

For F1 series, from STM32CubeMx and Pinout view,  go to the SYS peripheral and change ''No Debug'' to any other mode. This will resolve this issue.

Regards

nichtgedacht
Associate III
May 10, 2017
Posted on May 10, 2017 at 23:15

How to recover if the chip is already programmed this way?

Bill Lewis
Associate III
May 10, 2017
Posted on May 10, 2017 at 23:19

Dieter,

I re-generated the project with STM32CubeMX.

And you have to power-cycle the target board.

Then it all worked correctly in the debugger.

-Bill