以下代码是我基于8962的FreeRTOS的demo程序的main函数而修改的。
1: TCP协议栈基于uIP, 在8962的板子上运行良好;
2: 然后移植到
9b96的板子上时,运行到创建vTask_uIP时,虽然返回值表示任务创建成功,但是该任务并没有执行。
任务中的打印消息没有,ping也
不通。
3: 然后我把这个函数vuIP_Task()直接放在main函数中调用,结果网络就通了,ping通,数据收发正常。
基于这个现象,是不是操作
系统的任务上下文切换没有进行?
我知道9B96的ROM上集成了
SafeRTOS, 但是我没有使用它,不知道我使用的FreeRTOS是
不是与这个有冲突?? 我觉得不应该吧。。
很困惑,求各位同行帮忙分析解决。。 代码信息不够的,我会再贴出来。
- int main( void )
- {
- signed taskResult;
- prvSetupHardware();
- /* Create the queue used by the OLED task. Messages for display on the OLED
- are received via this queue. */
- //xOLEDQueue = xQueueCreate( mainOLED_QUEUE_SIZE, sizeof( xOLEDMessage ) );
- /* 初始化串口 */
- InitUart();
- /* 初始化文件系统 */
- InitFatfs();
- /* Create the uIP task if running on a processor that includes a MAC and
- PHY. */
- if( SysCtlPeripheralPresent( SYSCTL_PERIPH_ETH ) )
- { /* 70 x 3 x 12*/
- taskResult = xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE*12, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
- if (taskResult == pdPASS)
- {
- UARTprintf("Create uIP Task Success!
");
- }
- else
- UARTprintf("Create uIP Task Failed!
");
- }
- /* Create SD_Card task --nike */ /* 70 x 3 x 6*/
- //xTaskCreate(vStartSDCardTasks, ( signed portCHAR * ) "SD_Card", mainBASIC_WEB_STACK_SIZE, NULL, 0, NULL );
- #if 0
- /* i2s play task */ /* 70 x 3 x 1*/
- xTaskCreate(vStartI2STasks, ( signed portCHAR * ) "I2s_play", mainBASIC_WEB_STACK_SIZE*3, NULL, 0, NULL );
-
- /* i2s record task */ /* 70 x 3 x 1*/
- xTaskCreate(i2s_record_task, ( signed portCHAR * ) "I2s_record", mainBASIC_WEB_STACK_SIZE*3, NULL, 0, NULL );
- #endif
- /* 初始化watchdog */
- InitWatchDog();
- /* 初始化PCF8563 */
- InitPCF8563();
- /* 按键中断测试例程 */
- GPIO_E_Test();
- /* 其他GPIO中断初始化 */
- /* The suicide tasks must be created last as they need to know how many
- tasks were running prior to their creation in order to ascertain whether
- or not the correct/expected number of tasks are running at any given time. */
- //vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
- /* Configure the high frequency interrupt used to measure the interrupt
- jitter time. The Keil port does not yet include the
- configKERNEL_INTERRUPT_PRIORITY functionality so cannot perform this test. */
- #ifndef RVDS_ARMCM3_LM3S102
- {
- vSetupTimer();
- }
- #endif
- /* Start the scheduler. */
- vTaskStartScheduler();
- /* Will only get here if there was insufficient memory to create the idle
- task. */
- return 0;
- }
此帖出自
小平头技术问答
一周热门 更多>