|
自己DIY了一块STM32F042C6的DemoBoard。% _; U6 h1 v' k I" q. g 一天突发奇想,想要把FreeRTOS移植到板子上。5 {7 W$ K- }0 C0 O/ C 头一次移植,苦恼于网上找不断Keil CM0 下移植的直接例程,程序调试也老是在xTaskCreate失败。 今天程序终于调好了,能够开始跑FreeRTOS了。; g: S, O) s8 i, k 程序功能:- s) k& t$ \) z- v' K& C v 1.LED指示灯/ _7 W- v* r) i 2.USART1 & USART2 中断接收,轮询发送 3.CAN 中断接收,轮询发送 4 h: @( b" p$ @7 y 4.RTC 献上代码,请多指点。 c& _, c+ v0 N5 J9 ?0 C1 u 代码未经整理,比较乱,请各位看官见谅。(该文件可直接导入eclipse C/C++工程,方便浏览。)
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)
--------------------------------------( v% t- ^, G/ K+ X1 Q
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0 2 l" B3 z( N) O( K( A2 f. i
#define configCPU_CLOCK_HZ ( ( uint32_t ) 48000000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 ) & d+ T/ Y0 P& Q* H$ O) q
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 3400 ) ) /* 计算入Keil-ZI. */5 F' H3 A# l/ n, H1 N" B5 ]) l
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1. U& P. I0 J( W* Z& d
#define configUSE_16_BIT_TICKS 0( M9 T: `+ ]% Z8 ~: @+ V
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8( o5 |3 D% ^3 F. t1 H" n# L
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1+ b$ x$ [" P" D1 _/ r
#define configUSE_MALLOC_FAILED_HOOK 0( Q% J& S: C0 Y" g6 t$ v
#define configUSE_APPLICATION_TASK_TAG 07 X2 s @7 j$ F
#define configUSE_COUNTING_SEMAPHORES 1" e/ d1 d% W* L. w$ c
#define configGENERATE_RUN_TIME_STATS 08 L# m( \$ B$ f' |! D
/* Co-routine definitions. */& x* X1 |6 A: ]4 j# B, S. [
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES 2( V s% B* C; R% q+ X
/* Software timer definitions. */7 a3 E, V4 X. e
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( 2 )4 @; c+ J* c! J! `. g/ Q2 R
#define configTIMER_QUEUE_LENGTH 5& ]) Z$ m1 J- T: x: [
#define configTIMER_TASK_STACK_DEPTH ( 80 )
/* Set the following definitions to 1 to include the API function, or zero2 c9 f( ^ _: n' D8 l' ~
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1/ K+ {; e4 D* M: j& M
#define INCLUDE_uxTaskPriorityGet 10 C$ h B8 {1 K1 \) v8 `- R
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 1' [( a! V5 w) H" t' ^8 p
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
/* Normal assert() semantics without relying on the provision of an assert.h# i. A( W, u8 ?6 r! x
header file. */
#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)