|
自己DIY了一块STM32F042C6的DemoBoard。2 x8 F$ K r- C3 f 一天突发奇想,想要把FreeRTOS移植到板子上。7 H# V- N: W! _7 F; ? 头一次移植,苦恼于网上找不断Keil CM0 下移植的直接例程,程序调试也老是在xTaskCreate失败。 今天程序终于调好了,能够开始跑FreeRTOS了。 程序功能: 1.LED指示灯 2.USART1 & USART2 中断接收,轮询发送( Y1 k8 T$ P5 k! b% c 3.CAN 中断接收,轮询发送 4.RTC " [+ s! |1 }1 F 献上代码,请多指点。% u9 z4 a3 g. N8 B- p0 n 代码未经整理,比较乱,请各位看官见谅。(该文件可直接导入eclipse C/C++工程,方便浏览。)8 @, k: q4 Q! @) W) C& B/ p, R9 d# u9 F
FreeRTOS-STM32CM0-Demo.rar
(592.1 KB, 下载次数: 855)
|
DMA 原理从 0 到 1:为什么它能解放 CPU?一文讲透 DMA 的工作流程
小白也能明白的STM32的低功耗与唤醒机制
STM32系统中2种数据掉电保护的方法
分享STM32F051中文参考手册(重制书签版)
AI工具训练营-用ChatGPT解决HID Keyboard实现的问题
STM32固件库分享,超全系列整理
STM32小白入门指南:从基础到OTA实现方案
STM32超详细学习笔记
新手必看!STM32单片机应该怎么学?
如果你解决了这些问题,就可以直接学STM32
微信公众号
手机版
RE:FreeRTOS V8.1.2移植到Cortex-M0(STM32F042C6)
--------------------------------------* m$ m$ n0 r1 L F" q ~
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0 9 x Y: g& g8 r7 @
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( uint32_t ) 48000000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) ) ~5 O `& E* x5 y4 Y! i
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) 8 o& l) y, W: ~
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 3400 ) ) /* 计算入Keil-ZI. */
#define configMAX_TASK_NAME_LEN ( 16 )# l; a* e3 K% b+ `+ b6 ^1 w
#define configUSE_TRACE_FACILITY 1* M: T2 U: @$ g/ j3 b% o
#define configUSE_16_BIT_TICKS 08 a0 q& L: p! R# W
#define configIDLE_SHOULD_YIELD 1, Q" s5 S5 |0 d& N
#define configUSE_MUTEXES 16 x' H+ o) f/ P5 g9 w2 y, u8 _
#define configQUEUE_REGISTRY_SIZE 85 M% P5 z3 ]. P o( ]3 r% E
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 0; y ], b0 \/ B
#define configUSE_APPLICATION_TASK_TAG 07 s" V! \: i# I
#define configUSE_COUNTING_SEMAPHORES 1
#define configGENERATE_RUN_TIME_STATS 05 U. |! }4 \' y
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 09 r! F4 g, B, l; I' [ n9 R, S* w
#define configMAX_CO_ROUTINE_PRIORITIES 2
/* Software timer definitions. */: m4 d | x9 e X8 x5 {* m
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 5" _4 N: D9 _& p( |5 A
#define configTIMER_TASK_STACK_DEPTH ( 80 )! H* c- f7 f$ i# v9 c
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1$ n3 P% A z$ L: S; M" C
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 1, h4 ^8 U" _. o+ M; Y+ o% I C
#define INCLUDE_vTaskSuspend 15 O7 t( j. q* ?
#define INCLUDE_vTaskDelayUntil 1! o7 Y. o* D+ H8 H
#define INCLUDE_vTaskDelay 1
/* Normal assert() semantics without relying on the provision of an assert.h% e5 {% ~8 g) e0 C ^
header file. */6 t0 h! p; c1 E5 g
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
RE:FreeRTOS V8.1.2移植到Cortex-M0(STM32F042C6)
RE:FreeRTOS V8.1.2移植到Cortex-M0(STM32F042C6)
RE:FreeRTOS V8.1.2移植到Cortex-M0(STM32F042C6)