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


I have problem with sam7x with udp

Posted by jonathan on March 16, 2007

I have modified the web demo sample to use udp protocol I have 2 task that wait on queues. I have also 1 udp connection. I use also the usb to emulate a joystick.

up to now i been able to do all i want. the usb part is working, the udp also.

BUT, some time, the os hangs. I don't know exactly why it hangs. I can run my software for 5 10 minutes, and he hangs. I have used the debugger to know where the program is, and he is loked up in this function :

unsigned portLONG ulEMACInputLength( void )

in this part of the function:

/* Walk through the descriptors until we find the last buffer for this
frame. The last buffer will give us the length of the entire frame. */
while( ( xRxDescriptors[ ulIndex ].addr & AT91C_OWNERSHIP_BIT ) && !ulLength )
ulLength = xRxDescriptors[ ulIndex ].U_Status.status & emacRX_LENGTH_FRAME;

/* Increment to the next buffer, wrapping if necessary. */
if( ulIndex >= NB_RX_BUFFERS )
ulIndex = 0;

I never get out from there. I would like to know if somebody have already had this issue.

btw i have test my software with lwip 1.1.0 and also with 1.2.0 and same thing happen.



RE: I have problem with sam7x with udp

Posted by embeddedc on March 16, 2007
The descriptors are automatically filled by the processor DMA. Something is getting corrupt in the RAM utilized by the DMA.

A fix would be to include some code to ensure that you don't loop more than once, and if you find yourself doing this resetting the descriptors to their default state. This would prevent your code hanging, but does not fix the cause of the problem, only the symptom. It would be better to find what is causes the corruption in the first place. Most likely thing would be a stack overflow (before anybody else says it).

RE: I have problem with sam7x with udp

Posted by jonathan on March 19, 2007
This is what i though.

When this happen, i don't received interrupt from the mac anymore.

Right now i use only 1 udp connection but i use it in 2 task. I will try to protect the connection with semaphore to see what happen.


RE: I have problem with sam7x with udp

Posted by jonathan on March 21, 2007
Ok i have found the problem

Protected the connection between both task is correcting some part of the problem.

The second is since we don't use the tcp at all, after the refresh of the arp table, the computeur cannot communicate with the arm7 because in the lwip sample from freertos, the broadcast bit is not set. So iu have change to accept the broadcast and now everything is working well.

I have also remove the caf bit to receive only the data that match our mac addr.

So thank-you for your help on that one.


[ 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