Skip to main content
Associate II
February 22, 2024
Solved

PROBLEM WHEN TRY TO DEBUG

HELLO TO ALL

I HAVE A PROBLEM WHEN I BUILD THE CODE AND PROGRAM IT WITH STM32 PROGRAMMER IT IS WORKING BUT WHEN I TRY TO DOWNLOAD THE CODE USING THE IDE WITH DEBUG I GOT ERR  THIS IS THE CONCOL LOG     

ST-LINK SN : 310009000B00004C3359534E

ST-LINK FW : V2J44S7

Board : --

Voltage : 3.27V

SWD freq : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID : 0x410

Revision ID : Rev X

Device name : STM32F101/F102/F103 Medium-density

Flash size : 64 KBytes

Device type : MCU

Device CPU : Cortex-M3

BL Version : --

 

 

 

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a32112.srec

File : ST-LINK_GDB_server_a32112.srec

Size : 2.26 KB

Address : 0x08000000

 

 

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 2]

Download in Progress:

 

 

File download complete

Time elapsed during download operation: 00:00:00.244

 

 

 

Verifying ...

 

 

 

 

Download verified successfully

 

 

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Shutting down...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

 

 

 

AFTER I GOT IT I TRY TO CONNECT TO THE DEVICE WITH THE STM32 PROGRAMER I GOT ERR

    This topic has been closed for replies.
    ElmoftyBest answer
    Associate II
    February 22, 2024

    thanks alot i have fix this by regenerat the code it is ok now

    another point need to help i add in my code to print in SWV ITM DATA CONSOLE IT CANNOT ADD ANY THIS IS MY MAIN CODE JUST FOR TRST DEBUG

     

    I ADD

    #include <stdio.h>
    
    
    
    THEN IN THE MAIN I ADD
    
    while (1)
    
    {
    
    /* USER CODE END WHILE */
    
    
    
    // Print the formatted string
    
    printf("HELLO\n");
    
    HAL_Delay(1000);
    
    /* USER CODE BEGIN 3 */
    
    }
    
    /* USER CODE END 3 */
    
    }
    
    
    
    
    
    
    
    AND AT THE ED OF THE CODE I ADD
    
    /* USER CODE BEGIN 4 */
    
    int _write(int file, char *ptr, int len)
    
    {
    
    (void)file;
    
    int DataIdx;
    
    
    
    for (DataIdx = 0; DataIdx < len; DataIdx++)
    
    {
    
    ITM_SendChar(*ptr++);
    
    }
    
    return len;
    
    }
    
    /* USER CODE END 4 */

    I AM USING STM32F103C8T6

    6 replies

    mƎALLEm
    ST Technical Moderator
    February 22, 2024

    Hello,

    What message you had with STM32CubeProgrammer? can you share a screenshot?

    Are you using low power modes?

    To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
    TDK
    February 22, 2024

    Perhaps you are repurposing the SWD pins, PA13/PA14, and/or going into low power modes where debug is not possible.

    What does your code do?

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    ElmoftyAuthor
    Associate II
    February 22, 2024

    Error: no stm32 target found! if your product embeds Debug Authentication , please perform a discovery using Debug Authentication     it cannot acces the stm32 device so to access it i make it in usb mode connecting the boot0 to high then i can access the device i can erase then i can download file to it

    mƎALLEm
    ST Technical Moderator
    February 22, 2024

    As I said I suspect there is a low power mode in your example you load into your MCU.

    And if you download any other example, do you face the same behavior?

    To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
    ElmoftyAuthorBest answer
    Associate II
    February 22, 2024

    thanks alot i have fix this by regenerat the code it is ok now

    another point need to help i add in my code to print in SWV ITM DATA CONSOLE IT CANNOT ADD ANY THIS IS MY MAIN CODE JUST FOR TRST DEBUG

     

    I ADD

    #include <stdio.h>
    
    
    
    THEN IN THE MAIN I ADD
    
    while (1)
    
    {
    
    /* USER CODE END WHILE */
    
    
    
    // Print the formatted string
    
    printf("HELLO\n");
    
    HAL_Delay(1000);
    
    /* USER CODE BEGIN 3 */
    
    }
    
    /* USER CODE END 3 */
    
    }
    
    
    
    
    
    
    
    AND AT THE ED OF THE CODE I ADD
    
    /* USER CODE BEGIN 4 */
    
    int _write(int file, char *ptr, int len)
    
    {
    
    (void)file;
    
    int DataIdx;
    
    
    
    for (DataIdx = 0; DataIdx < len; DataIdx++)
    
    {
    
    ITM_SendChar(*ptr++);
    
    }
    
    return len;
    
    }
    
    /* USER CODE END 4 */

    I AM USING STM32F103C8T6