lwip socket APIs in bm

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

lwip socket APIs in bm

跳至解决方案
2,213 次查看
Devaharsha
Contributor III

Hi @kerryzhou,

The example modified for ethernet BSD-style socket creation and TCP/IP client server, based on your suggested document, the code is working fine. As the code or even the Sockets example uses FreeRTOS or in OS mode. 

Is there any possibility in using the same in Non OS mode or in bare metal? Or can the same be modified in the No OS Mode?

0 项奖励
回复
1 解答
2,163 次查看
Devaharsha
Contributor III

Hi

I have used PIT timer for 50micrsecond delay in interrupt mode. Used taskYeild() for forcefully switching the task. Its working fine. 

Thanks

Devaharsha

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,196 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

You can use the same code as bare metal just make sure all call from freertos.

Regards

0 项奖励
回复
2,185 次查看
Devaharsha
Contributor III

Hi,

The only calls I think are thread creation, semaphore creation & mailbox creation.  

My requirement is to have the task delay in microsecond. But the vTaskDelay() functions are based on ticks and it is calculated in milliseconds.

1) Is there any way to reduce vTaskDelay to microsecond delays?

2) If not, timers can be used for microsecond delays but the Ethernet code should be in bare metal/ firmware.

3) If not, the change I did was, simply to use Ethernet FreeRTOS code and replace creation of thread into function. But the code is going to Hard Fault at the time of socket creation?

#if 0

/* Initialize lwIP from thread */
if (sys_thread_new("main", stack_init, NULL, INIT_THREAD_STACKSIZE, INIT_THREAD_PRIO) == NULL)
LWIP_ASSERT("main(): Task creation failed.", 0); 

#endif

while(1)
{
    stack_init();
}

 

So, can you tell which method would be useful and for changing the code to bm, can you tell where exactly the change can be made?

 

Thanks

Devaharsha

0 项奖励
回复
2,164 次查看
Devaharsha
Contributor III

Hi

I have used PIT timer for 50micrsecond delay in interrupt mode. Used taskYeild() for forcefully switching the task. Its working fine. 

Thanks

Devaharsha

0 项奖励
回复