2460 views|3 replies

1w

Posts

16

Resources
The OP
 

[NUCLEO-L452RE Review] + FREERTOS (CMSIS-RTOS) Event [Copy link]

This post was last edited by ddllxxrr on 2021-1-3 10:43

As of today, I think FREERTOS is CMSIS-RTOS, but it depends on which operating system it encapsulates. In addition to FREERTOS, I have seen that it can also encapsulate Keil RTX that comes with MDK. But I only use CMSIS-RTOS.

After all, we have to stand on the shoulders of giants.

I looked at events today. I think MDK explains events very clearly. Each task has 16 event bits once it is created. There is no need to create any event identifiers.

But the event should be translated into EVENT in English, but CMSIS-RTOS defines it as the signal Semaphone of the signal flag, and STM32CUBE does not handle it well. It is just a framework.

There is no definition at all. I am a lazy person and I don't write anything if I can. But this event has no definition, so I wrote it myself:

Continue with the previous program:

1. Define a thread and send events to the default task in this thread.

2. After the default task is received, print out the quantity, that's all.

/* USER CODE END Header_StartTask02 */
void StartTask02(void const * argument)
{
  /* USER CODE BEGIN StartTask02 */
  /* Infinite loop */
  for(;;)
  {
    osDelay(1000);
		osSignalSet(defaultTaskHandle,0x01);
  }
  /* USER CODE END StartTask02 */
}

/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
  /* USER CODE BEGIN 5 */
	uint32_t count;
  /* Infinite loop */
  for(;;)
  {
    osSignalWait(0x01,osWaitForever);
		{
		count++;
		osDelay(1);
		LCD_ShowNum(10,80,count,5);
		}	
  }
  /* USER CODE END 5 */
}

The result is that a value plus 1 is displayed every minute.

After writing so much, I think FREERTOS (CMSIS-RTOS) is enough. As for how to use it, it is a combination of experience and failure. Maybe next time I will have to work on a mutex.

I don't think that thing is very useful in work, mutex is just to solve the priority inversion. I don't need it anyway.

This post is from stm32/stm8

Latest reply

CMSIS-RTOS has v1 and v2, which seem to be somewhat different. It is recommended to use v2   Details Published on 2021-1-6 21:34

赞赏

1

查看全部赞赏

Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 

1942

Posts

2

Resources
2
 

Awesome bro!

This post is from stm32/stm8
 
 

2w

Posts

74

Resources
3
 

Come on, come on

This post is from stm32/stm8
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
Personal signature

加油!在电子行业默默贡献自己的力量!:)

 

7422

Posts

2

Resources
4
 

CMSIS-RTOS has v1 and v2, which seem to be somewhat different. It is recommended to use v2

This post is from stm32/stm8
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list