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




Loading

init(netif) doesn't exist in IwIP 1.1.0?

Posted by Nobody/Anonymous on October 18, 2006
I tried to compile the SAM7 Rowley Web Demo(IwIP) but the board's Ethernet didn't show any signs of life.The other tasks seems to work O.K. After some search in the code and a few debug msgs on UART I found that the source of the problem was the code below:
In file netif.c

/* call user specified initialization function for netif */
if (init(netif) != ERR_OK) {
return NULL;
}

The code simply stuck here when the init(netif) is called. In project's .elf file it jumps to an address that it doesn't seem to have any meaning:

4718 bx r3
46C0 mov r8, r8
*
*/
void
pbuf_init(void)
{
B5F0 push {r4-r7, lr}
struct pbuf *p, *q = NULL;
u16_t i;
pbuf_pool = (struct pbuf *)&pbuf_pool_memory[0];
4810 ldr r0, [pc, #0x040]
4B10 ldr r3, [pc, #0x040]
6018 str r0, [r3, #0x00]
LWIP_ASSERT("pbuf_init: pool aligned", (mem_ptr_t)pbuf_pool % MEM_ALIGNMENT == 0);
#if PBUF_STATS
lwip_stats.pbuf.avail = PBUF_POOL_SIZE;
4910 ldr r1, [pc, #0x040]
2204 movs r2, #0x04
23A8 movs r3, #0xa8.........

Maybe the compiler is trying to change mode Thumb-->ARM? I really don't understand.

I searched a bit but I couldn't find where's the function's code. Any clues anyone? Did anybody have the same problem?

RE: init(netif) doesn't exist in IwIP 1.1.0?

Posted by Nobody/Anonymous on October 18, 2006
init() is a callback function supplied as a parameter to netif_add(). In the lwIP demo, init calls ethernetif_init() which is a standard lwIP function. ethernetif_init() in turn calls low_level_init() which is where the MAC/PHY initialisation specific to the hardware is performed. This will be where you code is not returning from, it contains the following loop:

while( xEMACInit() == NULL )
{
__asm( "NOP" );
}

which it runs at a low priority (so the other tasks continue to run while it is waiting for the MAC/PHY initialisation to complete).

RE: init(netif) doesn't exist in IwIP 1.1.0?

Posted by Nobody/Anonymous on October 18, 2006
Thank you very much for the help I do appriciate that,but you didn't tell me where's the init's code.

RE: init(netif) doesn't exist in IwIP 1.1.0?

Posted by Nobody/Anonymous on October 18, 2006
You can just search the source code for xEMACInit or low_level_init then you find it. it all under demo/lwIP_Demo_Rowley_ARM7.


[ 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