FreeRTOS tutorial on STM32

A High-density line of STM32 microcontrollers has quite many features that can be used in your programs. However, the more features you add to the source, the more complicated the program becomes, and it may become challenging to keep up with all things. Relying on the main loop and interrupts becomes a time-consuming task to manage.

If you do not want to struggle while tuning things up manually, you can use one of the best free real-time operating systems (RTOS). It is handy when you need many separate functions to run in parallel without missing a task. RTOS scheduler takes care of giving each task a required period to perform. There are many great RTOS systems around. Many of them are free and open source. Follow the FreeRTOS tutorial to see how easy it is to run complex tasks.

FreeRTOS demo task on STM32 microcontrolelr

I love using FreeRTOS, which has a long successful history and is flexible to fit multiple hardware types. You can check out my demo FreeRTOS tutorial on Atmega128. I also encourage you to give it a try for other RTOS systems like ChibiOS, BeRTOS, and others.

FreeRTOS is quite simple and easy to use. It has practically all of the features you may need for an RTOS. Some of the critical elements would include a preemptive, cooperative, and hybrid scheduler, task and co-routine support, queues, semaphores, and mutexes for task synchronization and communication. There are many demos, many ports (about 35 microcontrollers) to get started.

You can find a few of our demos for the STM32F103ZET6 board that controls LEDs, Buttons, USART, and LCD. We wrote some code using the main loop and interrupts for managing a few events. This is efficient and OK, while the program is simple. However, when your application grows big, it is better to start building it using RTOS to keep it manageable until the end.

FreeRTOS example for STM32

Follow this FreeRTOS tutorial on the STM32 microcontroller to see how it is easy to scale your project and still have full control of operations. First of all, we need to build a template that includes all necessary FreeRTOS source files. We need to import the FreeRTOS folder to our project tree.

Then we need to add FreeRTOSConfig.h file to the project where all RTOS configurations are set. The next thing is to match interrupts handlers for systick, SVC and PendSV interrupt. They are used by the scheduler and have a bit of different terminology. If you look at the port.c file you’ll see that it uses exception handlers:

voidxPortPendSVHandler( void ) __attribute__ (( naked ));
voidxPortSysTickHandler( void );
voidvPortSVCHandler( void ) __attribute__ (( naked ));

All we have to place them instead of

void SVC_Handler (void) __attribute__((weak));
void PendSV_Handler (void) __attribute__((weak));
void SysTick_Handler (void) __attribute__((weak));

In vector table where start-up code residues.

Before we start writing code, let’s configure FreeRTOS. To do so, we need to edit FreeRTOSConfig.h file contents. There are lots of them, but most important are the following:

#define configUSE_PREEMPTION 1
#define configCPU_CLOCK_HZ ( ( unsignedlong ) 72000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsignedshort ) 120 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1

Just a quick overview of these. We will use preemption, so we set it to 1, then we select the CPU clock rate, which is 72MHz, also we configure the tick timer, which means that the scheduler will run every 1ms.

Then we select a minimum stack size for a task and set a total heap size.

Our code is going to use task priorities, so we set vTaskPrioritySet to 1. Also, we are going to use vTaskDelay utilities that help with task timing. So we select them too.

There are a lot more settings you’ll find in the Config file. Many of them are self-explanatory, but checking their meaning before using them as setting one or another may significantly increase in ram or CPU usage.

Writing a FreeRTOS task routine

If you are familiar with the RTOS concept, you know that the program written for FreeRTOS is organized as a set of independent tasks. Each task normally is not directly related to other tasks and run within its context. Practically speaking, the task is a function with its own stack and runs a separate small program.

When multiple tasks are created, a scheduler switches between tasks according to assigned priorities. The task itself is a function with an endless loop, which never returns from it:

void vATaskFunction( void *pvParameters )
{
    for( ;; )
    {
        -- Task application code here. --
    }
}

I put all my tasks in separate source file mytasks.c (and mytasks.h).

Let’s write a simple LED flasher task. This is a basic routine that flashes LED every 1s. This is how the tasks look like:

void vLEDFlashTask( void *pvParameters )
{
  portTickType xLastWakeTime;
  const portTickType xFrequency = 1000;
  xLastWakeTime=xTaskGetTickCount();
    for( ;; )
    {
      LEDToggle(5);
      vTaskDelayUntil(&xLastWakeTime,xFrequency);
    }
}

To set the timing, we are using the vTaskDelayUntil function. FreeRTOS counts ticks every time scheduler is called (every 1ms by default). By setting the frequency value to 1000, we are getting a 1s delay.

