Skip to main content

Go a gore from another selected core on Trace32 - Community / Debugging - Lauterbach Support

2

Go a gore from another selected core on Trace32

Hello,
I have a project in which I run the beginning of my code on core 2 then core 0 takes over to do the rest of the code. However, I want to skip part of core 2 when I perform a target reset with Trace 32. To do this, I perform the following script:

// I assign cores 0 and 2 in multicore
SYSTEM.DETECT.CPU
CORE.ASSIGN 1. 3.
SYSTEM.ATTACH

// I select core 2 to begin
CORE.SELECT 1

// I reset the target
SYSTEM.RESETTARGET

// I set a breakpoint at the beginning of the code I want to skip
BREAK.DIRECT FUNCTION_OF_CORE_2+0x6E /Program

// I start the cowe to let the code run untul the code to skip
GO
WAIT !RUN()

// I move PC to the end of part to skip
REGISTER.SET PC FUNCTION_OF_CORE_2+0x14E

// Then I re-run the code which goes in core 0
GO

// I display core 0 and set a breakpoint in main while function
CORE.SELECT 0
LIST /CORE 0

BREAK.SET BREAKPOINT_AT_THE_BEGINNING_OF_CODE_OR_CORE_0 /CORE 0


However, this script is problematic because the core selection change from core 2 to core 0 of Trace32 takes a little time and I miss the beginning of the code runned by core 0. I tried to start the code of core 2 by having already selected core 0 on Trace32 with GO /CORE 1 but it shows me Emulation Running.

Do you have any idea how I could solve my problem ? Like setting a breakpoint at the beginning of code runned by core 0

Thank you very much

Comments (3)

Khaled Jmal
Hello,
you are debugging both cores in SMP which means that both cores are started together with the Go command, and stopped together with a Break command. If a core is stopped at a breakpoint, the other cores are also stopped.
The CORE.SELECT command only changes the debugger view to the selected core.
If you really want to debug both cores in SMP, then you need to change your script and set the BREAKPOINT_AT_THE_BEGINNING_OF_CODE_OR_CORE_0 before resuming the execution.
In case you want to control both cores separately, then you need to set up an AP session with two TRACE32 interfaces, one for each core. You can find AMP demo scripts in the demo folder of the target architecture you are using.
Alexis
Hello Khaled,
Thank you for your answer. I had tried to put the breakpoint before resuming the execution but when the core 0 takes over the code, the breakpoint is "forgotten" as long as I haven't put it back. At this point, only core 0 is running while core 2 is in stop state.
Moreover, you told me that the core.select has no impact because in SMP as the commands apply for the 2 cores. But I tried to do /GO or /GO CORE 2 after having selected core 0 (when code of core 2 is breaked at the end of skipped code), but impossible because it shows me "Emulation Running". I must absolutrly select core 2 to be able to resume the execution (CORE.SELECT 1).
Khaled Jmal
Hello Alexis,
I think you need an AMP setup. Please refer to https://repo.lauterbach.com/publications/debugging_amp_smp_systems.pdf for more information about SMP and AMP debugging.

Add a comment

ID-0
To prove you are a human, please tell us the text you see in the CAPTCHA image