This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AG_INITSTARTLOAD in apntex_173.zip

We've realized a driver for ARM7 based on apntex_173.zip, and debug project normally at SRAM, but when we download flash and debug abnormal, Initialization File ROM.ini as follow:

FUNC void Setup (void) {
// Enable DMM mode of 501 _WDWORD(0xB1007008, 0x9); _WDWORD(0xB1007004, 0x007F0001); _WDWORD(0xB1000034, 0x140); _WDWORD(0xB1007000, 0x0B321344);
}

FUNC void copytosram(void)
{ // Copy 0x58 bytes startup code from 0x40000000 printf("Before Copy Code to SRAM!\n"); r0 = 0x40000000; for(r1=0;r1<0x58;r1+=4) { _WDWORD(r1 , _RDWORD(r0+r1)); }

// Set the start address PC = 0x40000000; printf("After Copy Code to SRAM!\n");
}

Setup(); // Setup Running, Please wait ...
load %L NOCODE INCREMENTAL
copytosram();
g, main

we can make sure that project object have downloaded into flash,
when execute Setup() function, we can find that will execute as follow in AGDI.cpp file
U32 _EXPO_ AG_MemAcc (U16 nCode, UC8 *pB, GADR *pA, UL32 nMany) {
{ ...
case AG_WRITE: // need 'write' permission if(WriteOpcode (pA->Adr, pB, nMany, &nErrAddr) != 0) { pA->ErrAdr = nErrAddr; nErr = AG_WRFAILED; } else pA->ErrAdr = 0; break;
...
} but when we execute load %L NOCODE INCREMENTAL,
it only load project ROM part into 0x40000000, and SRAM part code don't load int SRAM, anyone can help, thanks a lot!
ROM/SPI Flash: 0x40000000~0x401FFFFF

0