Disable XIP Mode on LPC546 Devices

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

Disable XIP Mode on LPC546 Devices

Jump to solution
2,618 Views
guitardenver
Contributor IV

Hello,

We are using a QSPI chip to read and write static data. But for security reasons, we want to disable the MCUs ability to execute code from the SPIFI interface, but still be able to read and write from it.

Is there a way to do this on the LPC546 devices? I though maybe there is a register bit I'm missing to disable XIP mode.

Thanks,

Labels (2)
0 Kudos
Reply
1 Solution
2,516 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

configuration of XIP mode is in linker file. for example below is part of LPC54018 XIP configuration in linker file:

pastedImage_1.png

Here BOARD_FLASH is QSPI flash address. with this configuration, code can run QSPI flash in XIP mode.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
6 Replies
2,516 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Matt

You have QSPI FLASH connected. the boot ROM  loads the complete QSPI image to on-chip RAM to run. This is executed by boot ROM automatically. you don't need set register.

If you want to run QSPI FLASH in XIP mode, you need config linker file for it.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
2,516 Views
guitardenver
Contributor IV

Jun,

Thanks for the reply.

1) "You have QSPI FLASH connected. the boot ROM  loads the complete QSPI image to on-chip RAM to run. This is executed by boot ROM automatically. you don't need set register."

I do not want it to do this. I would like to disable boot ROM from being able to load from QSPI. 

2)"If you want to run QSPI FLASH in XIP mode, you need config linker file for it."

I do not want it to do this. I want to disable XIP. I would like to the MCU to be able to read and write data to external flash, but I do NOT want it to be able to execute code from external flash. 

This is to prevent malicious attacks. If someone uses an external programmer to load op codes into external flash, I do not want the MCU to be able to execute them.

Is there a way to prevent the MCU from executing code from QSPI FLASH, but still be able to memory map the FLASH to read and write data?

0 Kudos
Reply
2,516 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Matt,

SPIFI boot is on LPC540xx, not on LPC546xx, so LPC546xx doesn't load SPIFI Flash.

As I said, LPC546xx doesn't run QSPI FLSH in XIP mode by default.

If you want to read QSPI FLSH during code running ,  you need initialize spifi interface first. the demo code is in LPC546xx SDK, search demo code:

nor_flash

polling_transfer


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
1,975 Views
NVazquez
Contributor IV

I am using LPC54016 on custom board with external QSPI flash.

 

Can I use QSPI flash for boot rom of program memory and use it for reading and writing of data at the same time?

Are there any SDK examples available for evk 540xx for reading and writing external flash?

0 Kudos
Reply
2,516 Views
guitardenver
Contributor IV

Jun,

That's good news the LPC546 does not support XIP in the BOOT ROM.

In my application, I have the SPIFI interface configured and the external QSPI flash is memory mapped. So we can have fast and easy reading of the data.

Are you saying there is an additional step to enable XIP mode to execute from QSPI flash? How does one enable XIP mode? Just so I can make sure I do not enable it.

0 Kudos
Reply
2,517 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

configuration of XIP mode is in linker file. for example below is part of LPC54018 XIP configuration in linker file:

pastedImage_1.png

Here BOARD_FLASH is QSPI flash address. with this configuration, code can run QSPI flash in XIP mode.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply