2017-02-14 03:28 PM
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
2017-02-14 06:11 PM
So do you plan on doing assembler programming on the Cortex-M4, or do you plan to try coding in C?
2017-02-15 04:58 AM
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.
2017-02-15 07:39 AM
https://community.st.com/0D50X00009XkgXFSAZ
2017-02-16 11:36 AM
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.
2017-02-16 03:16 PM
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.