|
自己DIY了一块STM32F042C6的DemoBoard。 一天突发奇想,想要把FreeRTOS移植到板子上。% h0 `# m2 _1 ~1 W/ C9 z" e# E 头一次移植,苦恼于网上找不断Keil CM0 下移植的直接例程,程序调试也老是在xTaskCreate失败。: b8 b* |1 @7 K: a/ ~& t" q 今天程序终于调好了,能够开始跑FreeRTOS了。0 T- r4 P2 ~) s2 w) a# q) j8 { 程序功能: 1.LED指示灯 i% J: f6 N0 b$ A. w# k 2.USART1 & USART2 中断接收,轮询发送 3.CAN 中断接收,轮询发送 ! s5 _$ Z% E! G" c% [4 q 4.RTC5 g1 B% }& B- v/ o $ T, h- { J1 ` 献上代码,请多指点。- t: Y' p9 ^# Q6 {5 G, R" \9 O 代码未经整理,比较乱,请各位看官见谅。(该文件可直接导入eclipse C/C++工程,方便浏览。)1 s4 q* U( m+ O8 o' ?
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)
--------------------------------------
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( uint32_t ) 48000000 ), f" X& X# f! A- ]# J
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 3400 ) ) /* 计算入Keil-ZI. */) F5 w3 i: T2 v) o, L/ K
#define configMAX_TASK_NAME_LEN ( 16 )' s! H2 K+ N/ L# I* v5 @
#define configUSE_TRACE_FACILITY 13 i( \8 p: v9 b' Q0 \
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 00 a5 @& t) |- c5 b5 a( A" R# K
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 15 Q \" Q, s/ ?/ h$ E
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */1 Q, A8 x, z8 e) @% o- Y
#define configUSE_CO_ROUTINES 0! @3 s. x8 u1 X/ a9 Q7 V
#define configMAX_CO_ROUTINE_PRIORITIES 22 g6 E/ _2 u& x! q/ S1 a
/* Software timer definitions. */
#define configUSE_TIMERS 1! d5 d8 W! F% o+ c. v, D+ A
#define configTIMER_TASK_PRIORITY ( 2 )' }7 ^" Q4 E3 T: ^, r+ Z5 ~3 z
#define configTIMER_QUEUE_LENGTH 5: R& R# u9 l' r# N& N6 ^
#define configTIMER_TASK_STACK_DEPTH ( 80 )$ V9 J% A; O: n) n0 ]+ l6 E/ W
/* Set the following definitions to 1 to include the API function, or zero. n0 l+ k* l# ~$ `* T/ {
to exclude the API function. */ Q+ i9 t, t1 e2 W, O6 c$ U0 [
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1+ q! B5 O. B1 c" Y/ {' a
#define INCLUDE_vTaskDelete 1( R: k: k2 @+ j* d2 Y7 P
#define INCLUDE_vTaskCleanUpResources 17 m/ L# t" I' \
#define INCLUDE_vTaskSuspend 16 L, i j) s* A* f6 I
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
' U! L y$ T. X7 m& h' ] G8 w
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */* ^( v* J3 K/ h( v f
#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)