LPC55S28 Internal Flash Write Operation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC55S28 Internal Flash Write Operation

ソリューションへジャンプ
641件の閲覧回数
_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 件の賞賛
返信
1 解決策
485件の閲覧回数
_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."

 

元の投稿で解決策を見る

タグ(1)
0 件の賞賛
返信
4 返答(返信)
623件の閲覧回数
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 件の賞賛
返信
591件の閲覧回数
_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 件の賞賛
返信
583件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @_Ferrari_ 

Yes.

 

BR

Alice

0 件の賞賛
返信
486件の閲覧回数
_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."

 

タグ(1)
0 件の賞賛
返信