AnsweredAssumed Answered

LPC54608:  artf44835 ROM USB stack workaround

Question asked by bob belmont on Oct 9, 2018
Latest reply on Oct 10, 2018 by jeremyzhou

I am using SDK 2.4.1.


rom_dev_hid_generic_bm\hid_main.c\#147 reads:


/*    WORKAROUND for artf44835 ROM driver BUG:

        Code clearing STALL bits in endpoint reset routine corrupts memory area

        next to the endpoint control data. For example When EP0, EP1_IN, EP1_OUT,

        EP2_IN are used we need to specify 3 here. But as a workaround for this

        issue specify 4. So that extra EPs control structure acts as padding buffer

        to avoid data corruption. Corruption of padding memory doesn’t affect the

        stack/program behaviour.


    usb_param.max_num_ep = 2 + 1;

    usb_param.mem_base = (uint32_t)&g_memUsbStack;

    usb_param.mem_size = USB_STACK_MEM_SIZE;


I have 3 questions:


I read “For example When EP0, EP1_IN, EP1_OUT, EP2_IN are used we need to specify 3 here” as the value 3 referring to the number of Logical endpoints and NOT physical endpoints. Is this correct?


assuming that the workaround refers to logical endpoints this explains that “2 + 1” because of EP0 and EP1_IN (HID).



why is this workaround missing from other ROM USB Stack based examples ?

For example, rom_dev_audio_bm\sources\audio_main.c\#99 reads:


usb_param.max_num_ep = 2;


2.a) this does not mention WORKAROUND for artf44835?

2.b) The example is using EP0,EP1_IN,EP1_OUT;so shouldn't this be 2+1 as well to address artf44835?


With the discrepancy mentioned above in [2.a], is artf44835 still relevant to LPC546xx or should it be dismissed?

Thank you