LPC4320 I2C issue when running from RAM

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

LPC4320 I2C issue when running from RAM

501 Views
petejames
Contributor I

Hello,

We have an application which uses the LPC4320 which, up to now has been running out of external flash using SPIFI. Periodically (every 1s) the code writes a DWORD to a FRAM memory device on I2C0. Everything works correctly, no issues.

We have now added the header to the image in the external FLASH IC so the CPU copies the application out of the external FLASH and into the RAM on the CPU and executes it from there. The code runs a lot faster now but the reads or writes to/from the I2C FRAM chip fail.

We are investigating how it fails but so far (we haven't an I2C protocol analyser yet) when running from SPIFI there is a gap of about 5uS between the bytes on the I2C bus but when running out of RAM there doesn't appear to be any gaps.

FRAM memory is similar to EEPROM but you can do many billions of writes and the writes/reads are as fast as you can read/write them. You don't need to check the byte has been written before sending the next.

Anyone any ideas on why it should work OK out of SPIFI and not out of RAM?

Many thanks

Pete

Labels (1)
0 Kudos
3 Replies

370 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Pete,

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.
According to the above statement, you had designed a mechanism to relocate the code run in the RAM instead of the flash to accelerate the code running.
I'd like to share some suggestions about this issue.
1. Confirm the original application code whether works or nor when running in the RAM.
2. Have you ever programmed the original application code to the RAM directly via the debugger?
Have a great day,

TIC

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

0 Kudos

370 Views
petejames
Contributor I

Hi,

Many thanks for your reply and support.

The only changes we make to the code in the external flash IC is the header which tells the LPC4320 to copy to RAM and then execute.

1. The code runs correctly when running out of external flash and functions correctly, except for the I2C when running out of RAM.

2. We haven't tried programming the RAM directly from the debugger. We will try this.

I suspect the issue is with the speed of the I2C state machine.

Regards

Pete

0 Kudos

370 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Pete James,

Thanks for your reply.

I think to confirm the I2C clock rate whether works on you expect or not, you should have a logical analyzer to measure it.

Have a great day,
TIC

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

0 Kudos