LPC29xx JTAG protection

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

LPC29xx JTAG protection

Jump to solution
2,922 Views
fernandotheirs
Contributor II

Hi! I'm trying to activate  the JTAG security from my LPC29xx and I found here: https://www.nxp.com/docs/en/user-guide/UM10316.pdf  in page 481 an example but I doesn't work :/

Could someone help me or provide the sample code to activate the JTAG protection?

I have this part in my startup code:

SEC_DIS EQU 0xE0001B00
SEC_Value EQU 0x00 
LDR R0, =SEC_DIS
LDR R1, =SEC_Value
STR R1, [R0, #0]

I read that I have to write 0x7FFFFFFF in some part of the flash but I cannot do it  :smileysad:

Thanks, 

Fernando

Labels (1)
0 Kudos
1 Solution
2,494 Views
bernhardfink
NXP Employee
NXP Employee

Hi Fernando,

correct, Argentina might be too far away for sending boards.

  • Look into the project \KEIL\IndexSector_Config. The function FMC_WriteIndexPage can be found in the file fmc.c
  • In the folder which includes the code belonging to the app note this function is also included in the file fmc.c
  • I didn't look into the folder FMC and what the example is supposed to do, but it seems it's not doing things with the index sector

Regards,

Bernhard.

View solution in original post

0 Kudos
4 Replies
2,494 Views
bernhardfink
NXP Employee
NXP Employee

Hi Fernando,

in a first step, please look into the attached appnote, maybe it provides the missing piece of information.

If not, just come back and I'll look for more details. I'm missing the sample code the appnote is referring to.

>> I read that I have to write 0x7FFFFFFF in some part of the flash but I cannot do it

"Writing to flash" of course means that you need to program specific memory locations, I think in the index sector.

Btw, if you have a need for LPC2900 boards (from Keil or Hitex) I have many of them in my office in Munich, more or less to be trashed.

Regards,

Bernhard.

Update:  found some code for the LPC2900 and attached it.

0 Kudos
2,494 Views
fernandotheirs
Contributor II

Hi Bernhard,

Thanks once again to answer my question and thank you very much for the LPC boards but I'm living in Argentina and I think that the shipping cost will be really high :smileysad:

I read the PDF file and look at the examples (specially the one under FMC folder) but I'm still having some problems with the flash writing. I couldn't find the method FMC_WriteIndexPage, so I took FMC_WritePage and I removed the part that completes the full page with 0xFF. I also changed    TestPage[15] = 0x7f; (example value was 0xFF).

I ran first  FMC_Init();  and then the part of the code that is under JTAG_SECURITY. However, the JTAG is never disabled :smileysad: I checked SEC_DIS and it's always in zero, so the part that is written in the startup is setting the right value.

Do you have any idea? Do I require any special consideration to write only the 128bit for JTAG security?

Thanks for your help and ideas :smileygrin:

0 Kudos
2,495 Views
bernhardfink
NXP Employee
NXP Employee

Hi Fernando,

correct, Argentina might be too far away for sending boards.

  • Look into the project \KEIL\IndexSector_Config. The function FMC_WriteIndexPage can be found in the file fmc.c
  • In the folder which includes the code belonging to the app note this function is also included in the file fmc.c
  • I didn't look into the folder FMC and what the example is supposed to do, but it seems it's not doing things with the index sector

Regards,

Bernhard.

0 Kudos
2,494 Views
fernandotheirs
Contributor II

Hi,

Thanks!! I made it work! I've just compared the FMC_WirteIndexPage and the code that I modified and it's the same. I needed to add FS_ISS to  FCTR. Otherwise, the flash sector is hidden.

I will mark this as solved!!

Best regards,

Fernando

0 Kudos