完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
为什么我的FreeRTOS只能创建两个任务,超出的就创建不成功?
static const char *task1name = "Task 1 is runningr"; static const char *task2name = "Task 2 is runningr"; static const char *task3name = "Task 3 is runningr"; void vTaskFunction(void *pvPara) { char *pcTaskname; pcTaskname = (char *)pvPara; while(1) { TCPApp_UartTx(pcTaskname,strlen(pcTaskname)); vTaskDelay(1000); } } int main(void) { /*!< At this stage the microcontroller clock setting is already configured to 120 MHz, this is done through SystemInit() function which is called from startup file (startup_STM32f2xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f2xx.c file */ System_Setup(); /* Initilaize the LwIP stack */ //// LwIP_Init(); /*start the comm serial task*/ vAltStartComTestTasks( COM_TEST_PRIO, 115200 ); /* Initialize tcp echo server */ // tcpecho_init(); #ifdef USE_DHCP /* Start DHCPClient */ xTaskCreate(LwIP_DHCP_task, "DHCPClient", configMINIMAL_STACK_SIZE * 2, NULL,DHCP_TASK_PRIO, NULL); #endif // xTaskCreate(tcpclient_task, "client", configMINIMAL_STACK_SIZE, NULL, LED_TASK_PRIO, NULL); xTaskCreate(vTaskFunction, "task1", 1000, (void *)task1name, 2, NULL); xTaskCreate(vTaskFunction, "task2", 1000, (void *)task2name, 2, NULL); xTaskCreate(vTaskFunction, "task3", 1000, (void *)task3name, 1, NULL); /* Start scheduler */ vTaskStartScheduler(); /* We should never get here as control is now taken by the scheduler */ while(1); } 串口只能按顺序打印出 Task 2 is running Task 1 is running Task 2 is running Task 1 is running Task 2 is running Task 1 is running |
|
相关推荐
1个回答
|
|
|
栈长度不够
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
651 浏览 0 评论
712 浏览 0 评论
STM32F405驱动DS1302时钟模块,输出时间错乱该怎么排查?
4375 浏览 2 评论
stm32f405rgt6驱动DS1302ZN出现时间错乱问题
3176 浏览 1 评论
stm32用fsmc读取ad7606采集数据,数据不变,只有开发版复位才更新数据
2629 浏览 0 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-10 04:31 , Processed in 0.676411 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
695