cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX disables SWD by default for F1

Dmitry Bravikov
Associate II
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
5 REPLIES 5
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 Venmo
Up vote any posts that you find helpful, it shows what's working..
slimen
Senior
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

Posted on May 10, 2017 at 22:34

Clive,

When is it desirable to do that?

Bill

Posted on May 10, 2017 at 23:15

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

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