To collect trace using remote launch through Jython console, perform the following steps. These steps demonstrate the procedure of launching configuration and collecting both continuous and automatic trace on the HCS08 MC9SO8QE128 target using the sample scripts, TestCollectContinuousHcs08.py and TestCollectAutomaticHcs08.py.
These scripts are available at <CW Installation Directory>\eclipse\plugins\com.freescale.sa.mcu.scripting_*\remote\scripting_sa_mcu.
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
volatile i = 0;
void f() {
if (i < 100) {
i++;
return;
}
i = 0;
}
void main(void) {
EnableInterrupts;
/* include your code here */
for(;;) {
f();
__RESET_WATCHDOG();/* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}
>>> from scripting_sa_mcu import TestCollectContinuousHcs08
>>> TestCollectContinuousHcs08.runTraceDemo()
The trace collection starts and the Software Analysis view appears with the trace results.
>>> from scripting_sa_mcu import TestCollectAutomaticHcs08
>>> TestCollectAutomaticHcs08.runTraceDemo()
This is how you collect trace using the Jython console.