{"id":1905,"date":"2023-07-23T05:47:44","date_gmt":"2023-07-23T05:47:44","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=1905"},"modified":"2023-07-23T05:47:47","modified_gmt":"2023-07-23T05:47:47","slug":"building-board-support-package-bsp-for-stm32f411-nucleo64-part8-uart-rx-in-interrupt-mode","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=1905","title":{"rendered":"Building Board Support Package (BSP) for STM32F411-Nucleo64 Part8: UART RX in interrupt mode"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-1024x683.jpeg\" alt=\"\" class=\"wp-image-1906\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-1024x683.jpeg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-300x200.jpeg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-768x512.jpeg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-1536x1024.jpeg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-2048x1365.jpeg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-1150x767.jpeg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-750x500.jpeg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-400x267.jpeg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2023\/07\/AdobeStock_128586024-6-250x167.jpeg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In this eighth part of Board Support Package, we shall develop interrupt driver for UART2 to receive a single character and toggle an LED to indicate that STM32 received the character.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall cover the following:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Developing the header file.<\/li><li>Developing the source code.<\/li><li>Main code.<\/li><li>Results.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Developing the header file:<\/h2>\n\n\n\n<p>From the previous guide about UART in TX and RX <a href=\"https:\/\/blog.embeddedexpert.io\/?p=1894\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=1894\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>For more information about how character reception in interrupt mode, please refer to this guide <a href=\"https:\/\/blog.embeddedexpert.io\/?p=347\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=347\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>Open uart_bsp.h.<\/p>\n\n\n\n<p>Declare the following enum which define the interrupt source and if the main interrupt is enabled or not:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">typedef enum\n{\n\tInterrupt_disabled=0, \/*No interrupt*\/\n\tInterrupt_Enabled=1, \/*Interrupt enabled*\/\n\n\tTXEIE_Enable=1, \/*Transmit buffer is empty*\/\n\tRXNEIE_Enable=1, \/*Receiver buffer is not empty*\/\n\tIDLEIE_Enable=1, \/*IDLE Line detection enabled*\/\n\n}Interrupt_Source_Typedef;<\/pre><\/div>\n\n\n\n<p>Since STM32F411 has three UART as following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>USART1.<\/li><li>USART2.<\/li><li>UART6.<\/li><\/ul>\n\n\n\n<p>We shall declare enum to handle which uart to be used as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">typedef enum\n{\n\tusart1=0,\n\tusart2=1,\n\tuart6=2,\n}USART_NumberTypedef;<\/pre><\/div>\n\n\n\n<p>This for enabling the interrupt in NVIC.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Within UART_ConfigTypedef datastruct, include the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\tuint8_t InterrupteEnbable;\n\tuint8_t TX_InterruptEnable;\n\tuint8_t RX_InterruptEnable;\n\tuint8_t IDLE_Line_Interrupt_Enable;\n\tuint8_t uart_number;<\/pre><\/div>\n\n\n\n<p>Hence, the updated data structure as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">typedef struct\n{\n\tuint32_t busSpeed;\n\tuint32_t buadRate;\n\tuint8_t mode;\n\tuint8_t InterrupteEnbable;\n\tuint8_t TX_InterruptEnable;\n\tuint8_t RX_InterruptEnable;\n\tuint8_t IDLE_Line_Interrupt_Enable;\n\tuint8_t uart_number;\n}UART_ConfigTypedef;<\/pre><\/div>\n\n\n\n<p>Thats all for the header file.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Developing the source code:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Open uart_bsp.c source file.<\/p>\n\n\n\n<p>Within this function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void BSP_UART_Init(USART_TypeDef *uart, UART_ConfigTypedef *config)<\/pre><\/div>\n\n\n\n<p>Before enabling the UART:<\/p>\n\n\n\n<p>Check if the interrupt is enabled or not:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">if (config-&gt;InterrupteEnbable==Interrupt_Enabled)<\/pre><\/div>\n\n\n\n<p>If it is enabled, enable the required one in NVIC:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">switch (config-&gt;uart_number)\n\t\t{\n\t\t\tcase usart2: NVIC_EnableIRQ(USART2_IRQn); break;\n\t\t\tcase usart1: NVIC_EnableIRQ(USART1_IRQn); break;\n\t\t\tcase uart6: NVIC_EnableIRQ(USART6_IRQn); break;\n\t\t\tdefault: break;\n\n\t\t}<\/pre><\/div>\n\n\n\n<p>Check which interrupts are needed:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\t\tif (config-&gt;TX_InterruptEnable==TXEIE_Enable)\n\t\t{\n\t\t\tuart-&gt;CR1|= USART_CR1_TXEIE;\n\t\t}\n\n\t\tif(config-&gt;RX_InterruptEnable==RXNEIE_Enable)\n\t\t{\n\t\t\tuart-&gt;CR1|= USART_CR1_RXNEIE;\n\t\t}\n\n\t\tif(config-&gt;IDLE_Line_Interrupt_Enable==IDLEIE_Enable)\n\t\t{\n\t\t\tuart-&gt;CR1|=USART_CR1_IDLEIE;\n\t\t}<\/pre><\/div>\n\n\n\n<p>Hence, the updated version of BSP_UART_Init as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void BSP_UART_Init(USART_TypeDef *uart, UART_ConfigTypedef *config)\n{\n\tswitch (config-&gt;mode)\n\t{\n\t\tcase UART_TX_Only: \tuart-&gt;CR1=USART_CR1_TE; break;\n\n\t\tcase UART_RX_Only:  uart-&gt;CR1=USART_CR1_RE; break;\n\n\t\tcase UART_TX_RX:\tuart-&gt;CR1=USART_CR1_RE|USART_CR1_TE; break;\n\n\t\tdefault : break;\n\t}\n\n\tuart_set_baudrate(uart, config-&gt;busSpeed, config-&gt;buadRate);\n\n\t\n\tif (config-&gt;InterrupteEnbable==Interrupt_Enabled)\n\t{\n\t\tswitch (config-&gt;uart_number)\n\t\t{\n\t\t\tcase usart2: NVIC_EnableIRQ(USART2_IRQn); break;\n\t\t\tcase usart1: NVIC_EnableIRQ(USART1_IRQn); break;\n\t\t\tcase uart6: NVIC_EnableIRQ(USART6_IRQn); break;\n\t\t\tdefault: break;\n\n\t\t}\n\n\t\tif (config-&gt;TX_InterruptEnable==TXEIE_Enable)\n\t\t{\n\t\t\tuart-&gt;CR1|= USART_CR1_TXEIE;\n\t\t}\n\n\t\tif(config-&gt;RX_InterruptEnable==RXNEIE_Enable)\n\t\t{\n\t\t\tuart-&gt;CR1|= USART_CR1_RXNEIE;\n\t\t}\n\n\t\tif(config-&gt;IDLE_Line_Interrupt_Enable==IDLEIE_Enable)\n\t\t{\n\t\t\tuart-&gt;CR1|=USART_CR1_IDLEIE;\n\t\t}\n\t}\n\n\n\tuart-&gt;CR1|= USART_CR1_UE;\n\n}<\/pre><\/div>\n\n\n\n<p>For the interrupt handler:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void USART1_IRQHandler(void)\n{\n\tuart1_interrupt_handler();\n\tNVIC_ClearPendingIRQ(USART1_IRQn);\n}\n\n\nvoid USART2_IRQHandler(void)\n{\n\tuart2_interrupt_handler();\n\tNVIC_ClearPendingIRQ(USART2_IRQn);\n}\n\nvoid USART6_IRQHandler(void)\n{\n\tuart6_interrupt_handler();\n\tNVIC_ClearPendingIRQ(USART6_IRQn);\n}\n<\/pre><\/div>\n\n\n\n<p>For interrupt handler to be implemented by the user:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">__WEAK void uart1_interrupt_handler(void){}\n__WEAK void uart2_interrupt_handler(void){}\n__WEAK void uart6_interrupt_handler(void){}<\/pre><\/div>\n\n\n\n<p>Thats all for the source code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Main code:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>In main.c:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#include &quot;bsp.h&quot;\n#include &quot;uart_bsp.h&quot;\n#include &quot;exti_bsp.h&quot;\n\nGPIO_Output_Typedef LED;\n\n\nvoid clock_config(void);\n\n\n\nint main()\n{\n\n\tclock_config();\n\n\tGPIOA_CLOCK_ENABLE();\n\tGPIOC_CLOCK_ENABLE();\n\n\tGPIO_Configure_Typedef LED_Config;\n\tLED_Config.PinNumber=pin5;\n\tLED_Config.Mode=OUTPUT;\n\tLED.pinNumber=pin5;\n\tGPIO_Initialization(GPIOA,&amp;LED_Config);\n\n\tGPIO_Configure_Typedef PA3_Config;\n\tPA3_Config.PinNumber=pin3;\n\tPA3_Config.Mode=Alternate_function;\n\tPA3_Config.AlternateType=AF7;\n\tGPIO_Initialization(GPIOA,&amp;PA3_Config);\n\n\tUART2_CLOCK_ENABLE();\n\n\tUART_ConfigTypedef uart;\n\n\tuart.buadRate=115200;\n\tuart.busSpeed=50000000;\n\tuart.mode=UART_RX_Only;\n\tuart.InterrupteEnbable=Interrupt_Enabled;\n\tuart.RX_InterruptEnable=RXNEIE_Enable;\n\tuart.uart_number=usart2;\n\tBSP_UART_Init(USART2,&amp;uart);\n\n\n\tBSP_Ticks_Init(100000000);\n\n\n\twhile(1)\n\t{\n\n\n\t}\n\n}\n\nvoid clock_config(void)\n{\n\tClock_Config_Typedef clockConfig;\n\n\tclockConfig.PLL_M= 4;\n\tclockConfig.PLL_N= 200;\n\tclockConfig.PLL_P= 4;\n\n\tclockConfig.AHB1Prescaler=AHB1_Prescaler1;\n\tclockConfig.APB1Prescaler=APB1_Prescaler2;\n\tclockConfig.APB2Prescaler=APB2_Prescaler1;\n\n\tclockConfig.clockSourc=External_Oscillator;\n\tclockConfig.flash_latency= Three_wait_state;\n\n\tClock_Configuration(&amp;clockConfig);\n}\n\nvoid uart2_interrupt_handler(void)\n{\n\tif (USART2-&gt;SR &amp; USART_SR_RXNE) \/*Check if the interrupt source is RXNE*\/\n\t{\n\t\t(void)USART2-&gt;DR;\t\t\t\/*Read the DR register to clear everything*\/\n\n\t\tGPIO_TogglePin(GPIOA,&amp;LED); \/*Toggle the LED to for character reception*\/\n\n\t}\n\n}\n<\/pre><\/div>\n\n\n\n<p>Since we are interested only in RX part, no need to declare the UART as full duplex.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Results:<\/h2>\n\n\n\n<p>Open any terminal program and set the buadrate to be 115200 and send any character and the built-in LED should toggle each time you send a character.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Board Support Package for STM32F411: UART Reception in interrupt mode\" width=\"1170\" height=\"658\" src=\"https:\/\/www.youtube.com\/embed\/JxxaheVwZOQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this eighth part of Board Support Package, we shall develop interrupt driver for UART2 to receive a single character and toggle an LED to indicate that STM32 received the character. In this guide, we shall cover the following: Developing the header file. Developing the source code. Main code. Results. 1. Developing the header file: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2,11,12],"tags":[],"class_list":["post-1905","post","type-post","status-publish","format-standard","hentry","category-data-structures","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1905"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1905"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1905\/revisions"}],"predecessor-version":[{"id":1907,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/1905\/revisions\/1907"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}