Tool/software:
How to implement lockstep in the board
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Anandakrishnan R,
Please refer to 6.1.3.2.1.1 R5SS Lock Step/Dual Core Configuration from AM263x TRM, for information on how to configure the CPU in lockstep mode.
/** * \brief Configure R5 in lock step mode * \param cpuId [in] Cpu Id. Refer \ref CSL_CoreID for applicable values. */ void SOC_rcmR5ConfigLockStep(uint32_t cpuId);
where to find SOC_rcmR5ConfigLockStep(uint32_t cpuId); api. Also how to find the memory address of the status register and control register inorder to configure.
Also how to find the R5SS*_STATUS_REG. LOCK_STEP register address and n R5SS0_CONTROL.LOCK_STEP register address. How to configure them in CCS.
Hi,
SOC_rcmR5ConfigLockStep(uint32_t cpuId); api is located at "source/drivers/soc/am263x/soc_rcm.h"
You can find the information about Status and Control registers from AM263x Register Addendum.
The same are implemented in mcu_plus_sdk in the file "source/drivers/hw_include/am263x/cslr_mss_ctrl.h"
Regards,
Akshit
I tried to make the R5SS0_CONTROL.LOCK_STEP register's lockstep bit 0x7. Then it was succesfull but when I tried to make the R5SS0_CONTROL.RESET_FSM_TRIGGER bit to 0x7 for reset, the field is not changing. Why? How can I cahnge it to 0x7 so i can make my launchpad-AM263x to Lockstep mode.
Hi Anandkrishnan,
The following is the current flow:
1. After Power On Reset, the R5F0 core is initially in Lockstep mode.
2. If your app image contains code for both cores, then our SBL configures it into Dual Core mode.
3. If your app image contains code only for a single core, then it is configured to Lockstep mode.
4. This configuration cannot be changed again once set. Only the next Power On reset can modify the configuration you need.
If you already have a single core image and using our SBL, then your core will be configured into lockstep automatically and there is nothing you need to do.
For more information, please refer to this thread.
Regards,
Akshit
how to debugP_log to see whether it is in lockstep or dual core. How to verify it. Cannot find MSS_CTRL_R5SS0_CONTROL_LOCK_STEP in source/drivers/hw_include/am263x/cslr_mss_ctrl.h" .
I have called SOC_rcmR5ConfigLockStep(CSL_CORE_ID_R5FSS0_0); api and SOC_rcmR5ConfigLockStep(CSL_CORE_ID_R5FSS0_1); api . and also used SOC_rcmR5SS0TriggerReset(); api to make the status register into lockstep mode. But status register lockstep bit is not becoming 0x111. How to make the status register lockstep bit to 0x111 to prove that it is running in lockstep mode.

even if in control register's lockstep is 0x111 why status register's Lockstep is not becoming 1?
Hi,
In safety manual, you can see below statement:
The lockstep checking is disabled when the CPU is placed into a halting debug state and can only be restored to operation after a subsequent reset.
Lock step example cannot be debugged since as soon as debugger is connected, lockstep checking is disabled. You can add debug statements in the code and monitor the logs in the terminal by Flashing the program instead of loading it with a debugger.
uint32_t rv3 = (HW_RD_REG32(CSL_MSS_CTRL_U_BASE + CSL_MSS_CTRL_R5SS0_STATUS_REG) & CSL_MSS_CTRL_R5SS0_STATUS_REG_LOCK_STEP_MASK);
if((rv3 & (1 << 8)) != 0)
{
DebugP_log("Lock Step Mode!\r\n");
}
else {
DebugP_log("Dual Core Mode\r\n");
}
Please refer to these threads:
Regards,
Akshit
int main(void)
{
/* init SOC specific modules */
SOC_rcmR5ConfigLockStep(CSL_CORE_ID_R5FSS0_0);
// SOC_rcmR5ConfigLockStep(CSL_CORE_ID_R5FSS0_1);
SOC_rcmR5SS0TriggerReset();
SOC_rcmCoreR5FUnhalt(CSL_CORE_ID_R5FSS0_0);
Is the above piece of code enough inorder to make the core into Lockstep mode ? I call SOC_rcmIsR5FInLockStepMode api to check whether it is running in Lockstep or Dual core. I am getting output as Dual core. What other api do i need to call to get my status register in 0x1 state that is in lockstep mode.
I have called SOC_rcmR5ConfigLockStep api and when debugged my control register's lockstep bit is 0x111. But status register's lockstep bit is not becoming 1. So when I used the following code -uint32_t rv3 = (HW_RD_REG32(CSL_MSS_CTRL_U_BASE + CSL_MSS_CTRL_R5SS0_STATUS_REG) & CSL_MSS_CTRL_R5SS0_STATUS_REG_LOCK_STEP_MASK);
if((rv3 & (1 << 8)) != 0)
{
DebugP_log("Lock Step Mode!\r\n");
}
else {
DebugP_log("Dual Core Mode\r\n");
}
to check whether dualcore or lockstep mode , iam getting Dual core. How to make it into lockstep mode? Please reply.
Hi Anandakrishnan,
as I said, you can get the output by flashing the file instead of loading it with a debugger.
Please refer to: https://dev.ti.com/tirex/content/mcu_plus_sdk_am263x_09_02_00_55/docs/api_guide_am263x/GETTING_STARTED_FLASH.html
I flashed the following code:
void hello_world_main(void *args)
{
/* Open drivers to open the UART driver for console */
Drivers_open();
Board_driversOpen();
SOC_rcmR5ConfigLockStep(CSL_CORE_ID_R5FSS0_0);
void SOC_rcmR5SS0TriggerReset(void);
uint32_t status = SOC_rcmIsR5FInLockStepMode(CSL_ARM_R5_CLUSTER_GROUP_ID_0);
DebugP_log("Status: %u\r\n", status);
Board_driversClose();
Drivers_close();
}
got output:

Regards,
Akshit