56f8367 Flash writing problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

56f8367 Flash writing problem

跳至解决方案
2,110 次查看
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 解答
958 次查看
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 回复
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 项奖励