This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi all,
We are trying to do practice on some network functions in lwIP with FreeRTOS by using HDK of TMS570LC4357. For this purpose, we initially use a base project (linked by below) supported by Texas Instruments Teams.
Project Link Post : https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/799670 --> ( 7178.TMS570LC4357_FreeRTOS_LWIP.7z )
Enhanced Sight to Link : /cfs-file/__key/communityserver-discussions-components-files/312/4478.TMS570LC4357_5F00_FreeRTOS_5F00_LWIP.7z
Although, FreeRTOS and lwIP debugging and building successfully on our HDK, we are not able to pinging our device. These lines firing our ping proccess:
Here are HL_sys_main.c :
#include "HL_sys_common.h" #include "FreeRTOS.h" #include "os_task.h" #include "HL_het.h" #include "HL_gio.h" #include "HL_esm.h" #ifdef DEBUG void __error__(char *pcFilename, uint32_t ui32Line) { } #endif void vTask1(void *pvParameters); extern void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed char *pcTaskName ); extern void EMAC_LwIP_Main (uint8_t * emacAddress); xTaskHandle xTask1Handle; uint8 emacAddress[6U] = {0x00U, 0x08U, 0xEEU, 0x03U, 0xA6U, 0x6CU}; uint32 emacPhyAddress = 1U; int main(void) { esmREG->SR1[2] = 0xFFFFFFFFU; esmREG->SSR2 = 0xFFFFFFFF; esmREG->EKR = 0x0000000A; esmREG->EKR = 0x00000000; gioInit(); gioSetDirection(gioPORTB, 0xFFFF); gioSetDirection(hetPORT1, 0xFFFFFFFF); //HDK uses NHET for LEDs if (xTaskCreate(vTask1,"Task1", configMINIMAL_STACK_SIZE, NULL, ((configMAX_PRIORITIES-1)|portPRIVILEGE_BIT), &xTask1Handle) != pdTRUE) { while(1); } vTaskStartScheduler(); while(1); return 0; } void vTask1(void *pvParameters) { EMAC_LwIP_Main (emacAddress); #if 1 for(;;){ /* Taggle GIOB[6] with timer tick */ gioSetBit(gioPORTB, 6, gioGetBit(gioPORTB, 6) ^ 1); /* Taggle HET[1] with timer tick */ gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1); //LED on HDK, top left vTaskDelay(300); } #endif }
Here are reference official document that we are use about the issue:
https://www.ti.com/lit/an/spna239/spna239.pdf
Result :
I tried everything step by step such like using IPADDR_USE_STATIC, IPADDR_USE_DHCP and IPADDR_USE_AUTOIP in lwiplib.h. But it can not success lwIP_init and it is not pinging my device. Do you know why is this happening ?
Thank you for interests.
Hello,
Does the LWIP webserver example without freeRTOS work on your HDK?
Yes I am able to work lwIP webserver without FreeRTOS and successfully ping. But using network functionality in FreeRTOS task management is so important to do in TMS570LC4357 for me.
Thanks and Regards.
I understand. The example I posted worked well on my bench before. I don't have this setup at home now, so I am sorry I am not able to do test.
Did you change the MPU setting from cache write-back to cache write-through?
I am not able to do this change because project based on TMS570LC4357ZWT_FreeRTOS in HalCoGen. When I have tried to configure MPU settings, checkbox and configuration buttons that belong to MPU settgins, these grayed out for SRAM region (Region 3 Configuration).
After that, in the code side configuration I tried but does not work. (Before and after about code side configuration are below).
I download the project and used directly the configuration that set up by you. I am not able to give meaning why it doesn't work while it works for you.
By the way, I am able to Native FreeRTOS TCP and UDP libraries in my HDK for network functions. And we have build a communication infrustructure over lots of pc and it works successfully. However, it is so important for us to do analyzes about performence, confidentiality, integrity and availability. So, I am looking forwarding to your cooperations.
Thanks and regards.
Hello,
I am not sure if your MPU settings work or not. To check if the problem is caused theMPU setting or not, you can disable the cache and re-do the test.
The cache cache disabled through the HALCoGen->R5-MPU-PMU
I did not exactly understood what do you mean by saying "I am not sure if your MPU settings work or not.". However, I tried disable cache and re-done my tests. There is not successful result in this approach.
But I have to say something again, we tested FreeRTOS based network functionalities in our TMS570LC4357 HDK successfully. Target goal is to compare lwIP network functionalities and FreeRTOS network functionalities on TMS570LC4357. Then, determining suitable path for investing time about RTOS based network operations projects in our AI based start-up's communication part. Example project about FreeRTOS Network operation that we tried and succed is attached below as link :
Link : http://loszi.hu/works/ti_launchpad_freertos_demo/ :
Project : (Zipped CCS 6.2.0 project (network driver v0.4, FreeRTOS Labs 160919) [NEW].)
We tried lots of things implementing lwIP Network support and FreeRTOS Network support seperately. Result in lwIP Network support test is we are not even able to ping our device. Result in FreeRTOS Network support test is we are able to transfer our datas throughout our HDK and other devices in UDP Socket multicast, unicast communications. Also, TCP data transfer successfully completed in this case. But, we do not trust FreeRTOS Network support case in long term because of there is no officially supported "NetworkInterface.c" file that is available for Hercules devices in FreeRTOS v10.3.1. Also, there is no support for TCP network functions in previous versions of FreeRTOS v10.3.1.
So, it is so important in your cooperations.
Thanks and Regards.