56f8367 Flash writing problem

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

56f8367 Flash writing problem

Jump to solution
2,351 Views
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 Kudos
Reply
1 Solution
1,199 Views
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
 

View solution in original post

0 Kudos
Reply
1 Reply
1,200 Views
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 Kudos
Reply