lpcware

USB Library debug using Keil V4.60

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by kwinchell on Tue Mar 26 06:01:06 MST 2013
I am using the Keil uvision SDK 4.60.0.0
I am trying to understand how the USB V0.98 is functioning. 
I built the Library for the MCB11U10 board to run the Generic HID Example.
I wanted to step through the process of CALLBACK_HID_Device_CreateHIDReport() getting called.
In the debugging session, I found it gets called by HID_Device_USBTask().

While examining the variables using the Keil debugger, the variables clearly had the wrong values.
After closer examination, I noticed the debugger was using the wrong addresses for the variables.

This initial SP was 0x10000430, and 0x10000400 on entry to HID_Device_USBTask().  Here is what I found:

Variable  Debug Adr  SP Access  Act Adr
=======================================
ReportId  100003FC   SP + 18   10000418
ReportINSize 003F8   SP + 14   10000414
ForceSend 100003F4   SP + 10   10000410
StatesChanged  3F0   SP + 0C   1000040C

It is like the debugger is using the wrong value for its SP.

Any Ideas?

Outcomes