Sending messages between FreeRTOS tasks

Another task can be checking the button state. To pass the button state, we do not need to use any global variables. It is better to keep the code modular and independent for better consistency and security.  FreeRTOS has unique means for this – binary semaphores. They are convenient when we need to send a binary value between tasks. In my example, I declared semaphore handlers for each button:

staticxSemaphoreHandle xButtonWakeupSemaphore = NULL;
staticxSemaphoreHandle xButtonTamperSemaphore = NULL;
staticxSemaphoreHandle xButtonUser1Semaphore = NULL;
staticxSemaphoreHandle xButtonUser2Semaphore = NULL;

Then within vButtonCheckTask before the main loop, I created all semaphores for later use:

vSemaphoreCreateBinary(xButtonWakeupSemaphore);
vSemaphoreCreateBinary(xButtonTamperSemaphore);
vSemaphoreCreateBinary(xButtonUser1Semaphore);
vSemaphoreCreateBinary(xButtonUser2Semaphore);

Adding more FreeRTOS tasks to the code

Once semaphores are created, we can start using them to send messages from one want FreeRTOS task to another. There are few special functions available for manipulating semaphores. In this tutorial, we are going to use two of them: Give and Take. When we check a button state, and if it was pressed, we give semaphore, which is setting the boolean value to ‘1’:

if (ButtonRead(BWAKEUPPORT, BWAKEUP)==pdTRUE)
       {
         count++;
         if(count==DEBOUNCECOUNTS)
           {
             xSemaphoreGive(xButtonWakeupSemaphore);
             count = 0;
           }
       }

Semaphores stay set until they are taken. Other tasks have to use the Take function to reset the semaphore. For this, I created another task which toggles a particular LED when the button is pressed:

void vButtonLEDsTask( void *pvParameters )
{
  portTickType xLastWakeTime;
  const portTickType xFrequency = 100;
  xLastWakeTime=xTaskGetTickCount();
  for( ;; )
  {
      if((xButtonWakeupSemaphore!=NULL))
      {
         if (xSemaphoreTake(xButtonWakeupSemaphore, (portTickType)10)==pdTRUE)
             {
               LEDToggle(1);
               //give semaphore back
               xSemaphoreGive(xButtonWakeupSemaphore);
             }
      }
    vTaskDelayUntil(&xLastWakeTime,xFrequency);
  }
}

Of course, in this shortened version of the task function, you can see how a single semaphore is taken. The If statement checks if semaphore was given. If the condition is met, then the LED is toggled. The XsemaphoreTake function also resets semaphore automatically.
As you can see, after toggling the LED I give semaphore back because I may also detect button press within another task – a vLCDTask:

void vLCDTask( void *pvParameters )
{
  extern uint8_t Image_Table[];
  portTickType xLastWakeTime;
  const portTickType xFrequency = 100;
  xLastWakeTime=xTaskGetTickCount();
  LCD_SetDisplayWindow(00, 00, 239, 319);
  LCD_Clear(Black);
  LCD_DisplayStringLine(Line4,  (char*)pcLCDTaskStartMsg, White, Black);
  for(;;)
    {
      if((xButtonWakeupSemaphore!=NULL)&&(xButtonTamperSemaphore!=NULL)
       &&(xButtonUser1Semaphore!=NULL)&&(xButtonUser2Semaphore!=NULL))
      {
         if (xSemaphoreTake(xButtonWakeupSemaphore, (portTickType)10)==pdTRUE)
             {
             LCD_Clear(Blue);
             LCD_WriteBMP_Dim(30, 30, 210, 210, Image_Table);
             }
      }
    vTaskDelayUntil(&xLastWakeTime,xFrequency);
    }
}

With button clicks, I trigger different things that are displayed on the LCD. You have to be careful when using such a technique because you can’t predict that the LCD task will be called exactly after the LED task. It can happen that first will be LCD task and therefore LED won’t be toggled as semaphore will be already taken. Probably, it would be better to create two semaphores for each task.

Thre USART task in FreeRTOS

The last task I included in this FreeRTOS tutorial is the USART task, which sends and receives messages via terminal. With USART, things start to be more complicated because we don’t want to miss any received character to ensure that all messages have been sent correctly. This can be achieved by using interrupt-based transferring. Doing this within the task where the scheduler runs every 1m would undoubtedly lead to data loss. Another issue is to ensure proper buffering so that the data could be retained until the task is called. Who knows, there might be 100 characters received before the task even runs and processes the data. So there is another helpful FreeRTOS feature – the queues. The queues are like predefined lengths buffers capable of storing any messages. To start using queues, we need to declare two queue handlers:

