This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: Problem found with flash driver


Hi,

> Von: ecos-discuss-owner@ecos.sourceware.org
> 
> Hello everyone, I think I have found a minor problem with the io layer
> of the flash driver and before I continue with my fix, I just thought
> that I would ask if anyone else has seen it. 
> 
> I am using JFFS2 over a flash bank that I am not running code from, so
> interrupts can be enabled during flash access. The processor is an
> MPC850. 
> 
> With the virgin eCos flash.c code (from CVS), the system 
> crashes with a
> random memory corruption, I have tracked it down to a context switch
> within the flash_program function in flash.c. After looking 
> through the
> file and the eCos mailing list I found that the HAL_FLASH_CACHES_OFF
> define states that interrupts must be disabled. 

I had also crashes when interrupts occured during flash_program(). But since we don't write often on the flash, I simply disabled interrupts when calling flash_program(). This is not optimal, but was good enough for our purpose.
 
> After modding the code to disable interrupts before flushing and
> disabling the cache, the system works correctly with no problems.  

Sounds good :-)
There is also a different flash branch, maybe this is fixed there, I don't know.
 
> I have not created a patch because the HAL_FLASH_CACHES_OFF define in
> flash.h looks very generic and I cannot test the mod. But 
> this is what I
> have done:

Can you please send it as a patch ?

Bye
Alex

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]