Hi,
I am using CCS Version: 6.1.0.00104, tirtos_tivac_2_12_01_33, TivaWare_C_Series-2.1.1.71 on EK-TM4C1294XL baord.
I took HTTP Get Example from Demo. I have done the following modifications:
- Added a periodic timer to run at every 10 Sec.
- Created a static task 'usrTask' with priority as '-1'
- Whenever Timer expires it changes 'usrTask' priority to '1'.
- for 'usrTask' created function as 'usrTaskRt()'. This function calls netIPAddrHook() and than priority of 'usrTask' is set to '-1' again.
- there is no change in netIPAddrHook(). It creates HTTP task and do a GET request to get data from server.
I checked with HOSTNAME = api.openweathermap.org and REQUEST_URI = data/2.5/weather?q=London,uk. IP is resolved as IP = 162.243.58.21. Board is continuously doing GET requests, fetching data and displays it.
Than I created a local server which sends GMT time as unix time stamp. HOSTNAME = 192.168.0.100, REQUEST_URI = /app/service/time and IP = 192.168.0.100. Board is sending GET request and displays time. But after some executions I am getting Stack Overflow error as below:
l.Task: line 380: E_spOutOfBounds: Task 0x20000468 stack error, SP = 0x2000214c.
xdc.runtime.Error.raise: terminating execution
I only made changes in HOSTNAME, REQUEST_URI and IP there are no other changes in the code. Does anyone know why stack overflow is happening while communication with local server and not with api.openweathermap.org ? Also Increasing Stack Memory allocation is not solving problem.
And thing I observed is the time frame for Stack overflow is within 2-4 min time range irrespective of the Timer timeout settings. I changed timeout to 2 sec, 5 sec, 10 sec, 15 sec, 30 sec to verify but always above error is occurring in 2-4 min time frame.
Also if httpTask() is called as a function than HTTPCli_connect() always failing. So why httpTask() function requires to be called as a Task?
Attached is code, screen shot of the response from local server and api.openweathermap.org.
Thanks,
Bhavesh