Hi,
TRM gives steps in chapter 5.2.5.6 for the test:
1. Make sure the true DMA module is off
What is this "true DMA module" does this mean "the one and only DMA module" mentioned in TRM chapter 16? If yes, why SafeTI does not check that in entry condition checks? If yes, then any of these tests using this mode cannot be run in case DMA is running (in case you use DMA for receiving something there is practically no change to stop it...)?
Same chapter 5.2.5.6 describes rest of the procedure steps, in step 4 (before that FPAR_OVR register is set in steps2-3) DIAGCTRL register is written and in step 5 the fault is injected (DIAGCTRL "DIAG_TRIG" is not mentioned anywhere).
How ever chapter 5.6.2 has completely opposite instruction, it says that first write certain values to DIAGCTRL and then rest of the registers and finally set DIAG_TRIG (which is one shot)
For all modes it is best to follow this sequence.
1. Write 0101 to the DIAG_EN_KEY register and set the desired DIAG_MODE. This will block many UERR sources.
2. Set any data registers needed for this mode.
3. Writea one the DIAG_TRIG to initiate the action and allow UERRs to happen for one cycle.
4. Write 1010 to DIAG_EN_KEY to exit the diagnostic modes
This instruction is completely opposite than instructions in 5.6.2.5 which instructs to first set other registers than DIAGCTRL .
Also 5.6.2 requires that DIAG_TRIG is set in order to anything to happen (FLASH_ADDRESS_PARITY_SELF_TEST does not set DIAG_TRIG and something still happens)
"Only DIAG_EN_KEY=0101 will enable any diagnostic mode and all diagnostic modes use the DIAG_TRIG to initiate the action"
5.6.5.6 does not mention anything about ADD_INV_PAR par. That is reference in only FPAR_OVR register content description table and this is used by the FLASH_ADDRESS_PARITY_SELF_TEST. Selftest also does not set DAT_INV_PAR so it is 0 (checked that) based on syndrome is should result to "good".
There is something what I can't understand or TRM text contains errors, also tried to test FLASH_ADDRESS_PARITY_SELF_TEST or its fault inject counter part by setting DIAG_TRIG (and removing barrier access) like it is in other flash tests in SafeTI but cannot see any differences :
//_SL_Barrier_Data_Access();
sl_flashWREG->FDIAGCTRL |= F021F_FDIAGCTRL_DIAG_TRIG;
flashread = *(volatile uint32 *)flashBadECC1;
The reason for digging this in this level was originally unexpected data_abort in FLASH_ADDRESS_PARITY_SELF_TEST (which occurs also in SafeTI demo application which indicates that it is not me who makes that data_abort despite of is the DMA running or not).
https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/602737
There looks to be also a documentation bug in TRM:
2. Put 0101b into PAR_OVR_KEY and 101b into DAT_INV_PAR fields (00005Axxh) of the FPAR_OVR register (0x7C).
101b must mean "into BUS_PAR_DIS" since otherwise that 00005Axxh pattern does not match?