Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
µCGuru334
Level 2
Level 2
First like given 10 replies posted First like received

Hello.

I want to activate the PFlash read protection, by setting HF_CONTROL.DDFP in by user software.

The Manual says:

After DMU ramp up the SSW  ... Start in internal Flash:  – HF_CONTROL.DDFP is cleared to 0B

and the software can set the DDFP bit in DMU_HF_CONTROL:

            CGuru334_0-1705576393994.png

In my user programm, i write to  the register:

DMU_HF_CONTROL.B.DDFP = 1;

but nothing changed. The value remains constant at 0x00000017h

Even writing it as long doesn't change anything (  DMU_HF_CONTROL.U =  0x000117;  )

    CGuru334_1-1705579218767.png

 

 

Setting the PFlash protection in UCB_PFLASH_ORIG and UCB_PFLASH_COPY ( all sectors, confirmed, DMU_HF_PROCONPF= 0x80000000 ) doesn't change anything. After startup, HF_PROCONPF.DDFP is 0 (as described in the manual), any writing to DDFP is ignored.

 

 

Does anyone know, how to activte the read protection?

 

 

 

0 Likes
1 Solution
oldPcSpeakers
Level 4
Level 4
5 solutions authored 25 sign-ins 10 replies posted

This function disables safety endinit protection, but in documentation only E is marked which means CPU endinit (SE is for safety endinit as far as I know). According to my knowledge safety endinit does not automatically imply CPU endinit.

View solution in original post

11 Replies
NXTY_Mori
Level 5
Level 5
Distributor - NEXTY (Japan)
10 likes given 5 likes given 25 replies posted

Hello,

I tried your settings using AURIX Development Studio (v1.19.16).

I checked using the Tasking C/C++ Debugger and the DDFP bit was not set to 1.
On the other hand, when I checked using winIDEA Debugger and the DDFP bit was set to 1.
winIDEA_debugger DDFP bit check.png

 



This may be a debugger-specific issue.
I hope this information helps you.

Best Regards,
Mori

0 Likes

Hello.

No, it wasn't only a debugger-specific issue.

I set and read out the DMU_HF_CONTROL value over a can-bus command, so i get any time the value: 0x00000017 after setting and later reading back.

0 Likes
NXTY_Mori
Level 5
Level 5
Distributor - NEXTY (Japan)
10 likes given 5 likes given 25 replies posted

Hello,

Thank you for your reply.

Please tell me your situation.
・Please tell me the version of AURIX Development Studio (ADS) you are using.
・Please tell me which Debbuger you are using in ADS. (TASKING C/C++ Debugger? or winIDEA Debugger?)

I was able to set the DDPF bit in winIDEA Debugger, so please try it.

Best Regards,
Mori.

0 Likes
µCGuru334
Level 2
Level 2
First like given 10 replies posted First like received

Hello.

Thanks for reply.

I tested it with Aurix Development Studio 1.9.0 and 1.9.20,

with tasking debugger and winIDEA debugger.

No way to set the DDFP bit, even from program and from winIDEA debugger:

 

CGuru334_0-1705646791935.png

Latest try was with activating the supervisor mode bevore i've try to writer the DDFP bit. But that wasn't successful either.

 

 

0 Likes
NXTY_Mori
Level 5
Level 5
Distributor - NEXTY (Japan)
10 likes given 5 likes given 25 replies posted

Hello,

Thank you for sharing the results of running with winIDEA.

Data is stored by executing ST.B instruction.
Therefore, would you please execute the ST.B instruction (0x8000351E in the attached figure) in "Disassembly"?

Best Regards,
Mori.

0 Likes
µCGuru334
Level 2
Level 2
First like given 10 replies posted First like received

Hi Mori.

If I run the program step in the winIDEA debugger in the assembler individually, with the ST.B instruction, the DDFP bit is actually set.

 

If I run the program step in the debugger and execute the (same) entire statement with F10, the DDFP bit is not set. -> why that, the same assembler code is executed

 

If I let the program run normally and try to set the DDFP bit, this is not possible either.

 

This means: I have no ability to set the DDFP bit from the program.

If I wanted it, I would have to hire a helper on the vehicle who would briefly pause the firmware using breakpoint via PC and winIDEA debugger and step through in single-step mode 😂

 

Are there no other options for betting?

0 Likes
oldPcSpeakers
Level 4
Level 4
5 solutions authored 25 sign-ins 10 replies posted

Hi, in documentation I also noticed that specifically this register might be protected with endinit protection. Have you tried to disable and later enable this protection?

NXTY_Mori
Level 5
Level 5
Distributor - NEXTY (Japan)
10 likes given 5 likes given 25 replies posted

Hello,

There is one point that concerns me.

Your software executes the MTCR instruction before setting the DDFP bit to 1.
I understand that the process is probably canceling Endinit protect, but is this correct?

Also, ISYNC must be performed after executing the MTCR instruction.
//TriCore TC1.6.2 core architecture manual - Instruction Set (Volume 2 of 2) (Page-166)
//ISYNC
[…]
Note: An ISYNC instruction should follow a MTCR instruction. This ensures that all instructions following the MTCR see the effects of the CSFR update.
[…]
https://www.infineon.com/dgdl/Infineon-AURIX_TC3xx_Architecture_vol2-UserManual-v01_00-EN.pdf?fileId...

Since ISYNC is not performed, there is a possibility that an attempt is made to set the DDFP bit to 1 before ENDINIT protect is released.

Would you please add ISYNC after the MTCR instruction and try again?

Best Regards,
Mori

0 Likes
µCGuru334
Level 2
Level 2
First like given 10 replies posted First like received

Hello.

Adding the  __isync() after MTCR (there still was a isynch) and  __isync() after seting the DDFP bit doesn't change it.

Removing the MTCR doesn't change it (i am still in Supervisor Mode).

 

Even:

safetyWdtPw = IfxScuWdt_getSafetyWatchdogPassword();
IfxScuWdt_clearSafetyEndinit(safetyWdtPw);

__isync();
DMU_HF_CONTROL.B.DDFP = 1;
__isync();

IfxScuWdt_setSafetyEndinit(safetyWdtPw);

help's.   DMU_HF_CONTROL remains at  0x00000017

Only in the winIdea debugger it is possible to set the bit one time.

oldPcSpeakers
Level 4
Level 4
5 solutions authored 25 sign-ins 10 replies posted

This function disables safety endinit protection, but in documentation only E is marked which means CPU endinit (SE is for safety endinit as far as I know). According to my knowledge safety endinit does not automatically imply CPU endinit.

µCGuru334
Level 2
Level 2
First like given 10 replies posted First like received

Hello oldPcSpeakers.

Great information. That was the sollution:

With this code it works:

uint16   password = IfxScuWdt_getGlobalEndinitPassword();
Ifx_CPU *cpu      = IfxCpu_getAddress(IfxCpu_ResourceCpu_0);
IfxScuWdt_clearGlobalEndinit(password);
__isync();
DMU_HF_CONTROL.B.DDFP = 1;
__isync();
IfxScuWdt_setGlobalEndinit(password);

 

Thanks a lot.