xQueueHandle RxQueue, TxQueue;

Where one is for receiving and another for transmitting, within a task, we can create both queues with xQueueCreate function, where we put queue length as the first parameter and size of the message, which, in our case, will be char size (8-bit).

void vUSARTTask( void *pvParameters )
{
  portTickType xLastWakeTime;
  const portTickType xFrequency = 50;
  xLastWakeTime=xTaskGetTickCount();
  char ch;
  // Create a queue capable of containing 128 characters.
  RxQueue = xQueueCreate( configCOM0_RX_BUFFER_LENGTH, sizeof( portCHAR ) );
  TxQueue = xQueueCreate( configCOM0_TX_BUFFER_LENGTH, sizeof( portCHAR ) );
  USART1PutString(pcUsartTaskStartMsg,strlen( pcUsartTaskStartMsg ));
  for( ;; )
  {
      //Echo back
      if (Usart1GetChar(&ch))
        {
          Usart1PutChar(ch);
        }
      vTaskDelayUntil(&xLastWakeTime,xFrequency);
  }
}

The Usart1GetChar function pulls char value out of the queue as follows:

uint32_t Usart1GetChar(char *ch){
  if(xQueueReceive( RxQueue, ch, 0 ) == pdPASS)
    {
      return pdTRUE;
    }
  return pdFALSE;
}

The Usart1PutChar FreeRTOS task sends char to queue:

uint32_t Usart1PutChar(char ch)
{
  if( xQueueSend( TxQueue, &ch, 10 ) == pdPASS )
    {
      USART_ITConfig(USART1, USART_IT_TXE, ENABLE);
      return pdTRUE;
    }else{
     return pdFAIL;
    }
}

The rest load is left for the interrupt handler, which responds to interrupt requests and sends bytes from TxQueue or receives and places them to RxQueue.

void USART1_IRQHandler(void)
{
  long xHigherPriorityTaskWoken = pdFALSE;
  uint8_t ch;
  //if Receive interrupt
  if (USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
    {
      ch=(uint8_t)USART_ReceiveData(USART1);
      xQueueSendToBackFromISR( RxQueue, &ch, &xHigherPriorityTaskWoken );
    }
  if (USART_GetITStatus(USART1, USART_IT_TXE) != RESET)
        {
      if( xQueueReceiveFromISR( TxQueue, &ch, &xHigherPriorityTaskWoken ) )
        {
          USART_SendData(USART1, ch);
        }else{
           //disable Transmit Data Register empty interrupt
           USART_ITConfig(USART1, USART_IT_TXE, DISABLE);
             }
        }
  portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}

It is necessary to know that special queue handling functions have to be used inside interrupt handlers, such as xQueueReceiveFromISR and xQueueSentoBackFromISR.

Running all FreeRTOs tasks in the main routine

Once all tasks a prepared, we can add them to the scheduler queue in our main source file:

//STM32F103ZET6 FreeRTOS Test
#include "stm32f10x.h"
//#include "stm32f10x_it.h"
#include "mytasks.h"
//task priorities
#define mainLED_TASK_PRIORITY          ( tskIDLE_PRIORITY )
#define mainButton_TASK_PRIORITY                   ( tskIDLE_PRIORITY )
#define mainButtonLEDs_TASK_PRIORITY                   ( tskIDLE_PRIORITY + 1 )
#define mainLCD_TASK_PRIORITY                   ( tskIDLE_PRIORITY )
#define mainUSART_TASK_PRIORITY                   ( tskIDLE_PRIORITY )
#define mainLCD_TASK_STACK_SIZE configMINIMAL_STACK_SIZE+50
#define mainUSART_TASK_STACK_SIZE configMINIMAL_STACK_SIZE+50
int main(void)
{
  //init hardware
  LEDsInit();
  ButtonsInit();
  LCD_Init();
  Usart1Init();
  xTaskCreate( vLEDFlashTask, ( signed char * ) "LED", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, NULL );
  xTaskCreate( vButtonCheckTask, ( signed char * ) "Button", configMINIMAL_STACK_SIZE, NULL, mainButton_TASK_PRIORITY, NULL );
  xTaskCreate( vButtonLEDsTask, ( signed char * ) "ButtonLED", configMINIMAL_STACK_SIZE, NULL, mainButtonLEDs_TASK_PRIORITY, NULL );
  xTaskCreate( vLCDTask, ( signed char * ) "LCD", mainLCD_TASK_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );
  xTaskCreate( vUSARTTask, ( signed char * ) "USART", mainUSART_TASK_STACK_SIZE, NULL, mainUSART_TASK_PRIORITY, NULL );
  //start scheduler
  vTaskStartScheduler();
  //you should never get here
  while(1)
    { }
}

The optimizing of the stack size for the FreeRTOS task

As you can see, we have created 5 tasks. Each of them has a priority level and stack size. The hardest part is defining proper stack size – if it’s too small, it may crash your program; if it’s too large, then we are wasting limited resources of the microcontroller. To detect stack overflow, you can use a particular function called

voidvApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName )

