MPC5604P code flash read protected

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

MPC5604P code flash read protected

Jump to solution
1,077 Views
Sanddy_TTL
Contributor II

 hello:

         how can i config protected code flash? can not be read code flash, it can protected my code . have example code to read code flash protected config?

0 Kudos
Reply
1 Solution
975 Views
Sanddy_TTL
Contributor II
0 Kudos
Reply
5 Replies
1,055 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

To protect the flash you will use Censorship feature.

A password mechanism is designed to grant the legitimate user access to the non-volatile memory.

Please refer to detailed procedure described in Reference manual: 34.7 Censorship

petervlna_0-1753354109120.png

Here is the example for Lauterbach debugger for censoring and uncensoring uC.

Best regards,
Peter

 

0 Kudos
Reply
1,043 Views
Sanddy_TTL
Contributor II
have write Shadow block code example?
*(uint32_t *) 0x00203DD8 = 0xBABADEDA;
*(uint32_t *) 0x00203DDC = 0xAABBCCDD;
*(uint32_t *) 0x00203DE0 = 0x55AA1111;
*(uint32_t *) 0x00203DE4 = 0x55AA1111;
this way can not effect。i can not write in.
0 Kudos
Reply
1,036 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I am not familiar with your application, but hopefully you are not executing programming routine from flash:

  1. Understand the Shadow Flash Layout:

    • The censorship configuration is stored in Flash Block 0, specifically in the shadow row.
    • This includes the Censor Control Word (CWORD) and Censor Passwords.
  2. Prepare Your Application to Run from RAM:

    • You cannot execute code from flash while modifying flash (including shadow flash).
    • Copy the censorship routine to RAM and execute it from there.
    • Use a linker script to place the function in a .ramfunc section.

Best regards,

Peter

0 Kudos
Reply
983 Views
Sanddy_TTL
Contributor II
hello
my code in the ram to run, i don,t know how to write data to shadow block. how to config can write data to shadow block?
0 Kudos
Reply
976 Views
Sanddy_TTL
Contributor II
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2139816%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMPC5604P%20code%20flash%20read%20protected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2139816%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%26nbsp%3Bhello%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bhow%20can%20i%20config%20protected%20code%20flash%3F%20can%20not%20be%20read%20code%20flash%2C%20it%20can%20protected%20my%20code%20.%20have%20example%20code%20to%20read%20code%20flash%20protected%20config%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2141194%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPC5604P%20code%20flash%20read%20protected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2141194%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FExample-MPC5604B-Shadow-Flash-Reprogramming%2Fta-p%2F1119903%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FExample-MPC5604B-Shadow-Flash-Reprogramming%2Fta-p%2F1119903%3C%2FA%3E%3CBR%20%2F%3Ei%20find%20this%20example%20can%20write%20shadow%20block%2C%20thank%20you%20very%20much.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2141185%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPC5604P%20code%20flash%20read%20protected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2141185%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ehello%3CBR%20%2F%3Emy%20code%20in%20the%20ram%20to%20run%2C%20i%20don%2Ct%20know%20how%20to%20write%20data%20to%20shadow%20block.%20how%20to%20config%20can%20write%20data%20to%20shadow%20block%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2140801%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPC5604P%20code%20flash%20read%20protected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2140801%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EI%20am%20not%20familiar%20with%20your%20application%2C%20but%20hopefully%20you%20are%20not%20executing%20programming%20routine%20from%20flash%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%0A%3CP%3EUnderstand%20the%20Shadow%20Flash%20Layout%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20censorship%20configuration%20is%20stored%20in%26nbsp%3BFlash%20Block%200%2C%20specifically%20in%20the%26nbsp%3Bshadow%20row.%3C%2FLI%3E%0A%3CLI%3EThis%20includes%20the%26nbsp%3BCensor%20Control%20Word%20(CWORD)%26nbsp%3Band%26nbsp%3BCensor%20Passwords.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EPrepare%20Your%20Application%20to%20Run%20from%20RAM%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EYou%26nbsp%3Bcannot%20execute%20code%20from%20flash%26nbsp%3Bwhile%20modifying%20flash%20(including%20shadow%20flash).%3C%2FLI%3E%0A%3CLI%3ECopy%20the%20censorship%20routine%20to%26nbsp%3BRAM%26nbsp%3Band%20execute%20it%20from%20there.%3C%2FLI%3E%0A%3CLI%3EUse%20a%20linker%20script%20to%20place%20the%20function%20in%20a%26nbsp%3B.ramfunc%26nbsp%3Bsection.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2140705%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPC5604P%20code%20flash%20read%20protected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2140705%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ehave%20write%20Shadow%20block%20code%20example%EF%BC%9F%3CBR%20%2F%3E*(uint32_t%20*)%200x00203DD8%20%3D%200xBABADEDA%3B%3CBR%20%2F%3E*(uint32_t%20*)%200x00203DDC%20%3D%200xAABBCCDD%3B%3CBR%20%2F%3E*(uint32_t%20*)%200x00203DE0%20%3D%200x55AA1111%3B%3CBR%20%2F%3E*(uint32_t%20*)%200x00203DE4%20%3D%200x55AA1111%3B%3CBR%20%2F%3Ethis%20way%20can%20not%20effect%E3%80%82i%20can%20not%20write%20in.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2140097%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MPC5604P%20code%20flash%20read%20protected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2140097%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3ETo%20protect%20the%20flash%20you%20will%20use%20Censorship%20feature.%3C%2FP%3E%0A%3CP%3EA%20password%20mechanism%20is%20designed%20to%20grant%20the%20legitimate%20user%20access%20to%20the%20non-volatile%20memory.%3C%2FP%3E%0A%3CP%3EPlease%20refer%20to%20detailed%20procedure%20described%20in%20Reference%20manual%3A%26nbsp%3B34.7%20Censorship%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_0-1753354109120.png%22%20style%3D%22width%3A%20541px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_0-1753354109120.png%22%20style%3D%22width%3A%20541px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F349313i46164D344DDD006C%2Fimage-dimensions%2F541x257%3Fv%3Dv2%22%20width%3D%22541%22%20height%3D%22257%22%20role%3D%22button%22%20title%3D%22petervlna_0-1753354109120.png%22%20alt%3D%22petervlna_0-1753354109120.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20example%20for%20Lauterbach%20debugger%20for%20censoring%20and%20uncensoring%20uC.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EPeter%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E