How to force USB re-enumeration on XE216?

Technical discussions around xCORE processors (e.g. General Purpose (L/G), xCORE-USB, xCORE-Analog, xCORE-XA).
cl-b
Active Member
Posts: 41
Joined: Fri Sep 15, 2017 2:58 pm

How to force USB re-enumeration on XE216?

Postby cl-b » Wed Feb 27, 2019 6:54 pm

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
User avatar
akp
Respected Member
Posts: 302
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Mar 01, 2019 2:35 pm

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...
User avatar
Caleb
Experienced Member
Posts: 66
Joined: Thu Apr 04, 2013 10:14 pm

Postby Caleb » Sat Mar 02, 2019 12:06 am

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.
User avatar
akp
Respected Member
Posts: 302
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Sat Mar 02, 2019 12:44 am

No, it doesn't answer the OP's question but it seems to provide the solution to the problem the OP described.
cl-b
Active Member
Posts: 41
Joined: Fri Sep 15, 2017 2:58 pm

Postby cl-b » Mon Mar 04, 2019 8:35 am

Thanks for your suggestions but what I would like to do is to force host to enumerate my device without reset it.

Claire
User avatar
mon2
XCore Legend
Posts: 1470
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Mon Mar 04, 2019 1:38 pm


Who is online

Users browsing this forum: No registered users and 0 guests