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.

RM44L920: PSCON PMA Self-Test

Part Number: RM44L920


Tool/software:

Hello,

I'm reopening this issue in a new thread since the previous one was closed, and I believe I’ve made progress in resolving the problem I originally encountered. I’d now like to confirm whether my logic and implementation are valid and whether the observed behavior may point to issues in the Safety Diagnostic Library (SDL).

Before calling test function, mode is changed to USER.

portSWITCH_TO_USER_MODE();
status = SL_SelfTest_PSCON(PSCON_PMA_TEST, TRUE, &failInfoPSCON);

I changed SL_SelfTest_PSCON function, so that arm mode is changed back from USER to PRIVILEGED before this line in test because this register can be written only in Privileged mode. This fixed my problem of program continuously executing the test without progressing.

/* Revert to normal operation */
sl_pmmREG->PRCKEYREG = PMM_PRCKEYREG_MKEY_LKSTEP_MODE;

I have additional question about exception handling in SDL. In safety_library\common\source\exception_handlers.c I changed 0xFFFF00A0 to 0xFFFF00AC so the maskDabort would be set to TRUE.

 * DAbort due to access to  PMM global control register (sl_pmmREG->GLOBALCTRL1) access in user mode?
     * 0x00000009 indicates that it is an external abort caused by read and is AXI decode error
     * 0xFD000000 is the reserved location accessed to create the L2 interconnect error trap AXI decode error
     */
	if ((TRUE == SL_FLAG_GET(PSCON_PMA_TEST)) &&
		((0x00000800u == (0x0000800u & _SL_Get_DataFault_Status())) &&
		(0xFFFF00A0 == _SL_Get_DataFault_Address()))){
		maskDAbort = TRUE;
	}

Is this also a bug because here exception handler checks if Privileged mode access violation is happening on GLOBALCTRL1 register but in test function we are writing to PRCKEYREG with address 0xFFFF00AC.

Thanks & regards,

Ilija

  • Hi Ilija,

    Apologies for the delay!

    I am checking this issue now and will provide my update ASAP.

    --
    Thanks & regards,
    Jagadish.

  • Hi Ilija,

    The main aim of this test is that verifying privilege access writes to the PSCON registers.

    That means if you try to write anything to this PSCON registers in user mode, that should not take effect. This is exactly what we want to prove with this test.

    This is exactly the reason they are mentioning to execute this test with user mode.

    As you can see this the exact reason, they are comparing the register value with backup value even though they try to modify the register with some other value.

    That means they are declaring this test as pass only if register not allow any modifications in user mode.

    I changed SL_SelfTest_PSCON function, so that arm mode is changed back from USER to PRIVILEGED before this line in test because this register can be written only in Privileged mode.

    You should not do that, if you do that register will take your value and we cannot prove that we can't write this register in user mode.

    We should prove we can't write into this register in user mode, otherwise there is no point of doing this test.

    You can do this in your application while you are trying to write to these registers but for this test (PSCON_PMA_TEST) we should run it in user mode only.

    I have additional question about exception handling in SDL. In safety_library\common\source\exception_handlers.c I changed 0xFFFF00A0 to 0xFFFF00AC so the maskDabort would be set to TRUE.

    You are right this seems to be an issue, as they are writing into PRCKEYREG the value should be 0xFFFF00AC.

    I will check this one and will confirm it again.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,


    I am afraid you didn't understand my problem. I am aware how this test needs to be executed, I can see that test does what it needs to, it attempt to write to register and verifies the backup value correctly and the test result is ST_PASS, as it should be.

    I understand that part, but i encounter problem on this line when PSCON should return to normal operation mode:

    /* Revert to normal operation */
    sl_pmmREG->PRCKEYREG = PMM_PRCKEYREG_MKEY_LKSTEP_MODE;

    At this line, the execution hangs if I don't first manually return to Privileged mode. By explicitly switching back to privileged mode before this write, the problem is resolved and the test completes successfully.

    My question was: Is this behavior expected, or is it a bug in the SDL test implementation.

    Thanks & regards,

    Ilija

  • Hi Ilija,

    My sincere apologies for the delayed response.

    I understand that part, but i encounter problem on this line when PSCON should return to normal operation mode:

    Sorry i didn't understand it properly before, now i got it. You are totally correct, while entering into normal operation we should enter into privilege mode. This makes sense of raising into privilege mode to bring it to normal operation.

    You are correct, i think this is missing in the code. I will note down this issue. But what you are doing is correct, we should execute this in privilege mode.

    Thanks for pointing this out.

    --
    Thanks & regards,
    Jagadish.