No Optimization

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No Optimization

1,279 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jun 13 07:42:52 MST 2012
Does version 0.95 include an optimizable LPC1768 version?

Trying to optimize this huge example (Example_VirtualSerialDevice / LPCXpresso) leads to loss of USB (device manager doesn't recognize USB).
Labels (1)
0 Kudos
14 Replies

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Mon Sep 10 13:08:58 MST 2012
I take it back - I am having a problem with a bulk transfer endpoint where Endpoint_IsINReady() returns true even though it is not (and thus my IN buffer gets corrupted with 2 simultaneous transfers much of the time). For non-control endpoint transfers, that function checks the dmaDescriptor array. I'm trying to experiment, but how can I also make the ".Retired" values in the array's structs also volatile? Or is this a symptom of another problem?
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Thu Sep 06 17:48:09 MST 2012
This is the major issue for me: http://www.lpcware.com/content/forum/shared-memory-buffer-nxpusblib

All endpoints share a single buffer, making the library useless for using more than one endpoint at a time. I patched that too, see the end of that thread.
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxpUSBlib team on Thu Sep 06 13:15:00 MST 2012
Supporting compiler optimizations is scheduled for release 1.0 the end of October.  You mentioned some other 'show stoppers' - please cite the thread(s) or post them here.
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Wed Sep 05 13:04:00 MST 2012
Since there hasn't been any official response on this (and there are a few other showstopper bugs that haven't been fixed), I've started an nxpUSBlib repo on GitHub that includes the volatile patch. It's currently in the "volatile" branch: https://github.com/openxc/nxpUSBlib/tree/volatile .
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Thu Aug 30 09:58:39 MST 2012
Thanks, Zero - I wasted an hour on this before finding your earlier question and answer about marking the variables as volatile.
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by peplin on Thu Aug 30 09:57:46 MST 2012
Setting only these two variables to volatile made the device enumeration work for me again in my own project, using GNU ARM Embedded. I can't say if it fixes the other example because I haven't tried compiling any of the examples - no Makefiles, unfortunately.
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jun 19 06:58:28 MST 2012
Answering my own question:

No, version 0.95 (released yesterday) does not include an optimizable LPC1768 version.

Compiling with -Os failed again. Don't know if someone responsible is reading this (6 day old) comment, but anyway, writing a memo to myself to add volatiles in version 0.96,0.97,0.98... seems to be a good idea.

0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Jun 18 05:26:11 MST 2012
My actual test project (all project / lib opitimizations: -Os) seems to work without additional volatiles in DevStandardReq.
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vitah on Sun Jun 17 20:10:25 MST 2012
Hi Zero,

I tried these optimization and think we should only add volatile for variables isInready and isOutReceived in Endpoint_LPC17xx.c . How effectively when doing the same in DevStandardReq.c? Can you run the example without adding volatile to DevStandardReq.c?
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 15 00:48:39 MST 2012
Standard LPCXpresso 'Release' optimization -Or or -O2.
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vitah on Fri Jun 15 00:15:52 MST 2012
which optimization flag you are using?
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jun 14 15:53:11 MST 2012
I'm using LPCXpresso v4.2.3 [Build 292] [30/05/2012]
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxpUSBlib team on Thu Jun 14 15:48:43 MST 2012
Thank you for your observations and feedback. They are very much appreciated.

We should have been testing and releasing everything with optimization for size but this one slipped by us. We will alter our test and release procedures to accomodate this issue and fix bugs you found for the next release.

Would you mind telling us which compiler you are using?
0 Kudos

1,258 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jun 14 06:09:26 MST 2012
Answering my own question:

As usual, optimization fails because globals are not volatile.

Just adding volatile to globals in DeviceStandardReq.c and Endpoint_LPC17xx.h solved this issue.

So, nxpUSBlib team, would you please add more volatiles and/or test your nxpUSBlib with optimization?

In this case, optimization could reduce code size about 35%.
0 Kudos