LPC55S28 Internal Flash Write Operation

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

LPC55S28 Internal Flash Write Operation

Jump to solution
245 Views
_Ferrari_
Contributor IV

Dear all,

I'm developing an application running on an LPC55S28 CPU at 150MHz that requires writing data to the internal flash memory.

According to the datasheet, write operations might necessitate a lower clock speed. I plan to decrease the clock speed from 150MHz to 96MHz, perform the write operation, and then raise it back to 150MHz.

Could you please review this approach and provide any recommendations for the correct procedure? If possible, a working code sample demonstrating the clock switching and flash write operation would be greatly appreciated.

Thank you very much for your help and cooperation.

 

 

0 Kudos
Reply
1 Solution
89 Views
_Ferrari_
Contributor IV

dear @Alice_Yang 

It works, but I have another problem.

Since this is an audio application, I can't modify the system clock. Many CPU-generated signals depend on it. Therefore, I decided to write to the flash during power-off. There's a hardware interface that detects the system supply voltage. When the voltage drops below 80 volts, the CPU stops generating hardware signals and starts writing to flash memory.

Unfortunately, the 

BOARD_BootClockPLL96M() 

routine, which sets the clock to 96 MHz, takes too long, causing the system to power off before flash writing completes.

Could I possibly halve the system clock using the

CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 2U, false)

routine, to set the clock under 100MHz ?

Thank you very much for your help and cooperation.
Best regards."

 

View solution in original post

Tags (1)
0 Kudos
Reply
4 Replies
227 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @_Ferrari_ 

Yes, you are right. Decrease the clock speed from 150MHz to 96MHz, perform the write operation, and then raise it back to 150MHz. About change clock code, you can refer to clock_config..c file.

 

BR

Alice

0 Kudos
Reply
195 Views
_Ferrari_
Contributor IV

Thank you for your answer.

If I understand I have to call

BOARD_BootClockPLL96M(); // to set the clock at 96MHz

writeFlashMemory(); // to write the internal flash

BOARD_BootClockPLL150M(); // to return back to 150NHz clock

 

Is it corretc ?

 

0 Kudos
Reply
187 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @_Ferrari_ 

Yes.

 

BR

Alice

0 Kudos
Reply
90 Views
_Ferrari_
Contributor IV

dear @Alice_Yang 

It works, but I have another problem.

Since this is an audio application, I can't modify the system clock. Many CPU-generated signals depend on it. Therefore, I decided to write to the flash during power-off. There's a hardware interface that detects the system supply voltage. When the voltage drops below 80 volts, the CPU stops generating hardware signals and starts writing to flash memory.

Unfortunately, the 

BOARD_BootClockPLL96M() 

routine, which sets the clock to 96 MHz, takes too long, causing the system to power off before flash writing completes.

Could I possibly halve the system clock using the

CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 2U, false)

routine, to set the clock under 100MHz ?

Thank you very much for your help and cooperation.
Best regards."

 

Tags (1)
0 Kudos
Reply