Index: current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxx/current/ChangeLog,v retrieving revision 1.32 diff -u -p -b -w -U5 -r1.32 ChangeLog --- current/ChangeLog 23 Apr 2004 20:50:32 -0000 1.32 +++ current/ChangeLog 9 Nov 2004 08:05:00 -0000 @@ -1,5 +1,11 @@ +2004-11-09 Per Hedblom + + * include/flash_am29xxxxx.inl: Bug. The flash erase fails during interrupts. + The erase command must be given within a 50uS timeframe and the AMD manual + recommends that interrupts are disabled during this timeframe. + 2004-04-21 Sebastien Couret * include/flash_am29xxxxx.inl: Minor changes to silence warnings. 2004-04-08 Bob Koninckx Index: current/include/flash_am29xxxxx.inl =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl,v retrieving revision 1.22 diff -u -p -b -w -U5 -r1.22 flash_am29xxxxx.inl --- current/include/flash_am29xxxxx.inl 23 Apr 2004 20:50:32 -0000 1.22 +++ current/include/flash_am29xxxxx.inl 9 Nov 2004 08:05:01 -0000 @@ -67,10 +67,11 @@ #include #include #include #include #include +#include #include CYGHWR_MEMORY_LAYOUT_H #define _FLASH_PRIVATE_ #include @@ -356,19 +357,19 @@ flash_erase_block(void* block, unsigned if (FLASH_unlocked != state) return FLASH_ERR_PROTECT; #endif b_v = FLASH_P2V(b_p); - + cyg_drv_isr_lock(); // Send erase block command - six step sequence *f_s1 = FLASH_Setup_Code1; *f_s2 = FLASH_Setup_Code2; *f_s1 = FLASH_Setup_Erase; *f_s1 = FLASH_Setup_Code1; *f_s2 = FLASH_Setup_Code2; *b_v = FLASH_Block_Erase; - + cyg_drv_isr_unlock(); // Now poll for the completion of the sector erase timer (50us) timeout = CYGNUM_FLASH_TIMEOUT_ERASE_TIMER; // how many retries? while (true) { state = *b_v; if ((state & FLASH_Sector_Erase_Timer)