cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4 rs-232

A Bravos
Associate III
Posted on February 15, 2017 at 00:28

Good evening to the community.

I entered the world of stm32f4.At today I only worked on assembler with other micros.

I would like to know how to receive byte a byte from a pc, type passowrd, or how to receive numbers to change information.

Thank you all,

ABravos

5 REPLIES 5
Posted on February 15, 2017 at 03:11

So do you plan on doing assembler programming on the Cortex-M4, or do you plan to try coding in C?

 

 

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
A Bravos
Associate III
Posted on February 15, 2017 at 13:58

Good afternoon. I'm sorry for formalizing the issue. I'm new to C, I'm making some progress, but sometimes I have a lot of difficulties. The question is for C.

Posted on February 15, 2017 at 15:39

https://community.st.com/0D50X00009XkgXFSAZ

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
LMI2
Lead
Posted on February 16, 2017 at 20:36

I can also recommend you to download and test the Cube tool. There are some basic APIs for serial bus. When you find a suitable file like 'stm32f4xx_hal_uart.c', see what subroutines there are and Google them. For intance 'HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)'

You surely know that RS232 is UART with level shifters.

Posted on February 16, 2017 at 23:16

I had assumed the RS232 levels were familiar to a prior user of micro-controllers. The VCP on the NUCLEO obviates that somewhat. On the STM32F4-DISCO the use of a STM32F4-DIS-BB breakout board provide RS232 connectivity via USART6 PC6 and PC7.

Not sure if a specific target board has been chosen/used here. With more details better examples might be available.

The RXNE and TXE type status bits would be similar to other micros. Character reception can be stored into strings, and compared or parsed. C provides things like strcmp(), sscanf(), etc

For learning C a review of K&R would be a going starting point, although the implementation of getch() and scanf() might be more involved in embedded systems where board/chip specific support must be addressed.

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