heap_#.c switch issue and xPortGetFreeHeapSize

Hi, I have seen mention that you can change the heap file that is used. I am confused about how to do that. I am using Xilinx SDK with the FreeRTOS install that also included LWIP socket apps. I looked in the FreeRTOS repository directory and I think heap3.c is being used. I think when I generate the BSP and compile my application, heap3.c gets copied to my application subfolder. When I try to delete heap3.c and replace with heap4.c, I get errors when attempting to generate a new BSP or create a new one. Something seems to still be looking for heap_3.c Is there intructions anywhere on the proper way to switch what heap file is used? I really want to use xPortGetFreeHeapSize and it seems that doesn’t compile with heap_3.c Thanks, Jeff

heap_#.c switch issue and xPortGetFreeHeapSize

If you are building FreeRTOS as part of the BSP then the BSP will probably copy heap_3 back into the BSP directory even if you delete or replace it manually. You can change that behaviour, but only by going into the repository and manually editing the scripts that do the copying. An alternative is to build FreeRTOS as part of the application, rather than as part of the BSP. That way you can use whichever heap_n you choose to include. The demo described on the following link does that. The link describes where to locate the demo in the main FreeRTOS download, as well as providing instructions on importing and building the demo. http://www.freertos.org/RTOS-Xilinx-Zynq.html

heap_#.c switch issue and xPortGetFreeHeapSize

Thanks for your reply. Yes, I had been including FreeRTOS as part of the BSP. I’m not sure where the scripts are exactly that do the copying? I have the FreeRTOS demo, but am confused how to integrate FreeRTOS into a NEW application in my own workspace as opposed to using the demo which tells us to leave the code where it is and use as-is. Thanks.

heap_#.c switch issue and xPortGetFreeHeapSize

sorry, looks like this is informative…will read this: http://www.freertos.org/ProjectWorkspaceRelativeFilePaths_Eclipse.html

heap_#.c switch issue and xPortGetFreeHeapSize

I was able to bring FreeRTOS out of the BSP and into the main application using linked folders, however I did not have luck bringing the LWIP files into the main application, possibly because they are built to use FreeRTOS (this was from the sample application XAPP1026). I never was able to get the includes resolved. Is it possible for you to tell me how to switch the heap implementation manually in the BSP so that when it is copied to the main application, it is using heap4.c instead of heap3.c? Thanks, Jeff

heap_#.c switch issue and xPortGetFreeHeapSize

Just a quick reply for now, but the official demo in the download builds both FreeRTOS and lwIP as part of the application. It is provided to allow people to start with a know working configuration that they can then adapt to their own application.

heap_#.c switch issue and xPortGetFreeHeapSize

Just so I know we are talking about the same thing, the demo I had downloaded was for Xilinx Zynq (XAPP1026) and builds the FreeRTOS and LWIP as part of the BSP which then gets copied over into an application. I think it is part of the “contributed code” on FreeRTOS site under Xilinx. Maybe it can’t be modified easily to use heap_4.c

heap_#.c switch issue and xPortGetFreeHeapSize

Please review the following pages: http://www.freertos.org/RTOS-contributed-ports.html http://www.freertos.org/RTOS-Xilinx-Zynq.html

heap_#.c switch issue and xPortGetFreeHeapSize

Thanks! I am attempting to use the official Xilinx Zynq Cortex demo as you mentioned, but am having trouble with 1 thing. The demo works on my ZC706 but the LWIP has issues with my BSP which implements Ethernet differently than the ZC706 does. Now that the LWIP is part of the application, as opposed to the BSP, is there a preferred method to link up properly to my PL file/HWP/xparameters etc? For example, I noticed that the xtopologyg.c file under the LWIPport folder was still referring to a base address corresponding to XPARPS7ETHERNET0BASEADDR when it should be XPARPS7ETHERNET1BASEADDR. Seems like a disconnect. Should I be manually copying LWIP files over from when I included LWIP in the BSP? Thanks!

heap_#.c switch issue and xPortGetFreeHeapSize

I would suggest creating an lwIP BSP for your hardware using the SDK, then copy any relevant hardware files that are different between the two hardware platforms into the project (maybe only the xparameters.h file is needed?). Regards.

heap_#.c switch issue and xPortGetFreeHeapSize

I got it working thanks. I needed to rip out the full demo because it referenced some IP that was not included in our PL. Also, needed to copy over a LWIP generated topology file. Thanks!