This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952 abort while USBEndpointDataPut

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

  • Would you please provide information about the abort? Prefetch abort or data abort?  There is information about aborts in the ARM Cortex R4 Technical Reference Manual, section 3.7.4. Follow the links in this section to section 8.3 to see how to determine what address caused the abort.

  • I am not sure I can find all the information you require.
    Here is what I have

    SPSR_ABT 0x2000011F Stores the status of interrupt enables and critical processor status signals in abort mode [Core]
    R13_ABT 0x08001D00 General Purpose Register 13 in Abort mode [Core]
    R14_ABT 0x00016128 General Purpose Register 14 in Abort mode [Core]

    The memory address stored in R14_ABT corresponds to the last line of

    USBEndpointDataPut
    E24DD020 E58D300C
    E58D2008 E1CD10B4 E58D0000 E59DC00C E58DC014
    E59DC008 E58DC01C E1DDC0B4 E1A0C22C E1CDC0B4
    E59FC588 E59CC000 E1DCC0B2 E20CC00F E1CDC1B0
    E59DC014 E35C0040 9A000001 E3A0C040 E58DC014
    $C$L9
    E59F0560 E1DDC0B4
    E5900000 E20CC00F E38CC030 E1C0C0B2 E3A0C000
    E58DC018 E59DC014 E59D0018 E15C0000 9A00000E
    $C$L10
    E59F0530
    E59DC01C

    I don't know which kind of abort it is. Can you determine it with the A bit of SPSR_ABT (==1)?

    This is probably not useful:
    Fault_Addr 0x00000000 Fault Address Register [Memory Mapped]
    Fault_Stat 0x00000000 Fault Status Register [Memory Mapped]
    ImpFaSts 0x00000000 Imprecise Fault Status Register [Memory Mapped]
    ImpFtAdd 0x00000000 Imprecise Fault Write Address Register [Memory Mapped]

    I didn't find any of those register: DFSR, IFSR, DFAR, IFAR

    Did it help? Thanks