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.
Hi, I'm trying to get the enet_lwip example code for the concerto working, and I seem to be getting stack corruption problems. Any suggestions?
Here's what I have been able to determine:
I get a NMI and Hardware Fault due to Instruction Access Violation
The offending address is an address within the stack (as pointed to by MMADR)
Contents of the offending address are always 0xfffffff9 with an adjacent 0xfffffffe (which would be invalid memory locations)
If I comment out lwip_init error never occurs
If I step through lwip_init error doesn't occur until after I exit the function and 'Run' the debugger
It would appear that the problem is occuring in a callback function, but I have not been able to get breakpoints in the callback functions to work (still trying that one)
As an aside, I also tried getting the uip example application working, but that has had it's own problems with needing to develop a .cmd file for the example. Either stack will work for my application, as I only need simple socket communications, but it would be nice to get some of the extras with lwip.
Thanks for any ideas or suggestions you can provide. Please let me know if there is any other information that could help debug the problem.
I'm running CCSV5.1, ControlSuite has v110 of the Concerto support files.
Andrew,
When do you get the hardware fault?
Are you able to obtain an IP address?
If you connect to the virtual serial port, you should see debug messages printing out while lwip gets an ip address.
Once I have more information, I will try to replicate your problem.
Also, did you make any changes to the example code?
Regards,
Alvaro
Alvaro,
I get the hardware fault 'randomly' during execution. I have not been able to isolate which function is causing the problem, as the PC is always pointing to a location in the stack, which has the two invalid memory addresses.
I do not believe I have obtained an IP address yet. When I look at the VCP I only see the "Waiting for IP Address..." message, and nothing further.
The only changes I made to the example code were to comment out the httpd_init() function and locator service function calls (there are 3 there). I was originally thinking the problem lay within those function calls since I could step execute up to that point. My suspicion is it's in one of the ip_input/ip_output function callbacks, but I have not been able to get breakpoints working in those functions.
Please let me know if there is anything you'd like me to try.
Regards,
Drew
Drew,
Unfortunately, I have been unable to reproduce the problem.
We can still try a few things though. If you can attach your project folder, I can try and compile it on my machine. Maybe it's just a bug present in a certain version of the compiler tools, so I'll try to replicate your setup as best as I can. If you have made any changes to the lwip library, I will need those too.
Other than that, we might be looking at a bad device.
Regards,
Alvaro
Alvaro,
I have exported my project from CCSV5. I would expect you can just import this into your CCSV5. Also, I have zipped up my f28m35x directory from C:\TI|controlSuite\device_support in case I made some change to the enet_lwip drivers and forgot that I made it. I have the latest updates of CCSV5.
Thanks for taking a look at this.
Drew
Drew,
I ran your code and was able to reproduce the hard fault.
As soon as I figure out what's causing it, I'll let you know.
Alvaro
Drew,
I tried your master_test project and it does break, but there are a few problems with it. Could you walk me through how you imported/created the project?
This should work with a fresh controlSUITE install:
In CCS, go to Project->Import Existing CCS Eclipse Project
Select search directory: C:\TI\controlSUITE\device_support\f28m35x\v110\F28M35x_examples_Master\enet_lwip
Import the enet_lwip project.
Without changing anything, build then debug and run.
Does that work?
Regards,
Alvaro
Alvaro,
To create the project, I had gone through the process detailed in the quick start guide to set up a M3/C2000 project. Master, I think they had called it. Then once I had the basic functions down, worked my way through importing the contents of the enet_lwip project. Linked what appeared to be the appropriate files, but I must have missed something along the way.
When importing the project, as you suggest, it works just fine. I will just use this as the basis for the rest of my project. Thanks for the assistance.
Drew
Hello,
I had also tried to implement a 'stand alone' project for the lwip and the concerto MCU. (I have CCS v4 not v5)
When doind this I realised that copying and linking/adding the files wasnt "enough".
Your error seems related to the C system stack size, is it not? If you check the Build Properties of your project, under TMS470 Linker -> Basic Options (for CCS v4) please verify that you have 1024 and not the 'default' 256 (or empty).
When making a new project allways check every option and path in the example's Project properties you're trying to copy/implement.
Hope this helps,
Rui