the target hardware is S32K388 and the behavior is same on NXP S32K388 EVB and our own designed HW.
The test code on the target is incrementing the test_counter to 100 then back to 0.
I tested with debugger, the code runs OK.
I tried to define the variable as static volatile or just static.
But the value never change in the freemaster.
And by checking the log, I can see there is error code 0x80000081
please help to provide some ideas what is going wrong.
I’m using JLink plugin as the communication method.
Hi @Panasonic_Kevin_Yang, @DouDou1,
We are looking into this issue. In the meantime could you provide some details about the following:
I found that every S32DS program creates a variable called exit_code and decides if it is equal to 0 in the main loop. When I call freemaster, this variable is changed, and the program is finished
You can try to see if the variable has changed, and if it has, then the program will not proceed
Hi,
It seems that JLink performs some default operations on connect. Ex: memory initialization - in this case the behavior you observe may depend on your particular application (what is stored in those regions).
Example logs:
SetupTarget() start
Initializing ECC RAM...
RAMCodeAddr: 0x20000000
RAMInitAddr: 0x20000010
RAMInitSize: 0x00007FF0
InitPattern: 0xDEADBEEF
ECC RAM initialized successfully
Initializing ECC RAM...
RAMCodeAddr: 0x20000000
RAMInitAddr: 0x20400000
RAMInitSize: 0x00004000
InitPattern: 0xDEADBEEF
ECC RAM initialized successfully
SetupTarget() end - Took 25.3ms
We are yet to confirm whether it's the root cause. If so, this could possibly be disabled with JLink Scripts as described on JLink's Wiki page.
the behavior remains the same, below is the log showing the script has been ran.
03-00000000-00-00000001-01C1: ------J-Link related settings------
J-Link Host interface: USB
J-Link script: **********************************\Example_InitTargetOverride.JLinkScript
J-Link settings file: none
------Target related settings------
Target device: S32K388
Target device parameters: none
Target interface: JTAG
Target interface speed: 4000kHz
Target endian: little
Hello,
what Iulian wrote above is important, the JLink may corrupt a memory by initializing it to the 0xDEADBEEF pattern and causing a HardFault. Using a custom JLinkScript which overrides the SetupTarget might be necessary.
I was observing slightly similar (but still different) behavior on S32K344. It appears that there might be a DebugEvent escalated to a HardFault when FreeMASTER-JLink connects to the application. Regardless the possible HardFault root cause, let's first make an experiment to confirm that it really occurs.
Please locate your vector table (startup_ARMCM7.c) and implement a two different handlers, one for HardFault and one for DebugMon. Implement each handler as a short endless loop which just increment a global variable (countHardFault, countDebugMon). Add the two counters to FreeMASTER watch to see if they will count (meaning the theory was correct) or not.
Thanks,
Michal
I load the application to flash, never tried to load to ram.
I didn't run debug session while using the freemaster
Maybe I have the same problem with you. Have you solved it? If so, can you tell me how it was solved?
I tried to reproduce your issue, unfortunately, v7.94a was no longer available for download.
I checked latest version (v7.96q), but run into other issues. Eventually, I downgrade to V7.92q and was able to use FreeMASTER with no issue.
Could you check this workaround and let us know if it works for you ?
Kind regards,
Iulian
Thank you for trying on your side,
But the behavior remain the same after I re-installed to 7.92q
Just to confirm what toolchain you are using - is it NXP's GCC, IAR, DIAB or GHS ?
we are using NXP GCC currently.
Hello,
please send a screenshot of your Project Options dialog "Comm" tab (where the plug-in is selected) and send also a screenshot of the JLink plug-in configuration dialog.
Also, please describe your hardware platform (what MCU, board etc.).
Thank you,
Michal
Hi Michal,
I uploaded to the original post, please help to check it. Thanks.
Thank you,
the error code 0x80000081 is not applicable here, this is just an intermediate error returned for old protocol command probed by FreeMASTER for backward compatibility. The overall result is OK (0x0), which means the JLink plug-in "thinks" it is returning a valid data.
We will need to do some experiments to find out what is wrong. I suspect the FreeMASTER reads the correct memory, but the CPU is halted. Is there any other way how you can find out if the application is running (e.g. any LED blinking)? It sometimes happens that during JTAG connect/disconnect process, the core gets reset and/or halted.
Please do these experiments:
Similar to IAR, you can also use Segger Ozone debugger. This is also able to co-exist with FreeMASTER on the same JLink connection.
I will ask my colleagues to replicate the same HW setup and to try to replicate the issue locally.
Thanks,
Michal
Hi Michal,
Thanks for the advice.
I just confirmed, when power-on the MCU and its SW running OK.
the mcu halt when I click on the Go button in freemaster. do you have any idea why the freemaster halt the mcu execution?