whitequark / libfx2

Chip support package for Cypress EZ-USB FX2 series microcontrollers
BSD Zero Clause License
73 stars 26 forks source link

Example "boot-cypress" doesn't start after FW upload to FX2 #9

Closed Ho-Ro closed 1 year ago

Ho-Ro commented 1 year ago

The hex file is uploaded and the 8051 comes out of reset, but the FX2 doesn't re-enumerate.

Fix: change usb_init(/*disconnect=*/false); to usb_init(/*disconnect=*/true); in this line: https://github.com/whitequark/libfx2/blob/60fc41da3ded4aa66ab63312804fb68c3cc3014a/firmware/boot-cypress/main.c#L199

whitequark commented 1 year ago

That's actually not an example, it's a firmware that's used internally by fx2tool. With your fix, fx2tool -B will stop working.

Ho-Ro commented 1 year ago

Ok, understood - close. A comment could be helpful - I started from this point without success while the other parts started up as (I) expected, e.g. boot-uf2: https://github.com/whitequark/libfx2/blob/60fc41da3ded4aa66ab63312804fb68c3cc3014a/firmware/boot-uf2/main.c#L201-L202

whitequark commented 1 year ago

Clarified in https://github.com/whitequark/libfx2/commit/d98e54a823ee7841bff1c7b5a915c2e0b33342f6.