MPC5748G Adding DCF record

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5748G Adding DCF record

4,467 Views
rahulramakrishn
Contributor III

Hi

I am using S32DS to debug MPC5748G. I want to enable the HSM module in MPC5748G. I found that in order to activate the HSM module, I need to set the HSE bit via DCF record. But I didn't found a way to set the DCF record. How can I access the DCF record in order to enable the HSM module in MPC5748G?

Regards

Rahul Ramakrishnan

25 Replies

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

This is quite simple and it is described in reference manual chapter 11. DCF records.

Few steps:

1. Construct the DCF record you like to program (according to chapter 11.3 DCF record structure)

2. simply program it to first free location in your UTEST DCF user records area. This area starts with DCF start record.

pastedImage_1.png

You can program it from code or via debugger (this is up to you). I recommend you to write debugger script for DCF records programming. Especially for HSM records.

3. restart the device

That's all.

Peter

0 Kudos

2,161 Views
IsaacAf
Contributor I

Hi Peter,

For SPC5748ghmku6 (MPC5748G).

I know how to program the DCF record and also I know how to get the first available address of the DCF (Using the Stop bit as mentioned in the reference manual).

i.e 0x00400638 is the first available address in my case, and I should write 8 bytes from the mentioned address in order to enable the HSM.

Kindly please send us directly those 8bytes to enable the HSM for (SPC5748ghmku6)

Would be perfect if you please describe how to calculate the CS, Address and Data for HSM enable only.

IsaacAf_0-1640960498951.png

Please keep in mind that I have the Security Reference Manual and SHE on MPC documents there fore please dont hesitate to point to a page in you description.

Thanks in advance and have a nice day.

0 Kudos

3,074 Views
rahulramakrishn
Contributor III

Hi

I need to know the script for setting the DCF record. I can't able to found it. 

Regards

Rahul Ramakrishnan 

0 Kudos

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

You have to write it yourself. As for every application it is unique.

For example for Lauterbach debuggers I use following:

; CPU setup

SYStem.RESet
SYStem.BdmClock 4.0MHz
SYStem.DETECT.CPU
SYStem.Option.WATCHDOG OFF
SYStem.Up

; Initialize internal SRAM (only partially used)
Data.Set EA:0x40000000--0x4000FFFF %Quad 0

; ------------------------------------------------------------------------------
; UTEST address space
  FLASH.Create 1. 0x00400000--0x00403FFF TARGET Quad 0x0500 /INFO "UTEST (OTP)"
 
  FLASH.TARGET E:0x40000000 E:0x40002000 0x1000 ~~/demo/powerpc/flash/quad/c55fm5746m.bin /STACKSIZE 0x0200
; ------------------------------------------------------------------------------
DIALOG.YESNO "DCF records programming prepared. Program DCF records now? Click Yes to program UTEST FLASH. Click No for continue."
ENTRY &progflash
IF &progflash
(
  FLASH.Program ALL
  ; here insert DCF records you want to program    
  data.set 0x00400370 %QUAD 0x00002EDE01000000 ;DCF_UTEST_Miscellaneous                                                   
  data.set 0x00400378 %QUAD 0x0000D12101000000
  data.set 0x00400380 %QUAD 0x8000176F01000000
 
  FLASH.Program OFF
)

As you can see the address is unique for every project, however DCF record could be same.

All you have to do is just program 64bit DCF record (HSM if you like) to first available address in flash starting from 0x400300. In my case it was 0x400370.

If you don''t know how to construct DCF records have a look at guide in reference manual as I have already wrote:

pastedImage_117.png

Peter

0 Kudos

3,075 Views
yashkhatri0291
Contributor II

"0x00400370", how do you find this first free available address?

0 Kudos

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

I simply looked into memory dump of my micro in debugger.

Peter

0 Kudos

3,075 Views
yashkhatri0291
Contributor II

This is what my memory at the given address looks like, please tell me how and where I can write my HSM enable DCF client::

pastedImage_1.png

0 Kudos

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

Program your DCF records for HSM enable at address 0x400380.

0xFFFF_FFFF means stop record. No record after this pattern is processed.

Peter

3,073 Views
yashkhatri0291
Contributor II

Why nothing has been mentioned about SHE functional specification in the reference manual or security reference manual? how are we suppose to procure it?

0 Kudos

3,073 Views
petervlna
NXP TechSupport
NXP TechSupport

SHE Functional Specification is a separate document owned by HIS members.

0 Kudos

3,075 Views
rahulramakrishn
Contributor III

Hi

I understood that. I need to know the way to update the DCF record.

0 Kudos

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

It is simple flash programing like in all other parts of flash. UTEST is programmed as normal flash.

1. from application code

2. via external tool (for example debugger, programming machine, etc... ) - I have already shared Lauterbach debugger programming script example.

Peter

0 Kudos

3,075 Views
陈简陈
Contributor III

@Peter NOW,I have no Lauterbach debugger, how can I programme from application code? Can you give me an example?

Regards

0 Kudos

3,075 Views
rahulramakrishn
Contributor III

Hi

Do you found any way to update DCF records without using Lauterbach debugger? If you found please help me to update the DCF record. I am using S32DS and working on MPC5748G LCEVB. What should I do to add DCF records using S32DS? 

Is there any examples available to you? 

Regards  

0 Kudos

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi, Yes you can do it via S32DS.

Stanislav Sliva wrote a guide how to update DCF records:

HOWTO: Program DCF record into UTEST flash in S32 Design Studio for Power 

Peter

PS: It took me 20 seconds to find it here on community.

0 Kudos

3,075 Views
陈简陈
Contributor III

Thank you very much,now I can program DCF record into UTEST flash,it have worked,but,I find some problem, I can't debug the program in the MPC5748G, I have wrote the email,so,can you help me to solve the problem? thank you very much

pastedImage_1.png

Regards

0 Kudos

3,073 Views
rahulramakrishn
Contributor III

How do you update the DCF record? I tried to update the DCF record as mentioned in the following link https://community.nxp.com/docs/DOC-334094. But I can't able to update the DCF record in MPC5748G LCEVB. What should I do to update the DCF record?

Regards

Rahul Ramakrishnan 

0 Kudos

3,073 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

How do you update the DCF record?

Simply add new DCF record in first available space in UTEST memory. SSCM module will take in account the last valid (of same record) DCF record found in memory.

pastedImage_5.png

Peter

0 Kudos

3,075 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

thank you for creating ticket.

as we are not allow to discuss security theme on community.

Peter

0 Kudos

3,073 Views
陈简陈
Contributor III

OK,thank you very much

0 Kudos