Need help for LPC54628 random Flash Corruption Issue

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help for LPC54628 random Flash Corruption Issue

1,026 Views
Contributor III

Hello Team,

We are using LPC54628 chip into few of our industrial products in which we are facing one issue while accessing flash of LPC54628.

Flash Memory was working fine till few days on LPC54628 Module but suddenly first 4 bytes location may be damaged after that and not able to erase first 4 bytes of Flash Memory.

Due to that we are not able to start boot loader and application image into that board. Also, We have faced same issue into 3 to 4 boards as of now in which there is no any specific steps for that. Sometimes, We flashed boot loader image and we got that issue while sometimes we got that issue runtime into development phase.

Please fine attached screen shot with highlighted 4 bytes of LPC54628 Flash Memory.

Let me know if you have any or any clue for this issue or let me know if need any more details regarding this issue.

Labels (1)
Tags (2)
29 Replies

60 Views
Contributor III

Hello All,

Anyone has found any solution to recover this issue?

"Flash Memory was working fine till few days on LPC54628 Module but suddenly first 4 bytes location may be damaged after that and not able to erase first 4 bytes of Flash Memory."

We are still facing issues into some of boards and not found any proper solution except chip replace for that.

Regards,

Ritesh Prajapati.

0 Kudos

64 Views
Contributor II

Hello,

I am having a similar issue with LPC54616J512 and Flash Magic.

My program runs fine when executing from Flash Magic, but doesn't run when running from the MCU alone.

I suspect the issue is with the first 4 bytes being written as zeros, but don't know what to do next and how to solve the issue.

The last post is 2 months old, and wanted to know if there were any new developments.

Regards,

Jonnie

60 Views
Contributor III

Hello,

Did you find any solution from your end to resolve that issue either from hardware or software side?

Regards,

Ritesh prajapati

0 Kudos

64 Views
Contributor III

Hello,

Did you read first 4 bytes from flash memory? if not then can you please read and post results for same. As it has been recommended that don't use Flash Magic Tool which is not trustworthy as we faced same issue.

Also what are the configuration of boot strap pins into your board? and in which way you have configured it? which option you have selected as per described into technical reference manual?

We have replaced LPC module when we faced that type of issue to recover it.

Let me know if you need anything else from my side.

Regards,

Ritesh Prajapati

0 Kudos

64 Views
Contributor II

Thank you for your reply.

Did you read first 4 bytes from flash memory?

Yes, I read from the flash memory

Also what are the configuration of boot strap pins into your board? and in which way you have configured it? which option you have selected as per described into technical reference manual?

UART (port 0-4 > low, port 0-5 > high, port 0-6 > high)

We have replaced LPC module when we faced that type of issue to recover it.

Do you mean you replaced the MCU? I have 5 boards at the moment, all presenting the same issue.

If not Flash Magic, what other tools are you using? Have you tried j-link as recommended by XiangJun Rong?

How did you solve your problem in the end?

Regards,

Jonnie

64 Views
Contributor III

Hello,

We have replaced LPC54628 MCU into those faulty boards and we are not using Flash Magic after that. We are using either MCUXpresso IDE or LPCXpresso IDE from which you can flash boot loader and firmware file as per your requirement.

No. We haven't tried with J-Link.

At that time, We have tried to resolve issue from tool or flashing mechanism but didn't get any success at that time and at the end we replaced MCU to resolve that issue.

So if you have more number of boards then would you please check by replacing MCU into one of board.

Let me know if need anything else from my side.

Regards,

Ritesh Prajapati

64 Views
Contributor II

Thank you.

I'll try LPCXpresso first, and if that doesn't work I'll try replacing the MCU.

Regards,

Jonnie

60 Views
Contributor III

Hello,

Let us know results once you test with that. Let me know if any issue or any concern for that.

Regards,

Ritesh Prajapati

0 Kudos

64 Views
NXP Employee
NXP Employee

Please don't mix up things.

At the moment I only see one issue with FlashMagic for the LPC54628:  reading the first 4 bytes from internal flash sector 0.

This is due to a restriction in the ISP ROM code in the LPC546xx devices. Below is the place in the UM where this is mentioned:

pastedImage_1.png

The difference between reading with Flash Magic and a debugger is described below:

  • I use for testing a correctly running LPC54628 board
  • I don't change the memory content, I don't erase or program anything on this board
  • I read out flash sector 0 with Flash Magic
  • I read out flash sector 0 with a JTAG debugger (SWD), no matter what sort of debugger

LPC54628_ReadFlash.png

