1779 views|3 replies

1w

Posts

16

Resources
The OP
 

[NUCLEO-L452RE review] + Unpack and run FREERTOS [Copy link]

This post was last edited by ddllxxrr on 2020-12-10 21:13

It actually arrived yesterday, and my Cainiao Guoguo also showed it as arrived, but when I went to pick it up, I really didn't see it. I saw it today. I didn't stop. I took it out and showed it to the public.

It looks like the old NUClEO board. But this time I am confident that I will use KEIL MDK 5 plus STM32CUBEMX. Mainly to evaluate FREERTOS.

So I started working on it before the board arrived, and prepared two tools:

1. One is MDK PACK, install before downloading.

2. The other one is STM32CUBEMX, which is also installed.

STM32CUBEMX is very easy to use, just open the model of this board.

I turned on FREERTOS, enabled it, selected FREERTOS plus thread, and added a lighting thread for backup.

This board has STLINK, which has a virtual serial port, so the second one I send out is “HELLO EEWORLD!!!”

I checked the schematic:

Check the data sheet:

It can be seen that PA1 and PA2 are UART2, and these are the two pins in STM32CUBE (because I chose the board model).

I defined the second thread to always send "HELLO EEWORLD!!!"

I selected the generated code in STM32CUBEMX, and then added a few sentences to the thread to easily achieve it:

/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
  /* USER CODE BEGIN 5 */
  /* Infinite loop */
  for(;;)
  {
		HAL_UART_Transmit(&huart2,TxData,16,0xffff);//把TxData的内容通过uart2发送出去,长度是10,timeout的时间是最大值0xffff
    osDelay(10);
  }
  /* USER CODE END 5 */
}

/* USER CODE BEGIN Header_StartTask02 */
/**
* @brief Function implementing the myTask02 thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartTask02 */
void StartTask02(void const * argument)
{
  /* USER CODE BEGIN StartTask02 */
  /* Infinite loop */
  for(;;)
  {
    HAL_GPIO_WritePin(LD4_GPIO_Port, LD4_Pin, GPIO_PIN_RESET);
		osDelay(100);
		HAL_GPIO_WritePin(LD4_GPIO_Port, LD4_Pin, GPIO_PIN_SET);
		osDelay(100);
  }
  /* USER CODE END StartTask02 */
}

Here are the results of sending the thread:

At this time, the flashing light was also running, and FREERTOS was successfully run with NUCLEO for the first time.

To sum up, the reason why I was a little prejudiced against RTOS before was that it had to be ported. You know, it had to be assembled, and I was tired of assembling it back and forth, because if I was not careful, the program would be disabled when it started (there was something wrong with the assembly). So I didn't like all RTOS. Anyway, I didn't use it, but I could still live. Gradually, I became interested in KEIL RXT because it didn't need to be ported. But through this evaluation, I realized that after learning STM32CUBEMX well, FREERTOS also means no need for porting.

For an old stubborn person like me who only uses standard libraries for programming, this review has had a huge impact on me. I want to reconsider my future path.

This post is from stm32/stm8

Latest reply

Predefined BSP, thanks for sharing.   Details Published on 2020-12-11 14:24
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 

1942

Posts

2

Resources
2
 

STM32CubeMX also has a dedicated Nucleo board configuration.

This post is from stm32/stm8

Comments

Yes, as long as you choose the right development board, the pin definitions of basic functions are all on it, and you don’t need to set them yourself.  Details Published on 2020-12-11 13:41
 
 

1w

Posts

16

Resources
3
 
w494143467 Published on 2020-12-11 13:27 STM32CubeMX also has a special configuration for Nucleo boards.

Yes, as long as you choose the right development board, the pin definitions of basic functions are all on it, and you don’t need to set them yourself.

This post is from stm32/stm8
 
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 

7462

Posts

2

Resources
4
 

Predefined BSP, thanks for sharing.

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

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