22-FlashMemory_Test

Report
UNIT
22 Flash Memory Controller Tes
로봇 SW 교육원
조용수
학습 목표
•
•
•
•
FMC Read
FMC Write
FMC Erase
FMC Memory Test
2
FMC Init
3
• FMC 는 Clock 이 기본적으로 제공된다.
• 따라서 사용시 FMC_Open() , 종료시 FMC_Close()
를 사용한다.
FMC Read Data Flash Address
SYS_UnlockReg();
FMC_Open();
u32Addr = FMC_ReadDataFlashBaseAddr();
printf("Data Flash Addres : 0x%x\n", u32Addr);
FMC_Close();
SYS_LockReg();
4
FMC Read Data
SYS_UnlockReg();
FMC_Open();
u32Addr = FMC_ReadDataFlashBaseAddr();
printf("Data Flash Addres : 0x%x => 0x%x\n",
u32Addr, FMC_Read(u32Addr));
FMC_Close();
SYS_LockReg();
5
FMC Write Data
SYS_UnlockReg();
FMC_Open();
u32Addr = FMC_ReadDataFlashBaseAddr();
u32Data = 0x12345678;
FMC_Write(u32Addr, u32Data);
printf("Data Flash Addres : 0x%x => 0x%x\n",
u32Addr, FMC_Read(u32Addr));
FMC_Close();
SYS_LockReg();
6
FMC Erase Data
SYS_UnlockReg();
FMC_Open();
u32Addr = FMC_ReadDataFlashBaseAddr();
FMC_Erase(u32Addr);
printf("Data Flash Addres : 0x%x\n", u32Addr);
FMC_Close();
SYS_LockReg();
7
FMC Write and Erase
SYS_UnlockReg();
FMC_Open();
u32Addr = FMC_ReadDataFlashBaseAddr();
u32Data = 0x12345678;
for( i = 0; i < 512 ; i+=4) {
FMC_Write(u32Addr + i, u32Data);
}
for(i = 0; i < 512 ; i+=4) {
printf(" 0x%x ", FMC_Read(u32Addr));
}
FMC_Erase(u32Addr);
for(i = 0; i < 512 ; i+=4) {
printf(" 0x%x ", FMC_Read(u32Addr));
}
FMC_Close();
SYS_LockReg();
8
FMC Write ID
9
• FMC 의 Address ( 0x1f000) 에 사용자 이름 을 저장
하세요

similar documents