Hi,
We adapted usb communication to HID. We send 64 bytes every 4ms and allow interruptions. Globally, it works but from time to time (every 1 to 10 minutes), the controller goes to abort mode.
Here is the stack:
USBEndpointDataPut(unsigned int, unsigned short, unsigned char *, unsigned int)() at usb.c:737 0x00015E68
ScheduleReportTransmission(struct <unnamed> *)() at usbdhid.c:925 0x0000E724
USBDHIDReportWrite(void *, unsigned char *, unsigned int, unsigned char)() at usbdhid.c:2,390 0x0000F4F0
USBDHIDDataTransfert(unsigned char *)() at usbdhidaxinesis.c:702 0x0001E458
main() at sys_main.c:131 0x00023808
_c_int00() at sys_startup.c:342 0x00024288 (the entry point was reached)
and the lines concerned by the stack:
USBEndpointDataPut(unsigned int, unsigned short, unsigned char *, unsigned int)() at usb.c:737 0x00015E68
for (i=0u; i<txSize; i++) {
/*SAFETYMCUSW 45 D MR:21.1 <APPROVED> "Statically defined non-null hardware register address" */
/*SAFETYMCUSW 95 S MR:11.4 <INSPECTED> "Reason - Acceptable deviation."*/
/*SAFETYMCUSW 94 S MR:11.4 <INSPECTED> "Reason - Acceptable deviation."*/
*((volatile uint8 *)(&usbd0Regs->data)) = *buff;
buff++;
}
buff is ok, but rights to read &usbd0Regs->data seem to be off.
Here is the register state when it fails
REV 0x0061 Revision register [Memory Mapped]
EPNUM 0x0003 Endpoint Selection Register [Memory Mapped]
DATA Error: unable to read Data Register [Memory Mapped]
CTRL 0x0000 Control Register [Memory Mapped]
STATFLG 0x0004 Status Flag Register [Memory Mapped]
RXFSTAT 0x0000 Receive FIFO Status Register [Memory Mapped]
SYSCON1 0x010F System Configuration Register 1 [Memory Mapped]
SYSCON2 0x0000 System Configuration Register 2 [Memory Mapped]
DEVSTAT 0x000F Device Status Register [Memory Mapped]
SOF 0x1DAF Start Of Frame Register [Memory Mapped]
IRQEN 0x00B9 Interrupt Enable Register [Memory Mapped]
DMAIRQEN 0x0000 DMA Interrupt Enable Register [Memory Mapped]
IRQSRC 0x0000 Interrupt Source Register [Memory Mapped]
EPNSTAT 0x0000 Non-ISO Endpoint Interrupt Status Register [Memory Mapped]
DMANSTAT 0x0000 Non-ISO DMA Interrupt Status Register [Memory Mapped]
RXDMACFG 0x0000 DMA Receive Channels Configuration Register [Memory Mapped]
TXDMACFG 0x0000 DMA Transmit Channels Configuration Register [Memory Mapped]
DATADMA Error: unable to read DMA FIFO Data Register [Memory Mapped]
TXDMA0 0x0000 Transmit DMA Control Register [Memory Mapped]
TXDMA1 0x0000 Transmit DMA Control Register [Memory Mapped]
TXDMA2 0x0000 Transmit DMA Control Register [Memory Mapped]
RXDMA0 0x0000 Receive DMA Control Register [Memory Mapped]
RXDMA1 0x0000 Receive DMA Control Register [Memory Mapped]
RXDMA2 0x0000 Receive DMA Control Register [Memory Mapped]
USBTEST1 0x0000 USB Test Register 1 [Memory Mapped]
USBTEST2 0x0000 USB Test Register 2 [Memory Mapped]
EP0 0x3001 Endpoint 0 Configuration Register [Memory Mapped]
Do you have an idea of what is happening and do you need more details? Thanks.
Best regards,
Joachim