cancel
Showing results for 
Search instead for 
Did you mean: 

"How can I send and receive datas by using STM32F103C8T6 USART pins with FTDI (3.3-5V) programmer and ST-Link V2 ?

Mucahit.Hamarat
Associate II

0693W00000NqvaHQAR.jpg0693W00000Nqva7QAB.jpg0693W00000Nqva2QAB.jpg0693W00000NqvZnQAJ.jpg0693W00000NqvZiQAJ.png0693W00000NqvZdQAJ.jpgHi,

Nowadays I am trying to send and receive data with STM32f103C8 module. In fact, my aim is only write" Hello World " one after the other in the rows below at Tera Term, by coing at STM CubeIDE, and with my some hardwares. So , first I connected this STM32f103C8 module to an FTDI programmer module and ST-Link V2. By watching some videos, I connected these 3 products's pins:

STM32F103C8's Rx to FTDI's Tx,

STM32f103C8's Tx to FTDI's Rx ,

Ground to Ground,

STM32F103C8's 5V to FTDI's VCC pin, then, same legs of STM32F103C8's and ST-Link are connected to each other.

I used STM CubeIDE as developement environment, and Tera Term application to test it. When I build the project at STM CubeIDE, I get no error, but then When I Debug, then Resume(F8), there is no joy at Tera Term, and at STM CubeIDE a new page is openning named 0x1fffe61c which has explanation " Break at address "0x1fffe61c" with no debug information available, or outside of program code." inside this page.

Note : Baudrate is 115200 at both STMCubeIDE pinout configuration and Tera Term serial port settings.

The Hardwares that I used :

  1. An STM32F103C8 module
  2. An FTDI programmer(3.3-5V)
  3. An ST-Link V2
  4. A laptop with internet

The Softwares that I used :

  1. STM32CubeIDE
  2. Tera Term
 
  * @file           : main.c
 
 
#include "main.h"
 
#include "string.h"
 
 
 
 
 
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_USART1_UART_Init(void);
 
int main(void)
{
 
	char data[12] = "Hello World\n";
 
 
  HAL_Init();
 
  SystemClock_Config();
 
 
  MX_GPIO_Init();
  MX_USART1_UART_Init();
 
  while (1)
  {
 
HAL_UART_Transmit(&huart1,data,sizeof(data), 200);
HAL_Delay(1000);
 
  }
 
}
 
void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
 
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }
 
 
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
 
  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
  {
    Error_Handler();
  }
}
 
 
static void MX_USART1_UART_Init(void)
{
 
 
  huart1.Instance = USART1;
  huart1.Init.BaudRate = 115200;
  huart1.Init.WordLength = UART_WORDLENGTH_8B;
  huart1.Init.StopBits = UART_STOPBITS_1;
  huart1.Init.Parity = UART_PARITY_NONE;
  huart1.Init.Mode = UART_MODE_TX_RX;
  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
  if (HAL_UART_Init(&huart1) != HAL_OK)
  {
    Error_Handler();
  }
 
 
}
 
 
static void MX_GPIO_Init(void)
{
 
  __HAL_RCC_GPIOD_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();
 
}
 
 
void Error_Handler(void)
{
 
  while (1)
  {
  }
 
}
 
#ifdef  USE_FULL_ASSERT
 
void assert_failed(uint8_t *file, uint32_t line)
{
 
}
#endif /* USE_FULL_ASSERT */

I added the photos that show how to I connected the pins to each other and my laptop.

1 ACCEPTED SOLUTION

Accepted Solutions

The 0x1fffe61c address suggests it is trying to run from ROM, rather than your code in FLASH.

Make sure BOOT0 is LOW

Step the code, make sure it doesn't end up in Error_Handler()

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

View solution in original post

6 REPLIES 6
Peter BENSCH
ST Employee

Well, the topic of Blue Pill has been discussed here several times (e.g. here or there), because only fakes have been installed there for a long time. These counterfeits look like originals, but behave differently and are very often rightly rejected by the STMicroelectronics software. Presumably you also have such a Blue Pill board with a fake on it?

Regards

/Peter

In order 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.

No, it is not a fake product on my blue pill, but I will check the link you shared

The 0x1fffe61c address suggests it is trying to run from ROM, rather than your code in FLASH.

Make sure BOOT0 is LOW

Step the code, make sure it doesn't end up in Error_Handler()

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

How do you know that?

Also note that your "ST-Link" is a clone - not a genuine ST product

My BOOT0 was High, bringing it to the LOW solved the issue, thanks for your answer @Community member​ . I wish you the best.:smiling_face_with_smiling_eyes:

And thans for other friends commended to my question.

@Mücahit HAMARAT​ - If that's resolved the issue, please mark the solution:

0693W000008y9fZQAQ.png