I program the device FXTH870902DT1 press key "Erase and Program",
no earse internal firmware which comes with the chip by factory ,
but can not access the firmware address 0xE000,demo code stop at "u8Status = TPMS_READ_VOLTAGE(gu16UUMA);"why ?
Flash memory from 0xE000 to 0xFFFF contains the firmware functions (among other things) and this zone is not accessible in debug, it is a flash zone reserved for Freescale only and not accessible by the user.
If, in the CW project, you right click on TPMS_READ_VOLTAGE and select "Open Declaration" you will see that you will be redirected to the jump table:
#define TPMS_READ_VOLTAGE ((UINT8(*)(UINT16*))(u16fnDALLinkFmw(gu8Derivative, FN_READ_VOLT)))
In this file you can see the address of the functions:
#define TWO_AXES_READ_VOLT ((UINT16)0xE003)
It means that when this function is called, the program will use the jump table to jump to the function which is between 0xE000 and 0xFFFF. And once the program has jumped into this zone between 0xE000 and 0xFFFF it is not possible anymore to follow the code in debug because this zone is not accessible in debug.
Let us know if you need additional information.
Thanks for your reply!
I found some questions when debugged the FXTH870902DT1.
1. Now, I know why can't be accessed when debug at address " 0xE0000xFFFF", but how can I debug the code if I use the firmware of Freescale stored at " 0xE0000xFFFF" ?
2. Are erased the address at "0xE0000xE03F " of "firmware jump table" or "0xE0400xFFFF" of "firmware flash" area
when using programming tool "PE Multilink universal" by click the key "Erase whole device" or "Erase and program" ?
3. I'm new. By the way, the PE Multilink universal only for programming the FXTH870902DT1, not read?
4. I debugged the code "FXTH87xx02_Starter_Project_CW10" which downloaded from webset of Freescale,
added code of light one LED, clicked the key "step over", step by step light the LED, then clicked the key "reset", got info "No source available for "0xFFFF (0xFFFF)() " ", what meaning ?
5. The LED can be light when clicked the key "step over", but there is no action after program the FXTH870902DT1 and power cycle, PE Multilink universal need setting ?
Here are the detailed answers to your questions from my colleague Camille from the TPMS apps team.
1. You will be able to debug your own code but without having access to the firmware functions source code. So in your code in debug, when you will arrive at a firmware function, you will not have access to the source code of the function, but you will be able to step over this function and continue debugging on the next line.
For example, if I program my device using the Debug button then once the programming is done, I stop at the beginning of the main (as usual) and from here I am able to do go line by line using either Step Over or Step Into. When I arrive at a firmware function I cannot see the source code of the function, but I can step over it and nonetheless see the evolution of the variables used.
2. If you click on Erase whole device, then the entire memory will be erased (flash from 0xC000 to 0xFFFF), including Freescale flash from 0xE000 to 0xFFFF. So you will not be able to use your device anymore, because you will lose the Freescale firmware and you will not be able to reprogram it. So you must NOT use Erase whole device.
If you click on Erase and program, you will only erase the user accessible flash (0xC000 to 0xDFFF) and reprogram it with the application file you specified. This is what you should use to program the device without using the debug mode.
3. When you enter the debugger, you can read what is written in memory thanks to the panel Memory, and you can have access to the content of the registers. And with CW10.6 I know no other mean to enter the debugger than after programming the device. So from what I know, with CW10.6 you can only read the device after having programmed it using the Debug button.
4. When you reset the device this calls the reset interrupt vector, which is in the Freescale zone of the flash. And as you already know, you do not have access to the source code in this zone.
If you place a breakpoint in your code and then click on Reset you will not have access to the reset interrupt vector (you will first see No source available…), but then if you click on Run, the program will leave the Freescale zone and re-start at the beginning of the main (because you did a reset) and it will stop at the breakpoint you placed. So you will be able to continue debugging.
5. No, there is no particular setting. When you are in debug mode, you just have to terminate the debug session, disconnect the Multilink and make a power cycle, and the program starts executing.
Maybe the blinking is too fast to be seen? How did you do your blinking? Did you just connect a LED to a GPIO and made this GPIO toggle periodically?
Again, let us know if you need more information.
Thanks for your answers.
A. About the item 3: the PE Multilink universal only for programming the FXTH870902DT1, not read?
The read means that can I read the FXTH870902DT1 for its code, like the program file *.abs, and then programming this file to anther device ?
B. Maybe the blinking is too fast to be seen? How did you do your blinking? Did you just connect a LED to a GPIO and made this GPIO toggle periodically?
No fast ,just light it. Only driver one led by one gpio. Yes,there are no problem about this now.
C.But I found anther problem, as follow:
/* Determine derivative once */
(void)u8fnDALDetectDerivative(); //1.gu8Derivative = ONE_AXIS_DERIVATIVE_INDEX; ONE_AXIS_DERIVATIVE_INDEX define to 1 here
/* Clear the interrupts flag */
TPMS_INTERRUPT_FLAG = CLEAR;
FrameID = CLEAR;
/* Configure LFR for data mode */
PTBD = 0x00; //2.normal, turn off the led
TPMS_LF_ENABLE(SET); //3.Access the Freescale firmware first time in this code
PTBD = 0x0f; //4.No longer turn on the led,why ?
In addition, turn on the led by step 4 if mask the step 1 " (void)u8fnDALDetectDerivative(); " or "gu8Derivative = 0xFF" or "gu8Derivative = 0x00", why?
A. It means that when you program a device using the debug button you will be able to read, in the debug window, the code that you have just flashed into the device. What have been flashed is indeed the .abs file. And yes, you can then load this file in any other FXTH87 device.
For more specific questions about CW, please refer to the CW manual and Multilink specification, or use the CW community space.
C. "No longer turn on the LED, why?"
GPIOB becomes high impedance when LF block is enabled. Refer to the datasheet:
"In addition, turn on the LED by step 4 if mask the step 1 " (void)u8fnDALDetectDerivative(); " or "gu8Derivative = 0xFF" or "gu8Derivative = 0x00", why?”
u8fnDALDetectDerivative function sets the correct value of the variable gu8Derivative.
When a firmware function is called (for example TPMS_LF_ENABLE) the programs goes to the jump table to jump to the correct firmware location of the function. You can see that gu8Derivative is used in the jump table to jump at the correct address:
/* void TPMS_LF_ENABLE(UINT8 u8Switch) */
#define TPMS_LF_ENABLE ((void(*)(UINT8))(u16fnDALLinkFmw(gu8Derivative, FN_LF_ENABLE)))
So if gu8Derivative is not correct, the program will not jump to the TPMS_LF_ENABLE firmware function, so the function will not be executed and the GPIOB will not be set to high impedance (so the LED will remain ON).
Hope it is clear enough.
Retrieving data ...