cancel
Showing results for 
Search instead for 
Did you mean: 

[BUG] CubeMX switch off JTAG and SWD

rafal23
Associate II
Posted on October 29, 2017 at 01:12

Hi all,

I would like to report a bug of CubeMX.

I did generated simple project for STM32F103VEx.  Project if fairly simple just uses USB in CDC mode.

I did generate similar project for same processor but only SPI3 using shared pins PB3 and PB4 with JTAG.

Each time while I did generated those projects CubeMX forces to distable whole debug communication JTAG +SWD

by adding line

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

    */

  __HAL_AFIO_REMAP_SWJ_DISABLE();

While SWD could be turned on since it does not conflicts with any of those peripherals. STM32 have options to disable only JTAG or either distable only NRJST pin in JTAG. Why CubeMX forces to kill all of the debug communication ?

Simple project attached. Example file located in testCDC/stm32f1xx_hal_msp.c function void HAL_MspInit(void)

https://community.st.com/tags♯/?tags=stm32%20cube%20mx

https://community.st.com/tags♯/?tags=stm32f103%20usb

https://community.st.com/tags♯/?tags=bug%20report

‌

#bug-report #stm32-cube-mx #stm32f103-usb
7 REPLIES 7
Imen.D
ST Employee
Posted on October 30, 2017 at 10:45

Hello,

Yo can refer to the RM0008 reference manual in the section ''JTAG/SWD alternate function remapping'' to have more details and clarification about your case, as mentioned prior to configure SPI3 that user has to disable the JTAG and use SWD interface or disable both JTAG/SWD.

0690X00000608nZQAQ.png0690X00000608YGQAY.png

Note: I think you are using an old version, so I recommend you to use the last version (4.23) updates to fix defects and enhancements implementation.

Kind Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
rafal23
Associate II
Posted on October 30, 2017 at 10:58

Hi Imen,

Thanks for response. I was using CubeMX version 4.22.1, updated to 4.23 and same problem occurs.

I know about

RM0008 and JTAG/SWD remapping table. I am just concerns that clean project generated from CubeMX

does not switch off only JTAG but whole debug communication and does it in the non obvious part of code. I manage to make it work, but imagine people which try to do it first time and their evaluation board do not respond after first program.

I think this is a bug in CubeMX and it should switch off only those debug ports which is needed. In that case just JTAG while it turns off all of debug communication.

Best regards,

Rafal

Posted on October 30, 2017 at 11:08

Hi

Woloszyn.Rafal

,

Thank you for your contribution.I raised this issue internally to CubeMx team.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on October 30, 2017 at 11:39

Hi

DAHMEN.IMEN

‌,

Thank you. Let's nail this problem for future users !

R.

mahmoud_abdelraouf
Associate II

Upon enabling UART1 functionality within STM32CubeIDE, an unexpected behavior occurs: both JTAG-DP and SW_DP interfaces are simultaneously disabled. Consequently, this disrupts communication with the microcontroller via the ST-Link V2, rendering it unresponsive until I apply 3.3V to the Boot 1 pin for flash erasure.

Even after generating fresh code for flashing onto the STM32F103C8T6, this issue persists persistently. The repetitive nature of this problem significantly hampers my development activities, causing considerable disruption and delay.

I have diligently checked for software updates, reviewed hardware configurations to ensure correctness, and attempted various troubleshooting steps, but regrettably, the problem endures.

I am reaching out urgently to seek your immediate assistance and guidance in resolving this critical issue. Any insights, workarounds, or specific steps to rectify this situation would be immensely appreciated.

Given the urgency of this matter and its impact on my workflow, I kindly request your prompt attention and support in addressing this issue. Should there be any updates, patches, or known solutions, I would be grateful for information on how to implement them effectively.

mahmoud_abdelraouf_0-1701419114519.png

 

 

mahmoud_abdelraouf
Associate II

 

Temporary Solution for STM32CubeIDE Bug: Restoring JTAG-DP & SW_DP Functionality

Description:

Discover a temporary solution to the critical bug affecting STM32CubeIDE's peripheral configuration, disabling JTAG-DP and SW_DP interfaces for STM32F103C8T6 microcontrollers. In this video, Mahmoud Abdelraouf presents a workaround to restore functionality until STM releases a software update resolving this issue.

Video Link: Disabling JTAG-DP and SW_DP 

TDK
Guru

> I am reaching out urgently to seek your immediate assistance and guidance in resolving this critical issue. Any insights, workarounds, or specific steps to rectify this situation would be immensely appreciated.

Re-enable them in a user code section so it isn't removed after regeneration.

If you feel a post has answered your question, please click "Accept as Solution".