Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


Problem: new socket

Posted by André Fernandes on January 26, 2010

I'm trying to implement the code below, but it stops in the line sock = socket(AF_INET, SOCK_DGRAM, 0);

the message is "sys_arch_timeouts: ptask != NULL"

the procedure sequence is:

-lwip_socket (type=0, protocol=100)
-alloc_socket (newcon=0x80173c)
-sys_sem_wait (sem=0x805ea8)
-sys_arch_timeouts ()
-sys_assert ()

I have already tried a TCP socket but got same problem.
I am using lwIP 1.3.0 and freeRTOS 5.3.0. uController: MCF51CN128.
Could anyone help me?

void test_UDP_send( void * pvParameters )

int sock;
struct sockaddr_in sLocalAddr, sDestAddr;
char reply[]="testing";
char buffer[1024];
int nbytes;

sock = socket(AF_INET, SOCK_DGRAM, 0);

memset((char *)&sLocalAddr, 0, sizeof(sLocalAddr));
memset((char *)&sDestAddr, 0, sizeof(sDestAddr));

sDestAddr.sin_family = AF_INET;
sDestAddr.sin_len = sizeof(sDestAddr);
sDestAddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
sDestAddr.sin_port = 1234;

sLocalAddr.sin_family = AF_INET;
sLocalAddr.sin_len = sizeof(sLocalAddr);
sLocalAddr.sin_addr.s_addr = htonl(INADDR_ANY);
sLocalAddr.sin_port = 1235;

bind(sock, (struct sockaddr *)&sLocalAddr, sizeof(sLocalAddr));


nbytes=lwip_recv(sock, buffer, sizeof(buffer),8);
if (nbytes>0){
lwip_sendto(sock, buffer, nbytes, 0, (struct sockaddr *)&sDestAddr, sizeof(sDestAddr));

lwip_sendto(sock, reply, sizeof(reply), 0, (struct sockaddr *)&sDestAddr, sizeof(sDestAddr));
vTaskDelay( 200 ); //some delay!


RE: Problem: new socket

Posted by Dave on January 27, 2010
I suggest posting your question to the lwip mailing list.

RE: Problem: new socket

Posted by André Fernandes on January 27, 2010
I did it. Thanks

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists