我在flash定义了一块空间,想将数据写入固定flash空间,但是每次都是0xff是否是操作流程有问题,cmd如下:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
MEMORY
{
// BOOT_BEGIN : origin = 0x080000, length = 0x000002
CPU1_BEGIN : origin = 0x0A0000, length = 0x000002 // Update the codestart location as needed
CPU2_BEGIN : origin = 0x100000, length = 0x000002
BOOT_RSVD : origin = 0x000002, length = 0x0001AF /* Part of M0, BOOT rom will use this for stack */
RAMM0 : origin = 0x0001B1, length = 0x00024F
RAMM1 : origin = 0x000400, length = 0x000400
RAMD0 : origin = 0x00C000, length = 0x002000
RAMD1 : origin = 0x00E000, length = 0x002000
RAMD2 : origin = 0x01A000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0x8000. User should comment/uncomment based on core selection
RAMD3 : origin = 0x01C000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xA000. User should comment/uncomment based on core selection
RAMD4 : origin = 0x01E000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xC000. User should comment/uncomment based on core selection
RAMD5 : origin = 0x020000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xE000. User should comment/uncomment based on core selection
RAMLS0 : origin = 0x008000, length = 0x000800
RAMLS1 : origin = 0x008800, length = 0x000800
RAMLS2 : origin = 0x009000, length = 0x000800
RAMLS3 : origin = 0x009800, length = 0x000800
写入方式用了两种,一种是用汇编:
asm(" .sect CPU1FLASH ");
asm(" .WORD 5555H ");
asm(" .text ");
另一种如下:
#pragma DATA_SECTION(test_sj,"CPU1FLASH");
const uint16 test_sj[10]={0,1,2,3,4,5,6,7,8,9};
均写入失败,求原因。