cancel
Showing results for 
Search instead for 
Did you mean: 

Nor Flash

Audry
New Contributor

Hello,

I am using a S29GL128P  on my system. Is it safe if the polling (using  lld_S29GLxxxP.c) might be interrupted by other tasks or any interruption ? (using RTEMS5)

Or is it something not to do at all ? I am asking because I'm facing a lot of trouble if I don't protect the polling call by a mutex (commands were already protected), but I can't understand what is going on.

It seems to works fine if protected. However this is really bad because erasing is long...

OK pseudo code:

critical_section_lock();

sector_erase_cmd();

poll(); // -> this is long

critical_section_unlock();

 

not working pseudo code:

critical_section_lock();

sector_erase_cmd();

critical_section_unlock();

poll(); // ->  can be interrupted

 

Best regards,

 

Audry

 

0 Likes
1 Solution
AS_36
Moderator
Moderator

Hi Audry,

I would like to inform you that if you want to perform any other operation on the flash (like read data from, or program data to, any sector not selected for erasure) while you have already initiated an erase operation, then you first need to send the Erase Suspend command. The Erase Suspend command allows the system to interrupt a sector erase operation and then read data from, or program data to, any sector not selected for erasure.

I would also like to inform you that Once the sector erase operation has begun, only the Erase Suspend command is valid. All other commands are ignored.

This information is present in the datasheet for S29GL128P available here under section '7.7.5 Erase Suspend/Erase Resume Commands' and '7.7.3 Sector Erase '

Does this answer your question?

Thank you and Regards.

View solution in original post

0 Likes
2 Replies
AS_36
Moderator
Moderator

Hi Audry,

I would like to inform you that if you want to perform any other operation on the flash (like read data from, or program data to, any sector not selected for erasure) while you have already initiated an erase operation, then you first need to send the Erase Suspend command. The Erase Suspend command allows the system to interrupt a sector erase operation and then read data from, or program data to, any sector not selected for erasure.

I would also like to inform you that Once the sector erase operation has begun, only the Erase Suspend command is valid. All other commands are ignored.

This information is present in the datasheet for S29GL128P available here under section '7.7.5 Erase Suspend/Erase Resume Commands' and '7.7.3 Sector Erase '

Does this answer your question?

Thank you and Regards.

View solution in original post

0 Likes
Audry
New Contributor

Hi,

Thanks for the answer. Yes it helps to know that, I did not realize that I could not read data while erasing beeing performed.

However, all flash access are protected by a mutex, so it not possible for the software to try to read or doing anything while the erasing is not terminated.

0 Likes