I know that there must be something I'm missing here, but I've exhausted everything in front of my nose so I'm hoping someone can help. I'm using the ICE board with sys/bios SDK 1.0.0.3. I'm creating a program based on the standard EtherCAT example, and adding to it. So far, all has been going well (added SPI access to my equipment, etc.) Now, I'm trying to enable the EDMA to manage the SPI accesses, and something strange is occurring: I've followed the mcspiFlash_edma.C example for guidance, and it all makes sense. In my code, I call all the init routines per the example, such as EDMA3Initialize(), etc. This all appears to be working correctly because until EDMAModuleClkConfig() gets called, the EDMA module (at address 0x49000000) isn't even accessible via CCS debug perspective. But after the Clk module config, I can view and interact with all the available EDMA registers via the "memory browser" tab of the debug perspective. The values of these registers even makes sense (such as the PID @ offset 0 etc). So you would think the rest of the code should work fine. But alas no.
Whenever my code attempts to access any of the EDMA registers (read or write), the processor immediately throws an exception. In the example program, EDMA3Initialize() calls EDMA3Init(SOC_EDMA30CC_0_REGS, EVT_QUEUE_NUM), which does a bunch of "HWREG" accesses to configure the EDMA registers. But any of these throws a processor exception:
[CortxA8] dle: 0x80030948.
Task stack base: 0x80023158.
Task stack size: 0x800.
R0 = 0x00000000 R8 = 0xffffffff
R1 = 0x44e00004 R9 = 0xffffffff
R2 = 0x8000550c R10 = 0xffffffff
R3 = 0x8001f338 R11 = 0xffffffff
R4 = 0xffffffff R12 = 0x49000000
R5 = 0xffffffff [CortxA8] SP(R13) = 0x80023928
R6 = 0xffffffff LR(R14) = 0x80004fc4
R7 = 0xffffffff PC(R15) = 0x80004fc8
PSR = 0x4000019f
ti.sysbios.family.arm.exc.Exception: line 174: E_dataAbort: pc = 0x80004fc8, lr = 0x80004fc4.
[CortxA8] xdc.runtime.Error.raise: terminating execution
After EDMAModuleClkConfig() is called, even the simplest EDMA register access debug instruction such as (taken from Disassembly window):
:
323 test1 = HWREG(SOC_EDMA30CC_0_REGS + 0);
80004fc4: E3A0C449 MOV R12, #1224736768
80004fc8: E59CC000 LDR R12, [R12]
80004fcc: E58DC000 STR R12, [R13]
:
(which should read the EDMA's PID register which I can see in the memory browser window has a value of 0x40014C00) throws an exception at the 2nd assembly instruction where the read of 0x49000000 via R12 is attempted.
So I'm quite confused how I can freely access the (apparently) properly-initialized EDMA module via the "Memory Browser" window of CCS, but even the simplest attempt to read or write a register via my program throws an exception.
Any help is appreciated!