This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] UCD3138064:使用 MFBALR17保护第二个32KB 程序闪存

Guru**** 654100 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1118591/ucd3138064-protecting-second-32kb-of-program-flash-using-mfbalr17

器件型号:UCD3138064

大家好、 我的程序将所有 64KB 用于代码。 我想为 两个闪存组启用 MFBALRx 只读保护

闪存组0很简单:将 TI 示例代码添加到 ASM 加载程序中

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

但我遇到了闪存组1的问题:当我在加载器中添加略微修改的代码时、CPU 会在执行期间复位

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

在从 函数 zero_out_integration_word 到 MFBALR17的任何写入过程中,也会重新启动 CPU (DecRegs.MFBALR17.all = MFBALRX_BYTE0_BLOCK_SIZE_32K;)

 MFBALR17是否 受到特别的写保护?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我现在知道了、尽管寄存器专用于闪存组1、但它必须具有闪存组的地址  

    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
    LDR		r0,c_mfbalr17_halt0_load
    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
    c_mfbalr17_halt0_load .long 0x8062	;address of second bank + read only protection

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢你。