Please specify also your country and your city, this are only for our personal statistics. Please send us an email and ask us the password for: USARTitNU030ATO That is all, now try you to insert a similar action using USART1. 86 and in the variable buffer_rx must contain the characters that you typed in TeraTerm window. Now type 10 characters in the TeraTerm, for example: Stop your program and restart it, on TeraTerm you must see something like below. ![]() Open TeraTerm and configure it as shown below. Next insert in the watch Expression tab the variable: buffer_rx Insert two breakpoint in the correspondence of the: HAL_UART_Transmit_IT(&huart2, buffer_tx, 10) Insert the lines below: HAL_UART_Receive_IT(&huart2, buffer_rx, 10) Void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) Insert the lines below: void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) Insert the lines below: uint8_t buffer_tx= ![]() Use FIREFOX or CHROME for a clear view of the images present in this web site.This project send a buffer (10 characters) via USART2 and receive a buffer (via USART2) from the PC (10 characters).Īfter the Cube-MX has generated the project, here there is the Cube-MX project, is necessary insert some lines of code for configura the call back and the USART. The USART1 is already configured for work under Interrupt but is not used. In this project we use only the USART2 because it is connected to the PC via the ST-LINK-v2 present on the NUCLEO-F030R8. This because the USART2 is transferred to the PC like a USB virtual com port. Thanks to Cube-MX is easy move this project on other STM32 mcu but also generate the same project for other IDE (KEIL, IAR, etc)įor use this project connect the NUCLEO-F030R8 to PC and use a terminal emulator, we suggest TeraTerm. This project was tested on NUCLEO-F030R8, was developed using the Cube-MX and the project is for ATOLLIC. In this example we use the Call Back modality. There are different possibility to use the UART under Interrupt, for instance use PRINTF but this mode use a loot of code or, more efficiency is to use the Call Back.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |