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.

[参考译文] 编译器/MSP430FR5994:写入更高地址0x10000

Guru**** 2580715 points
Other Parts Discussed in Thread: MSP430FR5994

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/612096/compiler-msp430fr5994-write-to-higher-addresses-0x10000

器件型号:MSP430FR5994

工具/软件:TI C/C++编译器

您好!

我尝试升级 MSP430FR5994固件、同时在自定义引导加载程序中写入主应用程序映像。 当地址达到0x10000时、映像写入失败。

我将二进制文件写入闪存的函数是---

unsigned char write_image_to_flash (int32_t addr、uint8_t 数据)

uint8_t dummy_var;
dummy_var=*(uint8_t*) addr;

MPUCTL0 = MPUPW | MPUENA;//启用对 MPU 寄存器的访问
MPUSAM |= MPUSEG2WE;//启用写入访问
*(uint8_t *)(((uint32_t) addr)= data;//编写矢量
MPUSAM &=~MPUSEG2WE;//禁用写访问
MPUCTL0_H = 0x00;//禁止访问 MPU 寄存器

dummy_var=*(uint8_t*) addr;

返回(dummy_var == data)? 成功:失败;
//返回 RET_OK;

我之前已经测试过这个功能、之前的图像尺寸很小、一切都正常。(如果地址在0x10000以下)