1.RSL10的ROM MAP图
2.从Main Flash中读取4k数据并存入PRAM2后打印的程序
void FLASH_COPY_IRQHandler(void)
{
flash_copier_complete = 1;
}
uint8_t Flash_Read_nBytes_To_Ram(uint32_t flash_addr,uint32_t ram_temp,uint32_t data_leng)
{
/* Enable the flash copier interrupt */
NVIC_EnableIRQ(FLASH_COPY_IRQn);
/* Clear the program flag */
flash_copier_complete = 0;
PRINTF("DEVICE INITIALIZED\n");
/* 1. The first 4 KB of the flash is copied into the CRC block and
* the value is stored in crc_flash_result */
/* Configure the CRC engine */
Sys_CRC_Set_Config(CRC_32 | CRC_LITTLE_ENDIAN);
/* Reset the CRC engine */
CRC->VALUE = CRC_32_INIT_VALUE;
/* Set the flash copier to copy to PRAM;
* wait for the copy to complete before continuing */
Sys_Flash_Copy(FLASH_MAIN_BASE, PRAM2_BASE, 1024, COPY_TO_MEM_BITBAND);
while (flash_copier_complete == 0);
PRINTF("\n**@Flash_Read_nBytes_To_Ram\r\n");//printf one frame
for(uint32_t i=0;i<data_leng;i++)
{
PRINTF("%08x ",p_pram2[i]);//OTA_STM32_Bin_File_Buf[i]);//printf data
if(i%16==15) PRINTF("\r\n");
}
PRINTF("\r\n");
return true;
}
3.从J-Flash读取函数烧录的代码
4.从J-Link RTT Viewer中查看打印输出内容
按4组显示方式:
按16组显示方式:
5.把从J-Flash读取函数烧录的代码与从J-Link RTT Viewer中查看打印输出内容做对照
6.数据分析举例:
从J-Flash读取函数烧录的代码: 00 60 00 20 65 01 10 00 75 01 10 00 77 01 10 00
从J-Link RTT Viewer中查看打印输出内容: 20006000 00100165 00100175 00100177
从以上对照可以知道:Flash是按字读出,即每次读出是4个字节,而且在Flash中的4个字节是高字节在后,低字节在前面。比如0x12345678,在flash中的依次存储内容为:0x78 0x56 0x34 0x12,也就是所谓的小端存储模式。