This is the mail archive of the mailing list for the GDB 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]

Re: [PATCH, v2] Add command to erase all flash memory regions

On 01/11/2017 06:55 PM, Luis Machado wrote:
> On 01/10/2017 12:22 PM, Pedro Alves wrote:

>> I was wondering how this is supposed to work if the command
>> is interrupted w/ ctrl-c midway.  If the command is interrupted before
>> sending the vFlashDone RSP command, then it seems to me that the stub
>> is doing to get confused, since it seems there's no RSP command to
>> mean "I'm starting a batch of flash operations from scratch, forget
>> any stale list of pending vFlashWrite/vFlashErase ops you may have.
>> Am I missing something that prevents that from happening?
> Yeah, that scenario can indeed happen if one interrupts the flash
> programming midway. It is a bit of an oversight in the design of this
> functionality i think.
> The target stub, as it is today, will not be too confused about this.
> The memory regions will be appended to a list and the stub will wait for
> the vFlashDone packet to commit the changes.
> The way the commit process is implemented will attempt to combine
> writes/deletions in a single operation. So, in the worst case, the stub
> will only execute these operations next time it sees vFlashDone.
> Not ideal, but it is how it works nowadays.

Hmm, indeed.  Not as bad as I first though.  Thanks.

Pedro Alves

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