Other Parts Discussed in Thread: SYSBIOS, SYSCONFIG
Hi,
I have a problem with the following SYS/BIOS application:
The EDMA of my AM3359 is programmed to feed a FIFO in an external CPLD via the GPMC interface. The FIFO is read out using an external clock. To prevent a FIFO overflow, the CPLD is programmed to set the GPMC /WAIT signal if the FIFO is almost full. A GPIO "wait_enable" from the ARM to the CPLD allows to do so. This slows down / synchronises the EDMA with the external clock, while the CPU can do other things (of course must not use the GPMC / this EDMA channel meanwhile).
The SYS/BIOS clock function triggers a timeout, if the FIFO is not emptied and the EDMA transfer completion interrupt does not come within time, e.g. because the external clock signal is missing. The timeout resets the "wait_enable" signal to the CPLD, so that it releases the GPMC /WAIT, and finally the EDMA transfer runs to completion (now with FIFO overflow), and further error handling is done etc.
This all works fine ...
...until I add a third party USB driver software package. Now it happens, that the CPU (internal bus?) is blocked totally. No clock / timeout interrupt anymore, no chance to get the CPU stopped using the debugger if there is no external clock and the GPMC /WAIT is active:
CortxA8: Trouble Halting Target CPU: (Error -2062 @ 0x3E418)
Unable to halt device. Reset the device, and retry the operation.
If error persists, confirm configuration, power-cycle the board,
and/or try more reliable JTAG settings (e.g. lower TCLK). (
Emulation package 6.0.407.3)
If the external clock is switched on again, the CPU is halted at an access to a USB register at address 0x47401460 (a 10 ms polling triggered by a task), details see below.
The USB driver (some more than a few lines of code) neither uses GPMC nor EDMA, far as I can see.
How this can be explained? (A GPMC /WAIT to EDMA should not block the CPU access to an internal register!)
Are there any settings in the GPMC / EDMA / MMU (or whatever) configuration that do not match or may be in contradiction? Where to search first?
Thanks in advance,
Regards
Frank
Disassembly of halted CPU:
R12 = 0x47401460
UsbdDc_GetVbusState(), Usbd_IsVbusPresent():
801bd1d8: E59FC5F4 ldr r12, [pc, #0x5f4] // R12 = 0x47401460
801bd1dc: E5DCC000 ldrb r12, [r12]
1611 vbus = T_TRUE;
801bd1e0: E20CC018 and r12, r12, #0x18 // debugger halts here
801bd1e4: E35C0018 cmp r12, #0x18
801bd1e8: E3A00000 mov r0, #0
801bd1ec: 03A00001 moveq r0, #1
801bd1f0: E12FFF1E bx lr
C Code:
USBD_DC_LINKAGE
T_BOOL
UsbdDc_GetVbusState(
T_UsbdDeviceCore* devc
)
{
T_BOOL vbus = T_FALSE;
T_UINT8 reg8;
TB_UNUSED_PARAM(devc);
#if (TRACE_ENABLE != 0)
TRACEPrint(TRACE_LVL_USBD_EP, "%s [\n", __FUNCTION__);
#endif
/* current VBUS level is indicated in DEVCTL register */
reg8 = READ_REG8(TIMNT_USBOTG_REG8_DEVCTL);
if ( TIMNT_DEVCTL_VBUS_ABOVEVALID == (reg8 & TIMNT_DEVCTL_VBUS_ABOVEVALID) ) {
/* VBUS is at valid level */
vbus = T_TRUE;
}
#if (TRACE_ENABLE != 0)
TRACEPrint(TRACE_LVL_USBD_EP, "%s ]\n", __FUNCTION__);
#endif
return vbus;
} /* UsbdDc_GetVbusState */