This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:software:debugging [2010/09/22 23:17] – 84.181.56.43 | en:software:debugging [2016/08/18 11:27] (current) – gelöscht stefan | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Debugging ====== | ||
| - | Th EZ-USB SDK includes no source level debugger. But in order to simplify the troubleshooting | ||
| - | an easy to use debug helper interface has been implemented. | ||
| - | |||
| - | This interface allows the programmer to store status informations or other data | ||
| - | which can be read out from host PC using the API. | ||
| - | |||
| - | En example can be found in the directory '' | ||
| - | EZ-USB SDK package. | ||
| - | |||
| - | The debug helper is stack orientated and initialized in the firmware using the | ||
| - | " | ||
| - | denotes the maximum number of messages in stack and <message size> | ||
| - | denotes the message size in bytes. | ||
| - | |||
| - | Two variables and one function are used for the message control in the firmware: | ||
| - | |||
| - | <code c> | ||
| - | /* | ||
| - | This buffer is used to buffer the message. The user should | ||
| - | write the data to this buffer. | ||
| - | */ | ||
| - | xdata BYTE debug_msg_buf[DEBUG_MSG_SIZE]; | ||
| - | |||
| - | /* | ||
| - | | ||
| - | | ||
| - | */ | ||
| - | xdata BYTE* xdata debug_stack_ptr; | ||
| - | |||
| - | /* | ||
| - | Adds the message stored in debug_msg_buf to the message stack | ||
| - | */ | ||
| - | void debug_add_msg (); | ||
| - | </ | ||
| - | |||
| - | The messages can be read out from host PC using the following API | ||
| - | methods and variables: | ||
| - | |||
| - | <code java> | ||
| - | /* | ||
| - | Is set by debugReadMessages(boolean, | ||
| - | of new messages. | ||
| - | */ | ||
| - | public int debugNewMessages; | ||
| - | |||
| - | /* | ||
| - | | ||
| - | */ | ||
| - | public int debugStackSize ( ); | ||
| - | |||
| - | /* | ||
| - | | ||
| - | */ | ||
| - | public int debugMsgSize ( ); | ||
| - | |||
| - | /* | ||
| - | | ||
| - | | ||
| - | */ | ||
| - | public final int debuglastMsg ( ); | ||
| - | |||
| - | /* | ||
| - | Reads debug messages from message stack. The number of messages | ||
| - | | ||
| - | in debugNewMessages. The number of the latest message is returned by | ||
| - | | ||
| - | |||
| - | If parameter all is true, all messages from stack are written to buf. | ||
| - | If it is false, only the new messages are written to buf. | ||
| - | */ | ||
| - | public int debugReadMessages ( boolean all, byte[] buf ); | ||
| - | </ | ||
| - | |||
| - | {{indexmenu_n> | ||