How do I get the USART to work on an STM32C011?
I am relatively new to using the STM32 family and I am trying to use the USART on a STM32C011J4M6 device without success.
Initially I am just trying to send out a single character using the lines
uint8_t TxData[] = {'@'};
HAL_UART_Transmit(&huart1, TxData, 1, 10);after USART1 has been set up by CubeMX.
When it runs however, as soon as it tries to write to the Transmit Data Register, the processor resets. I have verified where it is going wrong by stepping through the disassembly - all the registers seem to be set up correctly but immediately on executing the STR instruction to write the character to 0x40013828 (USART1 TDR) it jumps to the reset handler.
I have been using STM32F042K6 and other devices up until now and the same code behaves correctly in those, exactly as expected.
I'm not sure what I am doing wrong so can anyone point to what it might be? If I remove the HAL_UART_Transmit() then the rest of the code runs (although it is just toggling a GPIO pin at the moment).
Thanks for any advice.
