Problems in CyU3PUsbStart() and CyFx3BootUsbStart() in case of no re-enumeration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
    Hi,   
   
        
   
    I detected two concurrency problems in CyU3PUsbStart() and CyFx3BootUsbStart() related to jumping from one program to another without USB re-enumeration.   
   
        
   
    1) When host initiates Control request before calling CyU3PUsbStart()/CyFx3BootUsbStart(), this request hangs forever at host side. Seems like the functions clear pending SETUP packet flag without invoking respective processing handlers.   
   
        
   
    2) CyU3PUsbStart()/CyFx3BootUsbStart() enable processing of SETUP packets immediately, making it impossible to register user callbacks beforehand.   
   
        
   
    Currently API preserves Boot Loader descriptors and there is no need to register descriptors again in application. In practice, application should match boot loader descriptors and therefore it can register these descriptors again itself as well. And, while no re-enumeration is needed, typically there are also some user/application specific data that must be passed between programs, so the designers have to invent their own methods for exchanging data anyway.   
   
    In my opinion, enabling USB without re-enumeration should follow the same logic as with enumeration - actual USB enabling should be performed in CyU3PConnectState/CyFx3BootUsbConnect, after the application has performed complete initialization.   
   
        
   
    Regards,   
   
    D    
    
0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

I did not get your question clearly.

   

CyU3PUsbStart() API just initializes the USB block in the FX3. CyU3PConnectState() is the one causes the FX3 device to enumerate.

   

Regards,

   

sai krishna.

0 Likes
Anonymous
Not applicable
    Hi,   
   
        
   
    I am jumping from (secondary stage) Boot Loader to Application (and vice versa) without device re-enumeration.   
   
        
   
    Excerpt from FX3 Firmware API Guide CyU3PUsbStart description:   
   
    <<<<<   
   
    CY_U3P_ERROR_NO_REENUM_REQUIRED - FX3 Booter supports the No ReEnumeration feature that enables to have a    
single USB enumeration across the FX3 booter and the final application. This error code is returned by CyU3PUsbStart () to    
indicate that the No Re-Enumeration is successful and the sequence followed for the regular enumeration post    
CyU3PUsbStart () is to be skipped.   
   
    >>>>>   
   
        
   
    As I have understood,  in case of no ReEnumeration, CyFx3BootJumpToProgramEntry/CyU3PUsbJumpBackToBooter disable processing of (USB) interrupts temporarily and CyU3PUsbStart/CyFx3BootUsbStart enable them immediately again. I verified, USB requests (like get string descriptor, etc.) are processed by API default USB setup handler immediately after calling CyU3PUsbStart and before calling CyU3PUsbRegisterSetupCallback. So, there exists a gap where no user specific callbacks are called.   
   
        
   
    Also, the device should handle setup requests somehow while jumping from one program to another. The best will be to delay the handling a bit until FX software is operational again. Right now the request hangs forever on host side if the request gets sent between CyFx3BootJumpToProgramEntry and CyU3PUsbStart.   
   
         
   
    Regards,   
   
    D   
0 Likes