Skip to main content
Senior
June 3, 2025
Solved

St-link is not detecting custom stm32h753zi board suddenly

  • June 3, 2025
  • 7 replies
  • 964 views

Hey friends,
Until yesterday, my custom board with the STM32H753ZI100_24 MCU—connected to an IMU sensor, magnetometer, and barometric sensor via SPI—was detected successfully by STM32CubeIDE. But today, when I came to the office, I’m unable to initialize the ST-Link device, which I used to program the board through Vaap, GND, SDIO and SWCLK pins in the st-link.

Here are the steps I’ve tried so far:

  • Restarted my Linux PC

  • Removed all power from the board and the ST-Link V2, checked the connection and then reconnected everything

  • Connected the ST-Link to another STM32 MCU on the same board, and it works fine

  • Verified 3.2 V power supply to the MCU with a multimeter which is needed for mcu to power up.

Despite this, I still can’t get the ST-Link to detect the board. Could this be caused by something in the last code I flashed, or is it likely a hardware issue?

Any advice or suggestions would be greatly appreciated!

Thanks in advance.

Best answer by santhosh16

i have followed the stm32 stack overflow forum the 4th answer which mention to using the cubeprogrammer i have reduced the swd frequency lesser than 4000 khz. And now its also get connected in 4000 khz.

7 replies

Senior
June 3, 2025

Additional to this there is an another dialog box arises when i debug or run the code. Screenshot from 2025-06-03 16-30-38.png

 what are the reasons this might get

TDK
Super User
June 3, 2025

Can you connect with STM32CubeProgrammer?

Can you show the board schematic? Could be a design issue.

Can you monitor power drawn by the board? If it's drawing excessive current, it could be dead.

 

Put the chip into bootloader mode and then try to connect (in STM32CubeProgrammer).

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

No im unable to connect with stm32cubeprogrammer

i discuss with the hardware designer and send the design
current drawn is increasing slightly over the few days

the bootloader is in given to ground by default in hardware so is there any other option to enable bootloader

TDK
Super User
June 5, 2025

> current drawn is increasing slightly over the few days

Not a good sign. I'd guess a hardware issue.

I would stick with STM32CubeProgrammer.

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

and now i connect it to through stlink commands in linux terminal. shows chip id and core id as 0.

Screenshot from 2025-06-05 14-41-01.png

 

is it due to its not recommended for new designs as they said in their website. https://www.st.com/en/development-tools/stsw-link004.html

Senior
June 9, 2025

Post merged

Hey friends,
In my custom board with the STM32H753ZI100_24 MCU—connected to an IMU sensor, magnetometer, and barometric sensor via SPI—was detected successfully by STM32CubeIDE. But today, when I came to the office, I’m unable to initialize the ST-Link device, which I used to program the board through Vaap, GND, SDIO and SWCLK pins in the st-link.

original post - stm32 chip id erased 
kindly help with this im new to stm32. i have attached updates in that old post

 

mƎALLEm
Technical Moderator
June 9, 2025

Hello @santhosh16 ,

Please don't duplicate/re-post the same question/request.

If you need more assistance you need to keep asking in the same thread.

Thank you for your understanding.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
Senior
June 9, 2025

yeah fine, but in this post i replied that i got solved. but with in few hours i have the same issue and i edited the reply. but no one noticed it. thats why rather than reminding the visitors in the old post they may not even notice. i posted a new one so that new one will be viewed at the top. (as of my assumption)

Senior
June 9, 2025

as a recent update my board got connected to the cubeprogrammer as said in this stackoverflow forum in 2nd point of just reducing the swd frequency to lesser than 4000 khz i.e. 480 khz. Now after connected, it is even got connected in 4000 khz also. now i will share my code to you to read the barometer sensor i have coded the below one. is this anything affects my  hardware which goes to chip id as 0x0000
This is the main code

int main(void)
{

 /* USER CODE BEGIN 1 */

 /* USER CODE END 1 */

 /* MPU Configuration--------------------------------------------------------*/
 MPU_Config();

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();

 /* USER CODE BEGIN Init */

 /* USER CODE END Init */

 /* Configure the system clock */
 SystemClock_Config();

 /* USER CODE BEGIN SysInit */

 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_SPI1_Init();
 /* USER CODE BEGIN 2 */
 HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, GPIO_PIN_RESET);

 uint16_t prom[8] = {0};
 uint8_t rst_cmd = 0x1E; // Reset command
 HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_RESET);
 HAL_SPI_Transmit(&hspi1, &rst_cmd, 1, HAL_MAX_DELAY);
 HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET);
 HAL_Delay(30000);

// if (MS5611_ReadPROM(prom) == HAL_OK) {
// // Now prom[] contains all PROM coefficients including factory data and CRC
// for (int i = 0; i < 8; i++) {
//	 printf("PROM[%d] = %u\n", i, prom[i]);
// }
// } else {
// printf("Error reading PROM!\n");
// }

 /* USER CODE END 2 */

 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */

 /* USER CODE BEGIN 3 */
	 MS5611_ReadPROM(prom);
	 HAL_Delay(1000);
 }
 /* USER CODE END 3 */
}

and this is the MS5611_ReadPROM() function

HAL_StatusTypeDef MS5611_ReadPROM(uint16_t *promData) {
 HAL_StatusTypeDef status;
 uint8_t prom_cmd;
 uint8_t rx_buf[2]={0,0};

 for (uint8_t ptr = 0; ptr < 8; ptr++) {
 prom_cmd = 0xA0 + (ptr * 2); // PROM read commands: 0xA0, 0xA2, ..., 0xAE

 HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_RESET);

 // Send PROM read command
 status = HAL_SPI_Transmit(&hspi1, &prom_cmd, 1, HAL_MAX_DELAY);
 if (status != HAL_OK) {
 	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET);
 return status;
 }

 // Receive 2 bytes PROM data (MSB, LSB)
 for (uint8_t ctr = 0; ctr < 2; ctr++){
 status = HAL_SPI_Receive(&hspi1, rx_buf, 2, HAL_MAX_DELAY);
 }
 	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET);

 if (status != HAL_OK) {
 return status;
 }

 // Combine MSB and LSB
 promData[ptr] = (rx_buf[0] << 8) | rx_buf[1];
 }
 return HAL_OK;
}


 is there any errors in this code which affects hardware

santhosh16AuthorBest answer
Senior
June 10, 2025

i have followed the stm32 stack overflow forum the 4th answer which mention to using the cubeprogrammer i have reduced the swd frequency lesser than 4000 khz. And now its also get connected in 4000 khz.

Senior
June 10, 2025

hey friends @mƎALLEm , @TDK as you have said i marked the solution. but i dont know how it works i followed stackoverflow questions forum to try one of the solution in the 4 answer available. by that i reduced the swd frequency to lesser than 4 Mhz and it working i have no clue how to get rid of it here after kindly help what should i don't to avoid this problem again