In this function, you can set up any indicators such as LED flash whenever stack overflow occurs. This way, you can leverage the stack size for the task and start over.

This FreeRTOS tutorial was written some time ago (updated in June 2019), and some parts of the code may be used differently today, according to the latest FreeRTOS builds.

Working source code from Codesourcery with Eclipse IDE is here: STM32F103ZET6FreeRTOS

xosotin chelseathông tin chuyển nhượngcâu lạc bộ bóng đá arsenalbóng đá atalantabundesligacầu thủ haalandUEFAevertonxosokeonhacaiketquabongdalichthidau7m.newskqbdtysokeobongdabongdalufutebol ao vivofutemaxmulticanaisonbethttps://bsport.fithttps://onbet88.ooohttps://i9bet.bizhttps://hi88.ooohttps://okvip.athttps://f8bet.athttps://fb88.cashhttps://vn88.cashhttps://shbet.atbóng đá world cupbóng đá inter milantin juventusbenzemala ligaclb leicester cityMUman citymessi lionelsalahnapolineymarpsgronaldoserie atottenhamvalenciaAS ROMALeverkusenac milanmbappenapolinewcastleaston villaliverpoolfa cupreal madridpremier leagueAjaxbao bong da247EPLbarcelonabournemouthaff cupasean footballbên lề sân cỏbáo bóng đá mớibóng đá cúp thế giớitin bóng đá ViệtUEFAbáo bóng đá việt namHuyền thoại bóng đágiải ngoại hạng anhSeagametap chi bong da the gioitin bong da lutrận đấu hôm nayviệt nam bóng đátin nong bong daBóng đá nữthể thao 7m24h bóng đábóng đá hôm naythe thao ngoai hang anhtin nhanh bóng đáphòng thay đồ bóng đábóng đá phủikèo nhà cái onbetbóng đá lu 2thông tin phòng thay đồthe thao vuaapp đánh lô đềdudoanxosoxổ số giải đặc biệthôm nay xổ sốkèo đẹp hôm nayketquaxosokq xskqxsmnsoi cầu ba miềnsoi cau thong kesxkt hôm naythế giới xổ sốxổ số 24hxo.soxoso3mienxo so ba mienxoso dac bietxosodientoanxổ số dự đoánvé số chiều xổxoso ket quaxosokienthietxoso kq hôm nayxoso ktxổ số megaxổ số mới nhất hôm nayxoso truc tiepxoso ViệtSX3MIENxs dự đoánxs mien bac hom nayxs miên namxsmientrungxsmn thu 7con số may mắn hôm nayKQXS 3 miền Bắc Trung Nam Nhanhdự đoán xổ số 3 miềndò vé sốdu doan xo so hom nayket qua xo xoket qua xo so.vntrúng thưởng xo sokq xoso trực tiếpket qua xskqxs 247số miền nams0x0 mienbacxosobamien hôm naysố đẹp hôm naysố đẹp trực tuyếnnuôi số đẹpxo so hom quaxoso ketquaxstruc tiep hom nayxổ số kiến thiết trực tiếpxổ số kq hôm nayso xo kq trực tuyenkết quả xổ số miền bắc trực tiếpxo so miền namxổ số miền nam trực tiếptrực tiếp xổ số hôm nayket wa xsKQ XOSOxoso onlinexo so truc tiep hom nayxsttso mien bac trong ngàyKQXS3Msố so mien bacdu doan xo so onlinedu doan cau loxổ số kenokqxs vnKQXOSOKQXS hôm naytrực tiếp kết quả xổ số ba miềncap lo dep nhat hom naysoi cầu chuẩn hôm nayso ket qua xo soXem kết quả xổ số nhanh nhấtSX3MIENXSMB chủ nhậtKQXSMNkết quả mở giải trực tuyếnGiờ vàng chốt số OnlineĐánh Đề Con Gìdò số miền namdò vé số hôm nayso mo so debach thủ lô đẹp nhất hôm naycầu đề hôm naykết quả xổ số kiến thiết toàn quốccau dep 88xsmb rong bach kimket qua xs 2023dự đoán xổ số hàng ngàyBạch thủ đề miền BắcSoi Cầu MB thần tàisoi cau vip 247soi cầu tốtsoi cầu miễn phísoi cau mb vipxsmb hom nayxs vietlottxsmn hôm naycầu lô đẹpthống kê lô kép xổ số miền Bắcquay thử xsmnxổ số thần tàiQuay thử XSMTxổ số chiều nayxo so mien nam hom nayweb đánh lô đề trực tuyến uy tínKQXS hôm nayxsmb ngày hôm nayXSMT chủ nhậtxổ số Power 6/55KQXS A trúng roycao thủ chốt sốbảng xổ số đặc biệtsoi cầu 247 vipsoi cầu wap 666Soi cầu miễn phí 888 VIPSoi Cau Chuan MBđộc thủ desố miền bắcthần tài cho sốKết quả xổ số thần tàiXem trực tiếp xổ sốXIN SỐ THẦN TÀI THỔ ĐỊACầu lô số đẹplô đẹp vip 24hsoi cầu miễn phí 888xổ số kiến thiết chiều nayXSMN thứ 7 hàng tuầnKết quả Xổ số Hồ Chí Minhnhà cái xổ số Việt NamXổ Số Đại PhátXổ số mới nhất Hôm Nayso xo mb hom nayxxmb88quay thu mbXo so Minh ChinhXS Minh Ngọc trực tiếp hôm nayXSMN 88XSTDxs than taixổ số UY TIN NHẤTxs vietlott 88SOI CẦU SIÊU CHUẨNSoiCauVietlô đẹp hôm nay vipket qua so xo hom naykqxsmb 30 ngàydự đoán xổ số 3 miềnSoi cầu 3 càng chuẩn xácbạch thủ lônuoi lo chuanbắt lô chuẩn theo ngàykq xo-solô 3 càngnuôi lô đề siêu vipcầu Lô Xiên XSMBđề về bao nhiêuSoi cầu x3xổ số kiến thiết ngày hôm nayquay thử xsmttruc tiep kết quả sxmntrực tiếp miền bắckết quả xổ số chấm vnbảng xs đặc biệt năm 2023soi cau xsmbxổ số hà nội hôm naysxmtxsmt hôm nayxs truc tiep mbketqua xo so onlinekqxs onlinexo số hôm nayXS3MTin xs hôm nayxsmn thu2XSMN hom nayxổ số miền bắc trực tiếp hôm naySO XOxsmbsxmn hôm nay188betlink188 xo sosoi cầu vip 88lô tô việtsoi lô việtXS247xs ba miềnchốt lô đẹp nhất hôm naychốt số xsmbCHƠI LÔ TÔsoi cau mn hom naychốt lô chuẩndu doan sxmtdự đoán xổ số onlinerồng bạch kim chốt 3 càng miễn phí hôm naythống kê lô gan miền bắcdàn đề lôCầu Kèo Đặc Biệtchốt cầu may mắnkết quả xổ số miền bắc hômSoi cầu vàng 777thẻ bài onlinedu doan mn 888soi cầu miền nam vipsoi cầu mt vipdàn de hôm nay7 cao thủ chốt sốsoi cau mien phi 7777 cao thủ chốt số nức tiếng3 càng miền bắcrồng bạch kim 777dàn de bất bạion newsddxsmn188betw88w88789bettf88sin88suvipsunwintf88five8812betsv88vn88Top 10 nhà cái uy tínsky88iwinlucky88nhacaisin88oxbetm88vn88w88789betiwinf8betrio66rio66lucky88oxbetvn88188bet789betMay-88five88one88sin88bk88xbetoxbetMU88188BETSV88RIO66ONBET88188betM88M88SV88Jun-68Jun-88one88iwinv9betw388OXBETw388w388onbetonbetonbetonbet88onbet88onbet88onbet88onbetonbetonbetonbetqh88mu88Nhà cái uy tínpog79vp777vp777vipbetvipbetuk88uk88typhu88typhu88tk88tk88sm66sm66me88me888live8live8livesm66me88win798livesm66me88win79pog79pog79vp777vp777uk88uk88tk88tk88luck8luck8kingbet86kingbet86k188k188hr99hr99123b8xbetvnvipbetsv66zbettaisunwin-vntyphu88vn138vwinvwinvi68ee881xbetrio66zbetvn138i9betvipfi88clubcf68onbet88ee88typhu88onbetonbetkhuyenmai12bet-moblie12betmoblietaimienphi247vi68clupcf68clupvipbeti9betqh88onb123onbefsoi cầunổ hũbắn cáđá gàđá gàgame bàicasinosoi cầuxóc đĩagame bàigiải mã giấc mơbầu cuaslot gamecasinonổ hủdàn đềBắn cácasinodàn đềnổ hũtài xỉuslot gamecasinobắn cáđá gàgame bàithể thaogame bàisoi cầukqsssoi cầucờ tướngbắn cágame bàixóc đĩa开云体育开云体育开云体育乐鱼体育乐鱼体育乐鱼体育亚新体育亚新体育亚新体育爱游戏爱游戏爱游戏华体会华体会华体会IM体育IM体育沙巴体育沙巴体育PM体育PM体育AG尊龙AG尊龙AG尊龙AG百家乐AG百家乐AG百家乐AG真人AG真人<AG真人<皇冠体育皇冠体育PG电子PG电子万博体育万博体育KOK体育KOK体育欧宝体育江南体育江南体育江南体育半岛体育半岛体育半岛体育凯发娱乐凯发娱乐杏彩体育杏彩体育杏彩体育FB体育PM真人PM真人<米乐娱乐米乐娱乐天博体育天博体育开元棋牌开元棋牌j9九游会j9九游会开云体育AG百家乐AG百家乐AG真人AG真人爱游戏华体会华体会im体育kok体育开云体育开云体育开云体育乐鱼体育乐鱼体育欧宝体育ob体育亚博体育亚博体育亚博体育亚博体育亚博体育亚博体育开云体育开云体育棋牌棋牌沙巴体育买球平台新葡京娱乐开云体育mu88qh88
xosotin chelseathông tin chuyển nhượngcâu lạc bộ bóng đá arsenalbóng đá atalantabundesligacầu thủ haalandUEFAevertonxosokeonhacaiketquabongdalichthidau7m.newskqbdtysokeobongdabongdalufutebol ao vivofutemaxmulticanaisonbethttps://bsport.fithttps://onbet88.ooohttps://i9bet.bizhttps://hi88.ooohttps://okvip.athttps://f8bet.athttps://fb88.cashhttps://vn88.cashhttps://shbet.atbóng đá world cupbóng đá inter milantin juventusbenzemala ligaclb leicester cityMUman citymessi lionelsalahnapolineymarpsgronaldoserie atottenhamvalenciaAS ROMALeverkusenac milanmbappenapolinewcastleaston villaliverpoolfa cupreal madridpremier leagueAjaxbao bong da247EPLbarcelonabournemouthaff cupasean footballbên lề sân cỏbáo bóng đá mớibóng đá cúp thế giớitin bóng đá ViệtUEFAbáo bóng đá việt namHuyền thoại bóng đágiải ngoại hạng anhSeagametap chi bong da the gioitin bong da lutrận đấu hôm nayviệt nam bóng đátin nong bong daBóng đá nữthể thao 7m24h bóng đábóng đá hôm naythe thao ngoai hang anhtin nhanh bóng đáphòng thay đồ bóng đábóng đá phủikèo nhà cái onbetbóng đá lu 2thông tin phòng thay đồthe thao vuaapp đánh lô đềdudoanxosoxổ số giải đặc biệthôm nay xổ sốkèo đẹp hôm nayketquaxosokq xskqxsmnsoi cầu ba miềnsoi cau thong kesxkt hôm naythế giới xổ sốxổ số 24hxo.soxoso3mienxo so ba mienxoso dac bietxosodientoanxổ số dự đoánvé số chiều xổxoso ket quaxosokienthietxoso kq hôm nayxoso ktxổ số megaxổ số mới nhất hôm nayxoso truc tiepxoso ViệtSX3MIENxs dự đoánxs mien bac hom nayxs miên namxsmientrungxsmn thu 7con số may mắn hôm nayKQXS 3 miền Bắc Trung Nam Nhanhdự đoán xổ số 3 miềndò vé sốdu doan xo so hom nayket qua xo xoket qua xo so.vntrúng thưởng xo sokq xoso trực tiếpket qua xskqxs 247số miền nams0x0 mienbacxosobamien hôm naysố đẹp hôm naysố đẹp trực tuyếnnuôi số đẹpxo so hom quaxoso ketquaxstruc tiep hom nayxổ số kiến thiết trực tiếpxổ số kq hôm nayso xo kq trực tuyenkết quả xổ số miền bắc trực tiếpxo so miền namxổ số miền nam trực tiếptrực tiếp xổ số hôm nayket wa xsKQ XOSOxoso onlinexo so truc tiep hom nayxsttso mien bac trong ngàyKQXS3Msố so mien bacdu doan xo so onlinedu doan cau loxổ số kenokqxs vnKQXOSOKQXS hôm naytrực tiếp kết quả xổ số ba miềncap lo dep nhat hom naysoi cầu chuẩn hôm nayso ket qua xo soXem kết quả xổ số nhanh nhấtSX3MIENXSMB chủ nhậtKQXSMNkết quả mở giải trực tuyếnGiờ vàng chốt số OnlineĐánh Đề Con Gìdò số miền namdò vé số hôm nayso mo so debach thủ lô đẹp nhất hôm naycầu đề hôm naykết quả xổ số kiến thiết toàn quốccau dep 88xsmb rong bach kimket qua xs 2023dự đoán xổ số hàng ngàyBạch thủ đề miền BắcSoi Cầu MB thần tàisoi cau vip 247soi cầu tốtsoi cầu miễn phísoi cau mb vipxsmb hom nayxs vietlottxsmn hôm naycầu lô đẹpthống kê lô kép xổ số miền Bắcquay thử xsmnxổ số thần tàiQuay thử XSMTxổ số chiều nayxo so mien nam hom nayweb đánh lô đề trực tuyến uy tínKQXS hôm nayxsmb ngày hôm nayXSMT chủ nhậtxổ số Power 6/55KQXS A trúng roycao thủ chốt sốbảng xổ số đặc biệtsoi cầu 247 vipsoi cầu wap 666Soi cầu miễn phí 888 VIPSoi Cau Chuan MBđộc thủ desố miền bắcthần tài cho sốKết quả xổ số thần tàiXem trực tiếp xổ sốXIN SỐ THẦN TÀI THỔ ĐỊACầu lô số đẹplô đẹp vip 24hsoi cầu miễn phí 888xổ số kiến thiết chiều nayXSMN thứ 7 hàng tuầnKết quả Xổ số Hồ Chí Minhnhà cái xổ số Việt NamXổ Số Đại PhátXổ số mới nhất Hôm Nayso xo mb hom nayxxmb88quay thu mbXo so Minh ChinhXS Minh Ngọc trực tiếp hôm nayXSMN 88XSTDxs than taixổ số UY TIN NHẤTxs vietlott 88SOI CẦU SIÊU CHUẨNSoiCauVietlô đẹp hôm nay vipket qua so xo hom naykqxsmb 30 ngàydự đoán xổ số 3 miềnSoi cầu 3 càng chuẩn xácbạch thủ lônuoi lo chuanbắt lô chuẩn theo ngàykq xo-solô 3 càngnuôi lô đề siêu vipcầu Lô Xiên XSMBđề về bao nhiêuSoi cầu x3xổ số kiến thiết ngày hôm nayquay thử xsmttruc tiep kết quả sxmntrực tiếp miền bắckết quả xổ số chấm vnbảng xs đặc biệt năm 2023soi cau xsmbxổ số hà nội hôm naysxmtxsmt hôm nayxs truc tiep mbketqua xo so onlinekqxs onlinexo số hôm nayXS3MTin xs hôm nayxsmn thu2XSMN hom nayxổ số miền bắc trực tiếp hôm naySO XOxsmbsxmn hôm nay188betlink188 xo sosoi cầu vip 88lô tô việtsoi lô việtXS247xs ba miềnchốt lô đẹp nhất hôm naychốt số xsmbCHƠI LÔ TÔsoi cau mn hom naychốt lô chuẩndu doan sxmtdự đoán xổ số onlinerồng bạch kim chốt 3 càng miễn phí hôm naythống kê lô gan miền bắcdàn đề lôCầu Kèo Đặc Biệtchốt cầu may mắnkết quả xổ số miền bắc hômSoi cầu vàng 777thẻ bài onlinedu doan mn 888soi cầu miền nam vipsoi cầu mt vipdàn de hôm nay7 cao thủ chốt sốsoi cau mien phi 7777 cao thủ chốt số nức tiếng3 càng miền bắcrồng bạch kim 777dàn de bất bạion newsddxsmn188betw88w88789bettf88sin88suvipsunwintf88five8812betsv88vn88Top 10 nhà cái uy tínsky88iwinlucky88nhacaisin88oxbetm88vn88w88789betiwinf8betrio66rio66lucky88oxbetvn88188bet789betMay-88five88one88sin88bk88xbetoxbetMU88188BETSV88RIO66ONBET88188betM88M88SV88Jun-68Jun-88one88iwinv9betw388OXBETw388w388onbetonbetonbetonbet88onbet88onbet88onbet88onbetonbetonbetonbetqh88mu88Nhà cái uy tínpog79vp777vp777vipbetvipbetuk88uk88typhu88typhu88tk88tk88sm66sm66me88me888live8live8livesm66me88win798livesm66me88win79pog79pog79vp777vp777uk88uk88tk88tk88luck8luck8kingbet86kingbet86k188k188hr99hr99123b8xbetvnvipbetsv66zbettaisunwin-vntyphu88vn138vwinvwinvi68ee881xbetrio66zbetvn138i9betvipfi88clubcf68onbet88ee88typhu88onbetonbetkhuyenmai12bet-moblie12betmoblietaimienphi247vi68clupcf68clupvipbeti9betqh88onb123onbefsoi cầunổ hũbắn cáđá gàđá gàgame bàicasinosoi cầuxóc đĩagame bàigiải mã giấc mơbầu cuaslot gamecasinonổ hủdàn đềBắn cácasinodàn đềnổ hũtài xỉuslot gamecasinobắn cáđá gàgame bàithể thaogame bàisoi cầukqsssoi cầucờ tướngbắn cágame bàixóc đĩa开云体育开云体育开云体育乐鱼体育乐鱼体育乐鱼体育亚新体育亚新体育亚新体育爱游戏爱游戏爱游戏华体会华体会华体会IM体育IM体育沙巴体育沙巴体育PM体育PM体育AG尊龙AG尊龙AG尊龙AG百家乐AG百家乐AG百家乐AG真人AG真人<AG真人<皇冠体育皇冠体育PG电子PG电子万博体育万博体育KOK体育KOK体育欧宝体育江南体育江南体育江南体育半岛体育半岛体育半岛体育凯发娱乐凯发娱乐杏彩体育杏彩体育杏彩体育FB体育PM真人PM真人<米乐娱乐米乐娱乐天博体育天博体育开元棋牌开元棋牌j9九游会j9九游会开云体育AG百家乐AG百家乐AG真人AG真人爱游戏华体会华体会im体育kok体育开云体育开云体育开云体育乐鱼体育乐鱼体育欧宝体育ob体育亚博体育亚博体育亚博体育亚博体育亚博体育亚博体育开云体育开云体育棋牌棋牌沙巴体育买球平台新葡京娱乐开云体育mu88qh88

