Question
STM32L152RE NUCLEO board Uart problem
Posted on March 30, 2015 at 21:45
Hello All,
I'm a hobbyst, and recently bought a Nucleo evalboard with STM32L152RE MCU for experimenting the Cortec MCU from ST. I use the free/demo dev environment from keil(MDK V5).I also use the STMCUBE HAL library from ST. Here is the first question: Is the Cube a mature lib? is it widespread enough? will keil officially support it? After some very basic trial I wanted to try a uart funcionality of the nucleo board. here is the (relevant) content of the stm32l15xx_hal.msp.cvoid
HAL_UART_MspInit(UART_HandleTypeDef *huart){
GPIO_InitTypeDef gInit;
__GPIOB_CLK_ENABLE();
__USART1_CLK_ENABLE();
gInit.Pin = GPIO_PIN_6 | GPIO_PIN_7;
gInit.Mode = GPIO_MODE_AF_PP;
gInit.Pull = GPIO_NOPULL;
gInit.Speed = GPIO_SPEED_LOW;
gInit.Alternate = GPIO_AF7_USART1;
HAL_GPIO_Init(GPIOB,&gInit);
} here is the (relevant) content of themain.c
uHandle.Instance = USART1;
uHandle.Init.BaudRate = 9600;
uHandle.Init.WordLength = UART_WORDLENGTH_8B;
uHandle.Init.StopBits = UART_STOPBITS_1;
uHandle.Init.Parity = UART_PARITY_NONE;
uHandle.Init.Mode = UART_MODE_TX;
uHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
uHandle.Init.OverSampling = UART_OVERSAMPLING_16;
if
(HAL_UART_Init(&uHandle) != HAL_OK) Error_Handler();
/* Infinite loop */
while
(1)
{
HAL_UART_Transmit(&uHandle, txBuffer,
sizeof
(txBuffer), 1000);
}
I started a putty with same config and wait for the infinite datastream from my nucleo but I got nothing. when I try some snipetts from mbed.org those work fine, so the hardware drivers and any other thing than my program are set up properly. I spent days to get it work without success. so any help is appreciated.
last question :) when I debug the application with keil V5 the debug system offers only two virtual registers, where are the rest?
Thank you for your support,
Tom
#stm32l152re-nucleo-uart