Page 1 of 1

How to force USB re-enumeration on XE216?

Posted: Wed Feb 27, 2019 6:54 pm
by cl-b
Hi,

I would like to know what it is the best way to force a USB re-enumeration without reseting the XE216 ?

I try writing XS1_SU_PER_UIFM_FUNC_CONTROL_NUM register, but I would like to keep the XMOS USB interface in reset as long as my board initialization is not completed, and then release reset so the driver can start USB enumeration

Thanks

Re: How to force USB re-enumeration on XE216?

Posted: Fri Mar 01, 2019 2:35 pm
by akp
Just a thought, if all you need to do is delay USB enumeration until the board initializes, could you put a little wait routine on the core that runs xud? or maybe one of the endpoint cores. Something like

Code: Select all

    on USB_TILE: { do{ /* nothing */ } while( !init_done ); xud(...); }
obviously you will have to figure out what "init_done" means and how to determine it...

Re: How to force USB re-enumeration on XE216?

Posted: Sat Mar 02, 2019 12:06 am
by Caleb
akp wrote:Just a thought, if all you need to do is delay USB enumeration until the board initializes, could you put a little wait routine on the core that runs xud? or maybe one of the endpoint cores. Something like

Code: Select all

    on USB_TILE: { do{ /* nothing */ } while( !init_done ); xud(...); }
I've used this approach on several products. Typically I use a global variable:
unsigned g_wait = 0; while ( !g_wait) ;
...xud(...)

Another thread (core) writes a 1 to g_wait ( with asm stw...) when everything else is ready for USB enumeration to begin.

But the title and OP are about re-enumeration...? Or perhaps this is the info that the original poster needs.

Re: How to force USB re-enumeration on XE216?

Posted: Sat Mar 02, 2019 12:44 am
by akp
No, it doesn't answer the OP's question but it seems to provide the solution to the problem the OP described.

Re: How to force USB re-enumeration on XE216?

Posted: Mon Mar 04, 2019 8:35 am
by cl-b
Thanks for your suggestions but what I would like to do is to force host to enumerate my device without reset it.

Claire

Re: How to force USB re-enumeration on XE216?

Posted: Mon Mar 04, 2019 1:38 pm
by mon2