UART example in the STM32cube not working for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-26 5:58 AM
Hello STM32 users,
I've received the STM32F401RE board and am trying to run a test program on it. I downloaded uVision5 and the STM32Cube_FW_F4_V1.9.0 and opened the UART project that came with the package. The ''DM00107720-Getting Started with STM32CubeF4 firmware package'' document says I can just run it on uVision5. I don't know much about the ARM architecture let alone S TM32. I see COM16 port is seen on my PC but when I debug run the program, a yello and bright green arrow is pointing the first line of the main() program which is HAL_init(); as in the image below. I can press F10 to proceed but when I cross the printf statement, nothing comes up on my teraterm windows. (set to use COM16, 9600,odd,8,1 as the USART setting in the program). I guess I'm missing something very basic. What is wrong with my case? regards, Thanks,Chan- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-26 6:14 AM
It's really using ODD parity?
Keil would need retargeting code where the fputc() actually implements the output to the specific USART.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-26 4:57 PM
Hi, clive1,
in the main.c file, it is defined as below. Isn't it correctly set already?#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
HAL_UART_Transmit(&UartHandle, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
Also, the USART is set as below (see odd parity).UartHandle.Instance = USARTx;
UartHandle.Init.BaudRate = 9600;
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_ODD;
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UartHandle.Init.Mode = UART_MODE_TX_RX;
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-30 3:11 AM
