Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner