Hello,
for trying to get the FCR4 scripts working with J-Link software V632c, i found that the code is compiled or interpreted wrong.
It can observed that when using function results directly, garbage is returned. Workaround seem to be using temporary variables for the results.
Display All
output on V612i is:
Display All
output on V632c is:
Display All
for trying to get the FCR4 scripts working with J-Link software V632c, i found that the code is compiled or interpreted wrong.
It can observed that when using function results directly, garbage is returned. Workaround seem to be using temporary variables for the results.
C Source Code
- int TestFunc(void)
- {
- int result;
- result = 0;
- //Report1(" TestFunc: ", result);
- return result;
- }
- void CallEvalFunc1(void)
- {
- int temp;
- Report(" CallEvalFunc1: entry");
- temp = TestFunc();
- if (temp != 0)
- {
- Report1(" ***if (temp != 0)***", temp);
- SYS_Sleep(750);
- }
- else
- {
- Report(" else.1");
- }
- Report(" CallEvalFunc1: exit");
- }
- void CallEvalFunc2(void)
- {
- Report(" CallEvalFunc2: entry");
- if (TestFunc() != 0)
- {
- Report(" ***if (TestFunc() != 0)***");
- SYS_Sleep(750);
- }
- else
- {
- Report(" else.2");
- }
- Report(" CallEvalFunc2: exit");
- }
- void CallEvalFunc3(void)
- {
- Report(" CallEvalFunc3: entry");
- if (0 != TestFunc())
- {
- Report(" ***if (0 != TestFunc())***");
- SYS_Sleep(750);
- }
- else
- {
- Report(" else.3");
- }
- Report(" CallEvalFunc3: exit");
- }
- void CallEvalFunc4(void)
- {
- int temp;
- Report(" CallEvalFunc4: entry");
- temp = TestFunc();
- Report1(" a) TestFunc() temp: ", temp);
- Report1(" b) TestFunc() direct: ", TestFunc());
- temp = TestFunc();
- Report1(" a) TestFunc() temp: ", temp);
- Report1(" b) TestFunc() direct: ", TestFunc());
- Report(" CallEvalFunc4: exit");
- }
- void ResetTarget(void)
- {
- Report("ResetTarget() from JLinkScript is executed");
- }
- void InitTarget(void)
- {
- Report("InitTarget: extry");
- CallEvalFunc1();
- CallEvalFunc2();
- CallEvalFunc3();
- CallEvalFunc4();
- Report("InitTarget: exit");
- }
output on V612i is:
Source Code
- InitTarget: extry
- CallEvalFunc1: entry
- else.1
- CallEvalFunc1: exit
- CallEvalFunc2: entry
- else.2
- CallEvalFunc2: exit
- CallEvalFunc3: entry
- else.3
- CallEvalFunc3: exit
- CallEvalFunc4: entry
- a) TestFunc() temp: 0x00000000
- b) TestFunc() direct: 0x00000000
- a) TestFunc() temp: 0x00000000
- b) TestFunc() direct: 0x00000000
- CallEvalFunc4: exit
- InitTarget: exit
output on V632c is:
Source Code
- InitTarget: extry
- CallEvalFunc1: entry
- else.1
- CallEvalFunc1: exit
- CallEvalFunc2: entry
- ***if (TestFunc() != 0)***
- CallEvalFunc2: exit
- CallEvalFunc3: entry
- else.3
- CallEvalFunc3: exit
- CallEvalFunc4: entry
- a) TestFunc() temp: 0x00000000
- b) TestFunc() direct: 0x00000139
- a) TestFunc() temp: 0x00000000
- b) TestFunc() direct: 0x00000139
- CallEvalFunc4: exit
- InitTarget: exit
The post was edited 2 times, last by Veit_Kannegieser ().