[ECOS] Problem found with flash driver
Retallack, Mark
mark.retallack@siemens.com
Thu Mar 2 16:43:00 GMT 2006
After reading the flash.h file in more detail, it suggests placing
platform stuff in the correct file and not modifying the flash.h file. I
don't think this is a problem on all platforms so it does not make sence
to do a generic interrupt disable, so I have added it to the
mpc8xx/current/include/var_cache.h file instead. I placed it here and
not in the hal_cache.h because I don't know if it is a PowerPC issue or
just an MPC8xx issue.
I have attached the patch.
-----Original Message-----
From: Neundorf, Alexander [mailto:Alexander.Neundorf@jenoptik.com]
Sent: 02 March 2006 11:08
To: Retallack, Mark; ecos-discuss@ecos.sourceware.org
Subject: AW: [ECOS] 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cache.patch
Type: application/octet-stream
Size: 1831 bytes
Desc: cache.patch
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20060302/56c5de59/attachment.obj>
-------------- next part --------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list