5 Comments:

  1. پروژه الکترونیک

    Really amazing!

    I work with STM32F103RBT6 chip and will try this,
    although its RAM is 20 kB.

    Thank you

  2. thank you for your good work
    i am working on stm32rbt6 and i am using freertos.there were many concepts in defining and using freertos on a project.for example when you define a task and you expect that it works regularly , you must set scheduler setting for type of doing this task.
    i have got some questions:
    1.how can i set the timing for doing my tasks?

    in freertos , interrupts and semaphores are coupled together and everytime i want to use ISR , i must set semaphores to handle it.

    2.can you explain the way we set sempahores to achieve good performance of ISR?

    i want to launch an alphanumerical LCD to freertos . i have designed a lcd.c and added it to freertos stm32 based project in lcd task but it doesnt play the defined tasks.

    3.how can we define the scheduler for doing tasks that we define it ourself?

  3. Thank you very much, excelent work!

  4. Can u please help me to write a task in RTOS for blinking LED. I am having STM32F microcontroller and am using STM324*G-Eval folder from free rtos

  5. Hi ,
    Good work !!
    But i still have few questions :

    1- Why to use 2 queues instead of only one queue because we can send data from isr to rxqueue then we can get it back from this same rxqueue to transmit it via uart ?

    2- Which priority have you chosen for the uart ? The lowest one meaning 15 ??

    3- I get a problem with this function : if(xQueueReceive( RxQueue, ch, 0 ) == pdPASS) . I could never get the pdPASS as result . What could be the problem ?

    Thanks again,

Leave a Reply