2024-02-22 07:37 AM
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
2024-02-22 08:28 AM - edited 2024-02-22 08:30 AM
Hello,
What message you had with STM32CubeProgrammer? can you share a screenshot?
Are you using low power modes?
2024-02-22 08:48 AM
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?
2024-02-22 09:06 AM
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
2024-02-22 09:39 AM
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?
2024-02-22 10:36 AM
So
Putting the device into low-power modes where the critical pins and electronics are TURNED OFF, and thus non-communicative.
The pins have been reused or reassigned from their debug use cases.
The debug interface JTAG/SW has been explicitly disabled, or a sub-set of the pins disabled.
Please review the DATA SHEET and REFERENCE MANUAL (RM0008) in this CONTEXT.
2024-02-22 10:57 AM
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