您好,首先感谢您的回答和即时帮助!霍华德:谢谢你的文件,我会研究并尝试不同的设置。我写的是静态的,但我的意思是静态const。所以我的代码尝试使用DMA从Flash复制到RAM。我的源操作数在9D3030E8,它通过ANP;0x1FFFFFF转换为1D3030E8,我的目的地是800万C34,转换为00000 C34。那么,缓存(如果启用)只与RAM一起使用,还是与Flash一起使用?RISC:不,我刚才提到我有一个板,上面有LAN子板。在这个时候,我不需要实现网络(但如果我这样做,它将不和谐)。@拉里:试图附加一个文件,但得到“不允许访问服务器…”错误,我的帖子也丢失了。我的DMA“复制”函数如下:[ValueDMACPEP(Valu*DST,Value*Src,未签名int size){无符号int SDSCADR;未签名int dSTADDR;SRCADRD=(无符号INT)SRC&0x1FFFFFFF;/ /物理地址SRCDSTADDR=(无符号INT)DST和0x1FFFFFFF;/ /物理地址DST//SRCADRDR= KVAYToEPA(SRC);//DSTADDR=KVAY-TYPA(DST);IEC1CLR=0x000 010000;/ /禁用DMA通道0中断SIFTIFSF1CLR=0X000 010000;/ /清除现有DMA通道0中断FLALDMACON=0x8000;//DMA模块ONDCH0CONC=0x3;//DMA通道禁用,在块传输完成后禁用,优先级3(最高)DCH0ECON=0;/DMA传输不是由IRQ触发的,必须强制,没有模式MatCHDCCRON=0;//CRC模块OFDCHCH0IN=0;/ /中断DeabDeDCH0SSA=SRCADDR;//源启动ADSTRESDCH0DSA=DSTADDR;/ /目的地起始地址ADSDRESCH0SSIZ=大小;/ /源SsieDeCH0DSIZ=大小;/ /目的地n SsieDeCH0csiz=size;//单元大小字节,每个事件转移为0CdCrr= 0x000 FFFFF;//清除事件DC0CONSETSET=0x80;//信道ONDCH00EcCEART=0x80;//传输(CCHORE=1),(DCH0INT&AM.0x4);int dMAFLAGS=DCH0int;}[/COD] ]和我的全局变量是这样设置的:静态UTIN 8T屏幕[1024 ];静态const Unt8t背景[4×1024 ]={0x44,0x1c,…} [代码],我将查找FRM,一旦找出它是什么。并等待着你的“简单”的例子,关于初学者工具包的缓存。Csaba Bacskay(EdcCrrod)
以上来自于百度翻译
以下为原文
Hello,
First of all, thank you for the answers and instant help!
@Howard: Thanks for the document, i'll study it and try different settings. I wrote static, but i meant static const.
So my code tries to use DMA to copy from FLASH to RAM i guess. My source operand is at 9D0030E8, that gets translated via & 0x1FFFFFFF to 1D0030E8, my destination is 80000C34 that gets translated to 00000C34. So then CACHE (if enabled) is used with RAM only, or also with FLASH?
@RISC: No, i just mentioned that i have a board which has the LAN daughterboard on it. At this moment i don't have to implement networking (but if i do, it will go without Harmony).
@Larry: Tried to attach a file but got a 'No permission to access to server..' error and my post also got lost. My DMA 'Copy' function is as follows:
[code]
void DMACopy(void * dst, void * src, unsigned int size){
unsigned int srcAddr;
unsigned int dstAddr;
srcAddr = (unsigned int) src & 0x1FFFFFFF; //Physical address of src
dstAddr = (unsigned int) dst & 0x1FFFFFFF; //Physical address of dst
//srcAddr=KVA_TO_PA(src);
//dstAddr=KVA_TO_PA(dst);
IEC1CLR=0x00010000; // disable DMA channel 0 interrupts
IFS1CLR=0x00010000; // clear existing DMA channel 0 interrupt flag
DMACON = 0x8000; // dma module on
DCH0CON = 0x3; //DMA Channel Disable, turns disabled after block transfer complete, priority 3 (highest)
DCH0ECON = 0; // dma transfer is not triggered by irq, has to be forced, no pattern match
DCRCCON = 0; // crc module off
DCH0INT = 0; // interrupts disabled
DCH0SSA = srcAddr; // source start address
DCH0DSA = dstAddr; // destination start address
DCH0SSIZ = size; // source size
DCH0DSIZ = size; // destination size
DCH0CSIZ = size; // cell size bytes transfered per event
DCH0INTCLR=0x00ff00ff; //clear events and disable interrupts
DCH0CONSET = 0x80; //channel on
DCH0ECONSET = 0x80; //transfer on (CFORCE=1)
while (DCH0INT&0x4);
int DMAFlags=DCH0INT;
}
[/code]
And my global variables are set up like this:
[code]
static uint8_t screen[1024];
static const uint8_t background[4*1024] = {0x44, 0x1C, ...}
[/code]
I'll look up FRM once figure out what is it. And waiting eagerly for your 'simple' example regarding caching for the starter kit.
To all, thank you for the help!
Csaba Bacskay
(Edocecrous)