cancel
Showing results for 
Search instead for 
Did you mean: 

STLINK Problems with STM32H745i-DISCO

maxpartenfelder
Associate II

Hi,

I just got my H745i-DISCO board and started to tinker with ToughGFX right away. I got a test application loaded on the board, but once I disconnected the USB connection and reconnect it (USB connected to STLink USB Port on Nucleo board, power jumper in first position) the STLINK seems not to recognize the MCU anymore. The loaded flash drive contains a "FAIL.txt" file with the following content: "The interface firmware FAILED to reset/halt the target MCU".

When I press and hold the reset button while plugging the USB and releasing it within 2 seconds, the FAIL.txt is not present. Either way, I can't get TouchGFX or STLink Utility to connect to the MCU. I tried all day and only got it to again recognize the MCU once. Then I did a full chip erase with STLink Utility and loaded another application with TouchGFX. Unplugging the USB, plugging it again, same error.

What am I doing wrong? How can I get consistent results?

What I've tried so far:

  • Supplying the board via the scond USB power conn while keeping the STLink port connected
  • Dis- and reconnecting the 3.3V MCU power jumper JP1
  • Updating the onboard STLink to the latest firmware
  • Doing the "connect under reset" option as suggested by STLink Utility
  • Restart my computer

Any advice is warmly welcome

Best regards

Max

25 REPLIES 25
TJung
Associate II

Hi Max,

don´t ask me that.

I bought a new Nucleo to test the dual core. I connected the new board and it works as long as i did not disconnect it from power (USB). The next day i tried again and nothing works. I thought ok my fault and ordered new boards. The same story.

Using the code from above does not work for me. It stucks in the while loop.

But there are more inconsistencies:

Here is the generated code from CubeMX:

RCC_OscInitTypeDef RCC_OscInitStruct = {0};

 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};

 /** Supply configuration update enable 

 */

 HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);

 /** Configure the main internal regulator output voltage 

 */

 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);

 while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}

 /** Macro to configure the PLL clock source 

 */

It seems that the code configures the LDO, but on the Nucleo board the SMPS is used.

But it works (at least with the hack).

Thomas

maxpartenfelder
Associate II

I still have a Support Ticket running for this issue. I will post some updates if ST decides to answer it.

hansd56
Senior II

Hi,

Whilst I was testing something for maxpartenfelder problem the board was bricked too. I found out that voltage regulator U20 did not produce 3.3V. To verfy I feed in 3.3V on TP20. I was able to load firmware again. The STM32H745i-DISCO went into the bin and back to iMX RT1052. What a shame.

This solution worked perfectly.

Thanks a lot!

My understanding is that they have a persistent setting, and it always starts thru the ROM, perpetuating the setting. The BOOT0 pin changes how code execution forks into FLASH code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Linas L
Senior II

Also you can add big one second delay (like delay (0xFFFFFF) that just while with asm("nop") )

(note, this is not Hall function based on systic, but on nop operation so no coding for systic needed)

It will give you to press connect after manual restet. It works for me, but i have to not forget to add this code. Before any of your code is run on MCU, it will give STLink time to connect to CPU)

But that mean that boot is delayed by 1s. Maybe some one needs to get up and running faster.

It certainly would provide some margin to allow the debugger to wrestle control.

I'd probably use DWT CYCCNT, I'd suspect several hundred thousand cycles would suffice rather than 64 million.

Checking a GPIO, USART or button can also provide an escape route.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

My variant will run on any MCU family, so it could be written in seconds with no knoledge about MCU. and where is no penalty of flash memory, power consumption or register setting after this delay is over.

MMatu
Associate III

Hi thomas.

I face the same problem with my Nucleo-H745 as well. CubeMX generates code:

  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
 
  /** Supply configuration update enable 
  */
  HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); //also tried PWR_DIRECT_SMPS_SUPPLY
  /** Configure the main internal regulator output voltage 
  */
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
 
  while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}

When I try to debug, execution hangs in while loop (line #12), while the CM4 gets "Thread #1 (Suspended: Signal: SIGTRAP: Trace/breakpoint trap). Any success with your board?

What tool chain?

NUCLEO-H45ZI-Q should be using SMPS

https://www.st.com/en/evaluation-tools/nucleo-h745zi-q.html

Build something from the repository

STM32Cube_FW_H7_V1.5.0\Projects\NUCLEO-H745ZI-Q\Examples\GPIO\GPIO_EXTI

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..