Hello forum! I am bringing up DA8901, which has a Cortex M0 core, 3 KB ROM (has factory bootloader code) and 20 KB SRAM (at 0x20000000). This chip is booted by an external master uC over SDIO or SWD (I am using SWD). I got DA8901 responding to SWD, and now I am trying to write my afx file to the SRAM. Based on the SWD protocol decoder output in my logic analyzer, I do NOT see any evidence that the code is being written to the SRAM (or anywhere else for that matter).
I tried issuing _WDWORD(0x20000000, 0x12345678) in the uVision debugger command window, and I DO see the SWD command for that on the logic analyzer. But when I run _RDWORD(0x20000000) right after that, I do NOT see anything on the logic analyzer. BUT the uVision debugger command window returns 0x12345678!
I initially tried setting the Target option as follows, but link failed ("Error: L6406E No space in execution regions with .ANY selector matching <my source>.o"):
IROM1 ("default" unchecked): Start = 0x10000000, Size = 0xC00. "Startup" radio button selected.
IRAM ("default" checked"): Start = 0x20000000, Size = 0x5000. NoInit unchecked
So I am using a scatter file for now (with R/O base 0x0, R/W base 0x20000000):
LOAD_REGION 0x20000000 { ; Executable data in ROM EXEC_REGION 0x20000000 { *.o (RESET, +First) .ANY (+RO) .ANY (+RW +ZI) }
; Code's stack space. STACK_RAM 0x20004C00 UNINIT 0x00000400 { *.o (STACK) } }
I searched around this forum, and tried this ini file:
LOAD %L SP = _RDWORD(0x20000000) $ = _RDWORD(0x20000004) //G,AppInit
Like I said, I don't see the actual code download activity on the logic analyzer. And changing the PC to the reset vector (0x20000004) just crashes the uC (that is, PC becomes 0xFFFFFFFF).
There seems to be multiple problems here, but for now, I would be happy if I can see the FW downloaded to 0x20000000. I am considering writing a ini function to _WDWORD the binary a word at a time, but I would like to confirm that there isn't some easy procedure I should follow.
Thank you very much for reading.
Thank you that did the trick! I *think* $ is the same as PC, so I assume the "g,main" did the trick. My main entry function is AppInit, so here is my new ini file:
// RESET // E long 0x4000C008 = 0x1800800 LOAD %L INCREMENTAL //"out\da8901.axf" SP = _RDWORD(0x20000000) PC = _RDWORD(0x20000004) g,AppInit