AnsweredAssumed Answered

LD1 on the ST-Link board stays red?

Question asked by Adji Pramudito Arioputro on Dec 20, 2017
Latest reply on Dec 21, 2017 by Adji Pramudito Arioputro

Hey guys, I'm trying to do something that might be really a noobish thing (will ask in a different thread, and I recognize that there's a strange thing happening. I'm using an STM32 Nucleo64 L073RZ

 

I am trying to send a UART message by pressing the USER_BUTTON, and have programmed that through CubeMX with the MDK-ARM Keil v5 toolchain. There wasn't any failure during compiling nor when flash loading the program. However, I saw that even the "Blinking " action that I had programmed below didn't show on the main board.

 

If I just download the basic Blinky program from OS.Mbed compiler, it works just fine.

 

The strangest thing is, if I flash load the bin from Mbed online compiler, the LD1 will end with Green light (after flashing red/green) but with Keil, it stayed Red. Is that actually normal? Is there anyway I can debug this slowly?

 

Here's my code bit in Keil.

 

while(HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13)== 1) {
HAL_UART_Receive(&huart2, (uint8_t *) result, sizeof(result)-1,200);
} // Do nothing because button is not pressed

 

for (int i=0; i<5; i++){   //blinking sequence before transmitting the text
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
HAL_Delay(500);
}


HAL_UART_Transmit(&huart2, text, sizeof(text)-1,200); //When the button is pressed, it goes to here,
//then gets the handle for which UART, get the address of
//data to be sent "text", send the size of the data, and the timeout 20 ms.
while (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) == 0){}
}
/* USER CODE END 3 */

Outcomes