在EZ Flash 3中寫入PSRAM 1

[英]Writing PSRAM in EZ Flash 3 in 1


I am trying to figure out how to program the PSRAM in the GBA sized EZ Flash 3 in 1 card. Basically repeat what GBA Exploader and other programs do.

我試圖弄清楚如何在GBA大小的EZ Flash 3合1卡中編程PSRAM。基本上重復GBA Exploader和其他程序的功能。

If I select a block and program it then read it back the first halfword is always 0x1500 or something like that, but the rest of the data is fine.

如果我選擇一個塊並對其進行編程然后將其讀回來,那么前半個字總是0x1500或類似的東西,但其余的數據都很好。

If on the write I select the previous block, start writing at 0x20000 bytes into that block (the size of a block from what I have determined). Reading back from the desired block still shows that first halfword as wrong but the rest of the halfwords are correct.

如果在寫入時我選擇了前一個塊,則開始以0x20000字節寫入該塊(從我確定的塊的大小)。從所需的塊讀回來仍然表明前半字是錯誤的,但其余半字是正確的。

1 个解决方案

#1


I was this " close. I had tried to back up one and then two blocks but not three and that was the trick. In hind sight notice how many of the functions write to 0x08000000, 0x08020000, and 0x08040000:

我這是“接近。我試圖備份一個然后兩個塊,但不是三個,這就是訣竅。在后面看到有多少函數寫入0x08000000,0x08020000和0x08040000:

void            OpenNorWrite()
{
        *(vuint16 *)0x9fe0000 = 0xd200;
        *(vuint16 *)0x8000000 = 0x1500;
        *(vuint16 *)0x8020000 = 0xd200;
        *(vuint16 *)0x8040000 = 0x1500;
        *(vuint16 *)0x9C40000 = 0x1500;
        *(vuint16 *)0x9fc0000 = 0x1500;
}

The corrupt data was always 0x1500, which make sense now too.

損壞的數據總是0x1500,現在也有意義。

The solution is to back up three (or more) blocks and address forward three (or more) blocks:

解決方案是備份三個(或更多)塊並向前轉發三個(或更多)塊:

CloseNorWrite();
SetRompage(0x180-3);
OpenNorWrite();
rb=FLASHBASE+(0x20000*3);
for(ra=0;ra<(sizeof(prog)>>2);ra++)
{
    rc=prog[ra];
    PUT16(rb,(rc>> 0)&0xFFFF); rb+=2;
    PUT16(rb,(rc>>16)&0xFFFF); rb+=2;
}
CloseNorWrite();
SetRomPage(0x180);
reboot();

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/05/18/729d039c475e964b88f36f9373bd3c07.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com