fx2lp , RENUM not switching/changing descriptors

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

cross mob
vpac
Level 3
Level 3
10 sign-ins 5 replies posted 5 questions asked

Hello,

i have a fx2lp/CY7C68013A having custom PID in eeprom for C0 softload of firmware.

On Linux:

when plug into USB, a DVB driver detects the VID/PID and downloads a firmware, then resets the fx2 cpu.

the fx2 software then does not do a DISCON cycle, instead just sets RENUM to 1 to make new descriptors available.

However, i still see the standard default descriptors doing:

lsusb -v -d VID:PID  to display the descriptors.

I should mention that the VID/PID before and after softload are the same/do not change.

The DVB software cant access the new EP2IN bulk endpoint to fetch the mpeg stream.

(the default descr has no bulk EP2IN!)

so strange, any clues?

 

0 Likes
1 Solution
vpac
Level 3
Level 3
10 sign-ins 5 replies posted 5 questions asked

yes, the origial firmware does a DISCON cycle, but only one time.

i found the bug.

- when fx2 is connected to USB it fetches the C0 VID/PID from eeprom, no software yet.

- host download firmware to fx2

- fx2 firmware must do a DISCON cycle but on condition of the RENUM bit(else yu do endless DISCONs)

- fx2 renumerates as new device with custom descriptors.

stupid linux dvb driver does download the firmware a second time, but that does not harm.

example code:

// conditional DISCON cycle
if (!(USBCS&0x02)) // if RENUM is 0 thats after initial c0 load from eeprom, firmware was downloaded first time.
{
USBCS |= 0x0A; //disconnect (DISCON=1, RENUM=1)
delay(1500); //IMPORTANT, if no delay, device will not come up!
}
else
LED2=0; // debug led on if: RENUM was 1. host still downloads the firmware again, but that does not harm. RENUM stays 1 over DISCON cycle.

USBIRQ = 0xff; // Clear any pending USB interrupt requests.
EPIRQ = 0xff; // clear Endpoint ints
EXIF &= ~0x10; // clear USBINT

// CT1 |= 0x02; // become FullSpeed Device. comment this out if you want to be a High-Speed Device.
USBCS &= ~(0x08); // clear (DISCON=0).
USBCS |=0x02; // set RENUM to use custom descriptors

 

View solution in original post

0 Likes
2 Replies
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi,

 

It looks like FX2LP failed to load the image which your DVB driver downloads. Have you ever seen the correct firmware is enumerated? Can you try to use our offical tool to  download image? Can the same firmware be successfully downloaded in Windows?

0 Likes
vpac
Level 3
Level 3
10 sign-ins 5 replies posted 5 questions asked

yes, the origial firmware does a DISCON cycle, but only one time.

i found the bug.

- when fx2 is connected to USB it fetches the C0 VID/PID from eeprom, no software yet.

- host download firmware to fx2

- fx2 firmware must do a DISCON cycle but on condition of the RENUM bit(else yu do endless DISCONs)

- fx2 renumerates as new device with custom descriptors.

stupid linux dvb driver does download the firmware a second time, but that does not harm.

example code:

// conditional DISCON cycle
if (!(USBCS&0x02)) // if RENUM is 0 thats after initial c0 load from eeprom, firmware was downloaded first time.
{
USBCS |= 0x0A; //disconnect (DISCON=1, RENUM=1)
delay(1500); //IMPORTANT, if no delay, device will not come up!
}
else
LED2=0; // debug led on if: RENUM was 1. host still downloads the firmware again, but that does not harm. RENUM stays 1 over DISCON cycle.

USBIRQ = 0xff; // Clear any pending USB interrupt requests.
EPIRQ = 0xff; // clear Endpoint ints
EXIF &= ~0x10; // clear USBINT

// CT1 |= 0x02; // become FullSpeed Device. comment this out if you want to be a High-Speed Device.
USBCS &= ~(0x08); // clear (DISCON=0).
USBCS |=0x02; // set RENUM to use custom descriptors

 

0 Likes