hi, my program uses all 64KB for code. I would like to enable MFBALRx read only protection for both flash banks
flash bank 0 was easy: add TI example code to the asm loader
LDR r4,c_mfbalr1_half0 ;point r4 at program flash base address register MOV r0,#0x62 ;make block size 32K, address 0, read only STRH r0,[r4]; store it there . . . c_mfbalr1_half0 .long 0xFFFFFE0E ;low 16 bits of memory fine bank address low - FLASH#0
But I've got issues with flash bank 1: when I add slightly modified code in loader, CPU resets during it's execution
LDR r4,c_mfbalr1_half0 ;point r4 at program flash base address register MOV r0,#0x62 ;make block size 32K, address 0, read only STRH r0,[r4]; store it there LDR r4,c_mfbalr17_half0 ;point r4 at program flash base address register MOV r0,#0x62 ;make block size 32K, address 0, read only STRH r0,[r4]; store it there . . . c_mfbalr1_half0 .long 0xFFFFFE0E ;low 16 bits of memory fine bank address low - FLASH#0 c_mfbalr17_half0 .long 0xFFFFFE8E ;low 16 bits of memory fine bank address low - FLASH#1
CPU is rebooted also during any write from function zero_out_integrity_word to MFBALR17 (DecRegs.MFBALR17.all = MFBALRX_BYTE0_BLOCK_SIZE_32K; )
is MFBALR17 specially protected from write?