warning from the latest version of OpenOCD?

hello,

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.

Does anyone know a bit more than me?

Thanks in advance!

Both the above commands are completing ok, what is the next line in your script. I am guessing it is an flash erase?

It is warning you that you may have the incorrect parameters.

Show us your config and full flash script.

Regards

Spen

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

ntfreak:
Both the above commands are completing ok, what is the next line in your script. I am guessing it is an flash erase?

It is warning you that you may have the incorrect parameters.

Show us your config and full flash script.

Regards

Spen

thanks for the reply. You’ve guessig right, the next command in my script is indeed flash erase, here it is:

*mww 0xfffffd44 0x00008000 # disable watchdog* *mww 0xfffffd08 0xa5000001 # enable user reset* *mww 0xfffffc20 0x00000601 # CKGR_MOR : enable the main oscillator* *sleep 10* *mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz* *sleep 10* *mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz* *sleep 10* *mww 0xffffff60 0x003c0100 # MC_FMR: flash mode (FWS=1,FMCN=60)* *poll* *flash probe 0* *flash info 0* *arm7_9 dcc_downloads enable* *flash protect_check 0* *flash protect 0 0 7 off* *flash erase 0 0 7* *flash erase_check 0* *flash write_binary 0 main.bin 0x0* *at91sam7 gpnvm 0 0 set* *at91sam7 gpnvm 0 1 set* *reset run* *shutdown*

and here is the config file that I use:

telnet_port 4444
gdb_port 3333
interface ft2232
ft2232_device_desc “Olimex OpenOCD JTAG A”
ft2232_layout “olimex-jtag”
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 0
jtag_nsrst_delay 200
jtag_ntrst_delay 200
jtag_device 4 0x1 0xf 0xe
daemon_startup reset
target arm7tdmi little run_and_init 0 arm7tdmi
run_and_halt_time 0 30
working_area 0 0x00200000 0x4000 nobackup
flash bank at91sam7 0 0 0 0 0

Regards,

Dim

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.

Regards,

Dim