S29GL128P nor flash VS µC interruption during polling

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Audry
Level 1
Level 1
First reply posted First question asked Welcome!

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
Apurva_S
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

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
Apurva_S
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

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.

0 Likes
Audry
Level 1
Level 1
First reply posted First question asked Welcome!

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