Quality RTOS & Embedded Software

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




Loading

LWIP is not working when IRAM 10000000 is selected

Posted by nileshtha on March 18, 2015

Hi,

     I am using lpcopen_2_10_keil_iar_ea_devkit_1788(lpc1788 with 96k ram) free rtos code for communicating via tcip.In this keil project IRAM1 is selected from 0x20000000 with size 0x8000(32k)for lpc1788 cortex M3.If I am going to use more ram from 10000000 with size 0x10000 in keil project my rtos tasks are working but i am not getting any ip by dhcp.My tcpip part totally stop.Please give me any solution.  

Thanks & Regards

NILESH


LWIP is not working when IRAM 10000000 is selected

Posted by rtel on March 18, 2015

I'm afraid it would probably take a few hours familiarising myself with your application and stepping through the code to give you a solution, but I can make some suggestions...

Where is the lwIP RAM coming from? If it is the FreeRTOS heap then consider using heap_5.c as it allows you to spread the heap across multiple RAM regions - that is what I normally do on LPC devices.

Have you turned logging on in lwIP to see if any error messages pop out?

Have you determined if it is incoming or outgoing messages that are not working with lwIP.

I know some RAM on LPC devices has to be explicitly enabled to give application code access to it - have you done that if it is necessary in this case?

Regards.


LWIP is not working when IRAM 10000000 is selected

Posted by nileshtha on March 19, 2015

Hi,

Thanks for the reply.I am currently using ( lpcopen210keiliareadevkit1788applicationslpc17xx40xxkeiluvisionprojectseadevkit1788lwipwebserver_freertos )this example code..This code working fine and uses ram approximately 28k.My controller have 96 k ram and i want use local part of the ram for other purpose. but when i am selecting iram 10000000 with size 10000(64k) dhcp and tcp working stop.router not assigning the ip via dhcp to my embedded artist board.If i want to use other 64k ram then what i need to do?(I want to use Ethernet ram for Ethernet and other ram for my own purpose).If anyone know any setting for this example let me know please. I also attached example code with this letter.

thanks and regards Nilesh

Attachments


LWIP is not working when IRAM 10000000 is selected

Posted by rtel on March 19, 2015

I don't think this is a FreeRTOS related question. It is related to both lwIP and how to use the linker script and linker commands to use all the RAM on the device.

If you were using GCC then and the RAM on the chip was not in contiguous memory (which I don't think it is) then you would most likely need to place the variables into the RAM manually as the linker will not be able to do it very intelligently for you. If you are using IAR or Keil (I don't think you say) then the linker may have a better attempt at it.

If all the RAM is in contiguous memory then the linker would be able to do it all for you in any case.

Have a look at the user manual to determine if the RAM is in contiguous memory or not, and if not, whether you have to explicitly enable separate blocks before you can use them.

Regards.


LWIP is not working when IRAM 10000000 is selected

Posted by andymcc0 on March 20, 2015

The NXP LPC1788 Ethernet DMA engine requires the descriptors and the data buffers to be in the 32kB of Peripheral SRAM between 0x2000 0000 - 0x2000 7FFF. I found it easiest to do this explicitly, rather than using the linker.

/* AWM - A comment in the original LPCOpen code example from which this was developed, stated:
 * "The Ethernet Block can only access Peripheral SRAM and External Memory. In this example,
 * Peripheral SRAM is selected for storing descriptors, status arrays and send/receive buffers." 
 * so I am going to use the statically allocated BufferAllocation_1 method.
 * See vNetworkInterfaceAllocateRAMToBuffers() below for more detail */

#define ENET_RX_STAT_BASE        (0x20000000UL)		/* Base of peripheral RAM */
#define ENET_RX_DESC_BASE   (ENET_RX_STAT_BASE + ENET_NUM_RX_DESC * sizeof(ENET_RXSTAT_T))
#define ENET_TX_STAT_BASE   (ENET_RX_DESC_BASE + ENET_NUM_RX_DESC * sizeof(ENET_RXDESC_T))
#define ENET_TX_DESC_BASE   (ENET_TX_STAT_BASE + ENET_NUM_TX_DESC * sizeof(ENET_TXSTAT_T))
#define ENET_BUFFER_BASE    (ENET_TX_DESC_BASE + ENET_NUM_TX_DESC * sizeof(ENET_TXDESC_T))

The comment referred to is in enet.c in the periph_ethernet example. Then you use these #defines when setting up the buffers and descriptors. Note this was done for the FreeRTOS+TCP stack, not the lwip, but the principle should remain the same. I don't doubt that there are better ways to do this, but it worked for me.

Regards, Andy McC


LWIP is not working when IRAM 10000000 is selected

Posted by nileshtha on March 21, 2015

Hi,

Andy Thanks for the reply. I got my problem . When i am selected iram 10000000 that time Ethernet memory is allocated from local ram but for working it need to allocated from peripheral ram that's why its not working.In IAR if you want use local ram you need to write some command in #pragma..... then define the buffer or variable then end of the command.So you can allocated the memory from local ram.In keil anyone knows such command?This code (lpcopen210keiliareadevkit1788applicationslpc17xx40xxkeiluvisionprojectseadevkit1788lwipwebserver_freertos) alredy consume 28 k peripheral ram.If i want to allocated the the buffer of 10k from local ram then what i need to do in keil?If anyone knows about this thing let me know.


LWIP is not working when IRAM 10000000 is selected

Posted by rtel on March 21, 2015

I would suggest consulting the Keil documentation, and if you can't find it there, submitting a support request to Keil.

Regards.


LWIP is not working when IRAM 10000000 is selected

Posted by nileshtha on May 20, 2015

Hi,

I am using lpcopen210keiliareadevkit1788 free rtos code for communicating via tcip.In this project IRAM1 is selected from 0x20000000 with size 0x8000(32k).The heapsize in the scatter file is 0x6000.When I am define 4 tasks with configMINIMALSTACKSIZE=1000 bytes.I got an error freertos malloc failure.I am going to use both the tcp and udp sockets.my questions are given below please answer me if anyone know about this things. 1)How to use [b]sram(0x10000000 to 10010000=64K)[/b] to allocate the tasks size. 2)how can I use LWIPRAMHEAPPOINTERto allocate the heap memory from[b] sram(0x10000000 to 10010000=64K)[/b] of lpc1788. 3)if i made the changes in the[b] #define configTOTALHEAPSIZE ( ( sizet ) ( 0 ) ) [/b]there is no effect. 4)If I made the changes in the [b]#ifndef MEMSIZE #define MEMSIZE (12*1024)[/b] there is no effect. 5)currently I am using heap3.c.How i can use heap5.c to use multiple ram regions.


LWIP is not working when IRAM 10000000 is selected

Posted by davedoors on May 20, 2015

Dont know about lwip configuration but guess you can use the linker to place its memory in a named section that is at the address you need.

5)currently I am using heap3.c.How i can use heap5.c to use multiple ram regions.

Just replace heap3.c with heap5.c in the project. You will need to add the init call for heap5 also. If you use heap5 then any heap allocated by the linker can be removed so long as no other code calls malloc.


LWIP is not working when IRAM 10000000 is selected

Posted by nileshtha on May 21, 2015

I implement the heap_4.c and allocate the memory from sram of the lpc1788. It working fine but after some time 5-10mins my code stops executing and watchdog event occur and controller goes to reset.sometime its not goes to reset but it allocates the ip address again and again by dhcp.


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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