Jonnie, if you can run your boards when starting them from Flash Magic but not without, then you may have forgotten to apply the vector checksum value at address 0x1C to the program binary image (check information to this in the User's Manual, chapter 3.3.2.7).

So please don't start changing the MCUs on your board before you didn't clarify this. I'm rather sure that the MCUs are ok.

Flash Magic will write a binary correctly to flash memory, from what I see it is just the read-out function on this LPC54000 MCU architecture which does not allow for reading the first word and therefore FlashMagic reports this word as 0x0000 0000.

Regards,

Bernhard.

61 Views
Contributor II

Thank you for the input.

Could you clarify what you meant by "apply the flash signature value to the program binary image"?

I'm kind of stuck after reading the chapter related to the flash signature generator.

Regards,

Jonnie

60 Views
NXP Employee
NXP Employee

Sorry Jonnie, it was meant to be "vector checksum", not "flash signature". The flash signature generator is a completely different topic and has nothing to do with the boot process.

At the address 0x1C of the flash you need to store a value which completes the checksum of the first 7 words in the flash to zero. This is the method of the bootcode to identify the flash content as a valid firmware image. If this value is not correct, the bootcode stops. This is something we had in all recent LPC chips as well.

The LPC54628 has an extension of this feature at address 0x24, see chapter 3.3.2.7 in the User Manual.

Regards,

Bernhard.

0 Kudos

60 Views
Contributor II

Hello Bernhard, thank you for your reply.

The value currently stored at 0x1C is the value automatically generated during the build process. Just to be sure I checked the value and it completes the checksum to zero.

I set the value at 0x24 to 0x0. Is this value correct? Should I set this value to something else? The comment on the sample code says "set to 0x0 for legacy boot".

I've never experience this kind of problem before working with the LPC1769.

Regards,

Jonnie

60 Views
Contributor III

Hello,

Your issue has been sorted out or still you have any query for same? Please let us know if any further query for same so that it can be sorted out ASAP.

Regards,

Ritesh Prajapati

60 Views
Contributor II

I was able to run my code successfully today!

There was an issue with the GPIO ports not being initialized.

From the User Manual chapter 13.3, "For the GPIO port registers, enable the clock to each GPIO port in the AHBCLKCTRL0 register".

I'm guessing this is done by default when running your code with Flash Magic?

Thank you.

Regards,

Jonnie

0 Kudos

60 Views
NXP Employee
NXP Employee

Well, if Flash Magic or another tool, this doesn't matter. What matters is the BootROM branch which you enter when you go for serial download. In this branch some things get done which are not done when you decide directly for execution from flash.

Regards,

Bernhard.

0 Kudos

60 Views
Contributor III

Hello,

I think Bernhard Fink can give answer very well regarding this as i didn't go into details as per technical user manual document.

Bernhard Fink, Please help him to resolve query which has been asked as per your last reply given.

Regards,

Ritesh Prajapati

0 Kudos

64 Views
Contributor III

Hello,

Thanks for your quick response with details for same.

Yes. You might be correct like there might be chances to mix two issues together. Anyways, He will check issues with MCUXpresso and LPCXpresso IDE and will let us know results for same.

Here, I have put my understanding which we have faces last time into LPC54628 board. So there might be chances like I have missed something as we didn't go too much details into that. We have checked all ISP settings and Flash Magic settings and at that time we were not able to resolve issue at that time.

Regards,

Ritesh Prajapati

0 Kudos

64 Views
Contributor III

Hello NXP Support team,

We have also tried to debug this issue yesterday with below steps and found few more useful things from our side.

We have used Flash Magic Tool and MCUXpresso IDE to flash boot loader or application image directly over 0x0000 location. Then We have tried same with NXP LPC Link 2 SWD Interface and found that first 4 bytes are written successfully while doing same with SWD Interface.

But, When we checked first 4 bytes with UART/ I2C / SPI (auto detect) means ISP-0 LOW at that time again we are getting first 4 bytes as 0x00

So, Would you please let us know that are we doing anything wrong or anyone has same time of issue as mentioned into screen-shot earlier?

Regards,

Ritesh Prajapati

0 Kudos

64 Views
Contributor III

Hello XiangJun Rong,

Would you please send me J-Link software or hardware tool for reference purpose if you have? 

Regards, 

Ritesh Prajapati

0 Kudos

64 Views
NXP TechSupport
NXP TechSupport

Hi, Ritesh,

The J-Link is third party device and software tools, pls order the J-Link device from the link:

J-Link Debug Probes | SEGGER - The Embedded Experts 

Hope it can help you

BR

Xiangjun Rong