Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Cy7C6013:CyAPI:how to get endpoints after loading .hex file

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Cy7C6013:CyAPI:how to get endpoints after loading .hex file
Moderator:
RSKV

Post Reply
Follow this topic



Cy7C6013:CyAPI:how to get endpoints after loading .hex file

zulunation posted on 10 Sep 2010 6:44 AM PST
Member
6 Forum Posts



Re: Cy7C6013:CyAPI:how to get endpoints after loading .hex file

zulunation posted on 10 Sep 2010 07:05 AM PST
Member
6 Forum Posts

Hi everyone.

I'm using CyUSB driver and CyAPI library with Visual Studio 2005.

I'm using the example from C:\Program Files\Cypress\Cypress Suite USB 3.4.2\CyAPI\examples\FxEEPROM to load my hex file to eeprom. It is loaded( i see new VID/PID,endpoints in USBview program).The problem is that i can't get updated endpoints info from API lib.device->EndPointCount(); get's the same as before loading the .hex file.

I decided to Close device and Open it again.The code is as follows:

------------------------------------CODE-------------------------------------------------

 device = new CCyUSBDevice();
    int endpointcount = device->EndPointCount();
    cendp = device->ControlEndPt;
    LoadHexFile(L"USB20.hex");
    endpointcount = device->EndPointCount();
    device->Close();
    
    if(device->Open(0)==false)
    {
        MessageBox(0,L"firsterror",L"error",MB_OK);
        device->Reset();
        if(device->Open(0)==false)
        MessageBox(0,L"second open error",L"error",MB_OK);
    }
    
    cendp = device->ControlEndPt;
    if(cendp ==0)
        MessageBox(0,L"invalid endpoint",L"error",MB_OK);
    endpointcount = device->EndPointCount();
    delete device;

-------------------------------------ENDCODE-------------------------------------------

The first time i run this code the errors:

"first open error"

"second open error"

"invalid endpoint"

comes.

The second time (the device is not disconnected) there is only "first open error" error.

What is wrong with this code?Is there anyway to get endpoints after loading hex without close/open commands?

Thanks in advance.

 

 



Re: Cy7C6013:CyAPI:how to get endpoints after loading .hex file

zulunation posted on 10 Sep 2010 07:16 AM PST
Member
6 Forum Posts

I also noticed that when i run the code in debug and step over after close/open i see new values of endpoints when put breakpoint on the last :endpointcount = device->EndPointCount(); sometimes i get 1 sometimes 0.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20