#10 flashing locked partition loses

closed-fixed
flash (8)
6
2002-03-11
2002-02-07
No

> also if a flash block is locked and I try to flash
something
> I have to reboot to reset the flash. both unlock and
further
> flashes will fail. Seen on IDR with cvs.

Yeah, I know about this one -- sort of.

For me, the following sequence does succeeed:

<locked partition, e.g., after power cycle with C3
flash> xdownload partition flash partition {flames
out, oops} unlock partition flash partition

Except that unlock complains that it isn't happy. But
it does work.

This is with the C3 flash.

I quickly eyeball'ed the code again, but I don't see
anything obviously wrong. Time to pore over the CFI
docs again ... sigh.

I suppose a workaround is to check for locks before
attempting flashing ...

-ch

Discussion

  • Logged In: YES
    user_id=9590

    Here's what happens for me (Intel C3 Flash). It looks like
    the error status isn't getting completely cleared.

    blob> xdownload kernel
    Start sending using the XMODEM protocol (repeated ^X to
    quit).

    CCC

    Received 737280 (0x000b4000) bytes
    blob> flash kernel
    Saving kernel to flash
    erasing at 0x0001002c...
    do_erase failed for address 0x0001002c
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    error
    blob> unlock kernel

    flash_unlock_block_intel16 failed for address 0x00010000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00020000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00030000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00040000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00050000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00060000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00070000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00080000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00090000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000a0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000b0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000c0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000d0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000e0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000f0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00100000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    blob> flash kernel
    Saving kernel to flash
    erasing at 0x0001002c... scanning down... resume writing at
    0x00010000
    erasing at 0x00020000... scanning down... resume writing at
    0x0001fffc
    erasing at 0x00030000... scanning down... resume writing at
    0x0002fffc
    erasing at 0x00040000... scanning down... resume writing at
    0x0003fffc
    erasing at 0x00050000... scanning down... resume writing at
    0x0004fffc
    erasing at 0x00060000... scanning down... resume writing at
    0x0005fffc
    erasing at 0x00070000... scanning down... resume writing at
    0x0006fffc
    erasing at 0x00080000... scanning down... resume writing at
    0x0007fffc
    erasing at 0x00090000... scanning down... resume writing at
    0x0008fffc
    erasing at 0x000a0000... scanning down... resume writing at
    0x0009fffc
    erasing at 0x000b0000... scanning down... resume writing at
    0x000afffc
    erasing at 0x000c0000... scanning down... resume writing at
    0x000bfffc
    blob>

     
  • Logged In: YES
    user_id=9590

    Here's what happens for me (Intel C3 Flash). It looks like
    the error status isn't getting completely cleared.

    blob> xdownload kernel
    Start sending using the XMODEM protocol (repeated ^X to
    quit).

    CCC

    Received 737280 (0x000b4000) bytes
    blob> flash kernel
    Saving kernel to flash
    erasing at 0x0001002c...
    do_erase failed for address 0x0001002c
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    error
    blob> unlock kernel

    flash_unlock_block_intel16 failed for address 0x00010000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00020000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00030000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00040000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00050000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00060000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00070000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00080000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00090000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000a0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000b0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000c0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000d0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000e0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x000f0000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    flash_unlock_block_intel16 failed for address 0x00100000
    status = 0x000000a2
    { STATUS_READY STATUS_ERASE_ERR STATUS_LOCKED_ERR }

    blob> flash kernel
    Saving kernel to flash
    erasing at 0x0001002c... scanning down... resume writing at
    0x00010000
    erasing at 0x00020000... scanning down... resume writing at
    0x0001fffc
    erasing at 0x00030000... scanning down... resume writing at
    0x0002fffc
    erasing at 0x00040000... scanning down... resume writing at
    0x0003fffc
    erasing at 0x00050000... scanning down... resume writing at
    0x0004fffc
    erasing at 0x00060000... scanning down... resume writing at
    0x0005fffc
    erasing at 0x00070000... scanning down... resume writing at
    0x0006fffc
    erasing at 0x00080000... scanning down... resume writing at
    0x0007fffc
    erasing at 0x00090000... scanning down... resume writing at
    0x0008fffc
    erasing at 0x000a0000... scanning down... resume writing at
    0x0009fffc
    erasing at 0x000b0000... scanning down... resume writing at
    0x000afffc
    erasing at 0x000c0000... scanning down... resume writing at
    0x000bfffc
    blob>

     
    • status: open --> open-fixed
     
  • Logged In: YES
    user_id=9590

    i believe i fixed this. i tested the sequence below with
    the fix against C3 flash and it worked properly.

     
    • status: open-fixed --> closed-fixed