完善资料让更多小伙伴认识你,还能领取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个回答
|
|
栈长度不够
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1168 浏览 0 评论
AD7686芯片不传输数据给STM32,但是手按住就会有数据。
1105 浏览 2 评论
2203 浏览 0 评论
如何解决MPU-9250与STM32通讯时,出现HAL_ERROR = 0x01U
1297 浏览 1 评论
hal库中i2c卡死在HAL_I2C_Master_Transmit
1718 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 01:42 , Processed in 0.488433 second(s), Total 71, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号