56f8367 Flash writing problem

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

56f8367 Flash writing problem

ソリューションへジャンプ
2,111件の閲覧回数
TroyCorser
Contributor III
Hi All,
 
I'm using DSP 56f8367. Programming with CodeWarrior.
My software is handled by MicroC/OS-II RTOS.
 
The problem is that when  I try to save some data writing into the flash memory the DSP lose the control.
If I'm in debug mode the code execution finish into:
 
"#pragma interrupt alignsp
void Cpu_Interrupt(void)
{
  asm(DEBUGHLT);                      
}"
 
 
this are the steps I use to call the processor expert routine that write the flash memory:
 
OSIntEnter();
                      
            err = Flash_SetByte(address*2 , *cast_byte);
 
OSIntExit();
 
The OSIntEnter()  is used to tell to the RTOS that the DSP is about to service an interrupt  service routine (ISR).
 
The address I use starts from the:
DATA_FLASH_START 16384
till 16484
 
any Ideas on what I wrong?
 
0 件の賞賛
1 解決策
959件の閲覧回数
william_jiang
NXP Apps Support
NXP Apps Support
Is there any error code returned when you call "err = Flash_SetByte(address*2 , *cast_byte);"? How about using Flash_SetWord()?
Is there any interrupt service routine that accesses the data in the data flash? If so, disable these interrupt routines before erasing/programming the flash. That is the code snippet looks like this:
OSEnterCritical();     // disable all interrupts                 
            err = Flash_SetByte(address*2 , *cast_byte);
 
OSExitCritical(); // enable interrupts
 

元の投稿で解決策を見る

0 件の賞賛
1 返信
960件の閲覧回数
william_jiang
NXP Apps Support
NXP Apps Support
Is there any error code returned when you call "err = Flash_SetByte(address*2 , *cast_byte);"? How about using Flash_SetWord()?
Is there any interrupt service routine that accesses the data in the data flash? If so, disable these interrupt routines before erasing/programming the flash. That is the code snippet looks like this:
OSEnterCritical();     // disable all interrupts                 
            err = Flash_SetByte(address*2 , *cast_byte);
 
OSExitCritical(); // enable interrupts
 
0 件の賞賛