UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant sjg69
Participant
6,002 Views
Registered: ‎03-29-2012

Help: SDK functions returning bogus values

So I have a virtual filesystem in development which will eventually have multiple different types of driver, at the moment I'm just trying to get a memory-based one to work, to have something to use as a model for the other ones. Here's the fopen() code:

 

 Screen Shot 2016-06-07 at 9.22.19 AM.png

 

.. with the debugger stopped prior to calling into the code. When it jumps into the code ...

 

Screen Shot 2016-06-07 at 9.23.33 AM.png

 

... and has run through the VFS fopen function for the memory-based tmpfs, the variable 'ret' (of type FILE*) is:

 

Screen Shot 2016-06-07 at 9.25.06 AM.png

 

... note the address at the bottom. This is a valid address and we're all happy. On return from fopen() though, (so when I step to the next line in the first image, line 754) the address for 'fp' is different from what 'ret' returned...

 

Screen Shot 2016-06-07 at 9.27.29 AM.png

 

Any ideas ? I'm a bit lost at this point :(

 

For what it's worth, this code was all working on an STM32F4 prior to being ported to the Zynq ARM chip, so I'm reasonably sure the logic is ok. 

0 Kudos
1 Reply
Participant sjg69
Participant
5,993 Views
Registered: ‎03-29-2012

Re: Help: SDK functions returning bogus values

Ok, so it seems my problems were being caused by the call to 'taskStats' that you can see in the first image, which was corrupting the stack. I'd put that in to try and make sure my stack was ok (it was, I had 62k left) and not taken it out again. Somehow that call was messing up the stack because when I remove it, the function-returned values are all ok again. taskStats was pretty small though...

 

static void taskStats(void)
	{
	char buf[128];
	vTaskList(buf);
	printf("%s", buf);
	}

... so maybe the problem has just gone into hiding by having a function call removed... I guess I'll find out...

 

0 Kudos