How to force USB re-enumeration on XE216?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
Post Reply
cl-b
Active Member
Posts: 44
Joined: Fri Sep 15, 2017 2:58 pm

How to force USB re-enumeration on XE216?

Post 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


User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

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

Post 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.
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

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: 44
Joined: Fri Sep 15, 2017 2:58 pm

Post 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
Post Reply