I’m using the most recent version of the OpenOCD, together with AT91SAM7S128 based board.
I’m using it since a long time but so far never got the mentioned below warning message.
These commands are part of a script which I use to upload FW into the MCU flash:
flash protect_check 0 flash protect 0 0 7 off
Output from the OpenOCD:
Info: configuration.c:50 configuration_output_handler(): successfully checked protect state Info: configuration.c:50 configuration_output_handler(): cleared protection for sectors 0 through 7 on flash bank 0 Warning: at91sam7.c:654 at91sam7_erase(): Sector numbers based on lockbit count, probably a deprecated script
Everyting works fine, but I’m wondering why the warning appeared. Obviously something in this command was changed, but I can’t find any info about the matter in the web resources.
On the AT91SAM7S128 it is only possible the erase the full flash plane, so there is only one erase block of 128k. The bigger 512k parts have 2x256 flash banks.
So the erase numbering has changed and should be (erase block 0 upto 0)
flash erase 0 0 0
On the other hand you do not need to use the erase command on the AT91SAM7 chips just to write a new flash image, that is handled by the flash controller. erase command is only neede if you want a cleared state in the rest of the flash memory.
This is described in the OpenOCD wiki for AT91SAM specific commands, but is is not clear that the behaviour has changed
mlu:
On the AT91SAM7S128 it is only possible the erase the full flash plane, so there is only one erase block of 128k. The bigger 512k parts have 2x256 flash banks.
So the erase numbering has changed and should be (erase block 0 upto 0)
flash erase 0 0 0
On the other hand you do not need to use the erase command on the AT91SAM7 chips just to write a new flash image, that is handled by the flash controller. erase command is only neede if you want a cleared state in the rest of the flash memory.
This is described in the OpenOCD wiki for AT91SAM specific commands, but is is not clear that the behaviour has changed
Regards
Magnus
Magnus, thanks a lot for the tips. I’ll read the AT91SAM7 specific commands once again, obviously I’ve missed the part for the auto erase.