Edgar Grimberg wrote: > Hi Spen, > >> Could you provide a full debug log? > > For the commands: > >> debug_level 3 > debug_level: 3 >> flash protect 0 0 last off > cleared protection for sectors 0 through 7 on flash bank 0 >> flash protect_check 0 > successfully checked protect state >> flash info 0 > #0 : str7x at 0x40000000, size 0x00040000, buswidth 0, chipwidth 0 > # 0: 0x00000000 (0x2000 8kB) protected > # 1: 0x00002000 (0x2000 8kB) protected > # 2: 0x00004000 (0x2000 8kB) protected > # 3: 0x00006000 (0x2000 8kB) protected > # 4: 0x00008000 (0x8000 32kB) protected > # 5: 0x00010000 (0x10000 64kB) protected > # 6: 0x00020000 (0x10000 64kB) protected > # 7: 0x00030000 (0x10000 64kB) protected > str7x flash driver info > > > I get this log: > > User : 46 20916 command.c:536 command_print(): debug_level: 3 > Debug: 47 29508 command.c:133 script_debug(): command - ocd_command > ocd_command type ocd_flash protect 0 0 last off > Debug: 48 29508 command.c:133 script_debug(): command - ocd_flash > ocd_flash protect 0 0 last off > Debug: 50 29508 target.c:1565 target_write_u32(): address: 0x40100014, > value: 0x00000000 > Debug: 51 29508 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000004 > Debug: 52 29511 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000005 > Debug: 53 29512 target.c:1565 target_write_u32(): address: 0x40100000, > value: 0x01000000 > Debug: 54 29512 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000004 > Debug: 55 29514 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000005 > Debug: 56 29515 target.c:1565 target_write_u32(): address: 0x40100010, > value: 0x4010dfb0 > Debug: 57 29515 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000004 > Debug: 58 29518 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000005 > Debug: 59 29519 target.c:1565 target_write_u32(): address: 0x40100008, > value: 0xffffffff > Debug: 60 29519 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000004 > Debug: 61 29521 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000005 > Debug: 62 29522 target.c:1565 target_write_u32(): address: 0x40100000, > value: 0x81000000 > Debug: 63 29522 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000004 > Debug: 64 29524 embeddedice.c:497 embeddedice_write_reg(): 0: 0x00000005 > Debug: 65 29525 arm7_9_common.c:2237 arm7_9_read_memory(): address: > 0x40100000, size: 0x00000004, count: 0x00000001 > Debug: 66 29528 target.c:1488 target_read_u32(): address: 0x40100000, > value: 0x00000000 > Debug: 67 29528 arm7_9_common.c:2237 arm7_9_read_memory(): address: > 0x40100014, size: 0x00000004, count: 0x00000001 > Debug: 68 29531 target.c:1488 target_read_u32(): address: 0x40100014, > value: 0x00000000 > Debug: 69 29531 str7x.c:303 str7x_protect(): retval: 0x00000000 > User : 70 29531 command.c:536 command_print(): cleared protection for > sectors 0 through 7 on flash bank 0 > Debug: 71 37044 command.c:133 script_debug(): command - ocd_command > ocd_command type ocd_flash protect_check 0 > Debug: 72 37044 command.c:133 script_debug(): command - ocd_flash > ocd_flash protect_check 0 > Debug: 74 37044 arm7_9_common.c:2237 arm7_9_read_memory(): address: > 0x4010dfb0, size: 0x00000004, count: 0x00000001 > Debug: 75 37047 target.c:1488 target_read_u32(): address: 0x4010dfb0, > value: 0xffffff00 > User : 76 37047 command.c:536 command_print(): successfully checked > protect state > Debug: 94 43139 command.c:133 script_debug(): command - ocd_command > ocd_command type ocd_flash info 0 > Debug: 95 43139 command.c:133 script_debug(): command - ocd_flash > ocd_flash info 0 > User : 97 43140 command.c:536 command_print(): #0 : str7x at > 0x40000000, size 0x00040000, buswidth 0, chipwidth 0 > User : 98 43140 command.c:536 command_print(): # 0: 0x00000000 > (0x2000 8kB) protected > User : 99 43140 command.c:536 command_print(): # 1: 0x00002000 > (0x2000 8kB) protected > User : 100 43140 command.c:536 command_print(): # 2: 0x00004000 > (0x2000 8kB) protected > User : 101 43140 command.c:536 command_print(): # 3: 0x00006000 > (0x2000 8kB) protected > User : 102 43140 command.c:536 command_print(): # 4: 0x00008000 > (0x8000 32kB) protected > User : 103 43140 command.c:536 command_print(): # 5: 0x00010000 > (0x10000 64kB) protected > User : 104 43140 command.c:536 command_print(): # 6: 0x00020000 > (0x10000 64kB) protected > User : 105 43140 command.c:536 command_print(): # 7: 0x00030000 > (0x10000 64kB) protected > User : 106 43140 command.c:536 command_print(): str7x flash driver info > > >> I have done a check here and its working for me. > > I can see the protect_check command getting 0xffffff00 for the > FLASH_NVWPAR. This means the entire bank 0 is write protected: > Debug: 75 37047 target.c:1488 target_read_u32(): address: 0x4010dfb0, > value: 0xffffff00 > > Regards, > Edgar >
Ah ok, I think this is an issue with the str7, rather than openocd. The flash protection is being removed (until next reset) but we are reading the non-volatile register (FLASH_NVWPAR). This is read at reset and any write to this register only effects the volatile version of FLASH_NVWPAR. The address of the volatile version is unknown. so it is working internally, just the info from protect_check only relates to the volatile FLASH_NVWPAR. Perhaps a str7 specific note needs adding. Cheers Spen _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development