Bootloader on the device is not running. I our custom board while uploading Lattice USBVideo Bridge Code.

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

cross mob
PraveenAmara
Level 2
Level 2
10 sign-ins 10 questions asked 5 sign-ins

Dear Team

We are made a custom board with FX3 and Lattice FPGA, Similar to the Lattice USB3 video bridge development kit.

I am using USB to SPI boot mode.

image (9).png

I am getting this error. Also sometimes it showing an SPI Erase failed.

Same thing I am tried to program through the control center. There I am not getting any error.  But Actually, I am not sure SPI is programmed or not.

Here I am using USB boot mode.

image (10).png

Regards

Praveen

0 Likes
1 Solution

Praveen,

I recently finished a design for a client using a Lattice ECP5 and the Cypress FX3.

I ran into a similar problem where I was not able to program the FX3 into flash only into SRAM.

Diagnosing the issue:

I found that the Lattice ECP5 on the SPI lines was holding up the bus.

This would not allow the Cypress FX3 device to program the SPI flash , since there was bus contention.

How I fixed the issue and to get past this point was to program the ECP5 with a blank image that did not touch the SPI lines.

This allowed me to program the FX3 device.

Hope that helps,

Mike

View solution in original post

0 Likes
20 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Praveen,

From the description, I understand that FX3 + ECP5 is being used for the design.

FX3 will boot from SPI flash but before that SPI flash is programmed over USB using Control Center. Is my understanding correct?

Same thing I am tried to program through the control center. There I am not getting any error.  But Actually, I am not sure SPI is programmed or not.

>> From the snippet it seems that the SPI flash is programmed successfully. You can read the SPI flash contents and check if the contents match the .img file programmed to the SPI Flash. You can use UsbSpiRegMode / UsbSpiDmaMode (Path:  FX3 SDK Installation path\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples) examples of the firmware and send the vendor commands to read the contents of SPI Flash using Control Center. Please refer the readme.txt file with the firmware for the details of the vendor commands.

Please let me know which application is being used in the first snippet and for what purpose it is used.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi

In the first snippet is an Application provided by lattice, It is similar to the 3.0USB video bridge board.

https://www.latticesemi.com/en/Products/DevelopmentBoardsAndKits/LatticeUSB3VideoBridgeDevelopmentKi...

They have provided an application that will program the Fx3 directly into the flash. with this application, we can flash the bit file also to ECP3.

This is an application UI.

image (11).png

You can use UsbSpiRegMode / UsbSpiDmaMode (Path:  FX3 SDK Installation path\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples) examples of the firmware and send the vendor commands to read the contents of SPI Flash using Control Center. Please refer to the readme.txt file with the firmware for the details of the vendor commands.

I tried this I can able to read back to the device. I kept it in USB boot mode.

image (12).png

After that, Once I change to USB -> SPI boot mode the device is not detecting properly.

Even it detects. It is showing like this. Also, It is getting FALL BACK TO USB BOOT MODE.

image (13).png

0 Likes

Hi Rashi

While checking PMODE_1 Pin voltage level it is about 1.1V. It should be a High Impedance state. 

Why I am getting voltage at the PMode pin?

0 Likes

Hi

I am not able to program the FX3 from Flash.

I checked the Fx3 clock and Data pins I can able to see the waveform, But still, FX3 is not programming from Flash.

But I can able to program an image file in Ram.

0 Likes

Hello Praveen,

I tried this I can able to read back to the device. I kept it in USB boot mode.

>> Please confirm if the data written and data read to/from the SPI Flash were the same.

After that, Once I change to USB -> SPI boot mode the device is not detecting properly.

>>It seems the boot fails and the bootloader fallbacks to the USB boot. Please confirm if the SPI flash part meets the spec mentioned in the KBA Selection of SPI Flash Compatible with FX3/CX3/FX3S/FX2G2/SD3/SD2 and the Recommended Cypress SPI Fl...

and is the image format the same as mentioned in section 7.4  of  AN76405 https://www.cypress.com/documentation/application-notes/an76405-ez-usb-fx3-fx3s-boot-options

- Also confirm if the same image file  (which is being programmed in SPI Flash) is programmed through USB boot, does the device enumerate?

Why I am getting voltage at the PMode pin?

>> Please share the snippet of the schematics to check  the connection of  PMODE lines and the connection of SPI (FX3)  to  SPI Flash

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi

Please confirm if the data written and the data read to/from the SPI Flash were the same.

>>No, I am reading different data from Flash. I think it is previous data.

It seems the boot fails and the bootloader fallbacks to the USB boot. Please confirm if the SPI flash part meets the spec mentioned in the KBA Selection of SPI Flash Compatible with FX3/CX3/FX3S/FX2G2/SD3/SD2 and the Recommended Cypress SPI Fl...

>> we have followed a lattice eval kit, There it is working fine. So flash not might be an issue.

Also, confirm if the same image file  (which is being programmed in SPI Flash) is programmed through USB boot, does the device enumerate?

>> Yes, I used the same image file.

When I am changing to the USB boot I can able to see the signals  CLK, MISO, MOSI lines while probing.

0 Likes

Hello Praveen,

No, I am reading different data from Flash. I think it is previous data.

>> From this it seems that the data is not erased before writing to the flash. Please confirm that you followed the steps mentioned readme.txt file. If yes, then there is some problem with the SPI interface

Yes, I used the same image file.

>> Can you share the .img file so that we can check the .img file and confirm if the problem is reproducible.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi

From this, it seems that the data is not erased before writing to the flash. Please confirm that you followed the steps mentioned readme.txt file. If yes, then there is some problem with the SPI interface

>> Yes, I will check once again

>>Now I am getting the same Data while reading and writing.

image (15).png

Can you share the .img file so that we can check the .img file and confirm if the problem is reproducible?

>> The image file was the same, The same image file I used in the lattice eval kit worked fine.

>> In SPI mode I cannot able to detect the FX3 in the device Manager. The FX3 is not enumerating.

But I can see the MISO, CLK, and MOSI pulse in the oscilloscope.   

>>Please find the PMODE pins.

fx3.png

0 Likes

Hello Praveen,

Please test this and let me know the results

Configure the PMODE for USB boot

- Program the USBFlashProg example firmware to the FX3

- Using vendor commands try programming a the firmware .img  file  to FLASH through the control center.

- Please follow the steps of writing to the FLASH as mentioned in the readme.txt file of the USBFlashProg example

- Try reading the image file back from the control center

- Compare the data written and read to Flash

From this, we can confirm if the SPI interface is not causing the problem. If the above test works fine then the PMODE lines can be the reason for the failure.

But I can see the MISO, CLK, and MOSI pulse in the oscilloscope.  

>> Can you please share the SPI traces

From the schematics, part number M50-3530342 is a connector header. Am I right?.

Please let me know if the PMODE[1] is kept unconnected, PMODE[2] is pulled down to the ground, and voltage on PMODE[0] is measured 3.3V

Regards,

Rashi

Regards,
Rashi
0 Likes

Hello Praveen,

Please let me know the SPI FLASH size and which FX3 part number is used in your custom board

Ensure that the VIO4 voltage is compatible with SPI flash

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi

The SPI flash part number is M25PX16-VMP6TG.

I tried programming with example code USBVideoClassBulk, It is working in SPI mode. FX3 gets enumerated and streaming is happening.

I tried with other example code also. That is also working fine.

But when I am using the Lattice USBVideoBridge file it is not enumerating in our custom board.

When I use the same code(USBvideoBridge) in the FX3 development kit it's getting enumerated.

I have attached both the image file for your reference.

How should I proceed with the debugging?

0 Likes

Hello Praveen,

I have tested both the files that you shared.

The device is not enumerating with USBVideoBridge_bulk for both USB and SPI boot on my end. This can be due to the hardware dependencies also.

When I use the same code(USBvideoBridge) in the FX3 development kit it's getting enumerated.

>> Is the device enumerating with USBVideoBridge_bulk (USB Boot) on your custom hardware/board?

Please let me know if this is the same image file that was shared in the previous response. The firmware image file shared earlier was 181KB which was more than the code area of FX3's 512 KB RAM

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi RashiV

Please let me know if this is the same image file that was shared in the previous response.

>>Kindly ignore the previous image file. please consider only the attached one which is 138kb.

Is the device enumerating with USBVideoBridge_bulk (USB Boot) on your custom hardware/board?

>> we tried programming in RAM, The Code is gets enumerated.

>> Now, Only in RAM it's get enumerated, The Same code is not enumerated in flash.

This can be due to the hardware dependencies also.

>> what kind of hardware dependency, I need to check. Kindly please let me know.

>> Also, I have attached the memory allocation file.

we are ready to share the schematic, will you please put a mail to this ID. praveenrajn@htic.iitm.ac.in

0 Likes

Hello Praveen,

From the description you shared, I understand that booting from SPI flash is not successful.

Please let me know if programming the image(USBVideoBridge_bulk) to SPI Flash from the control center was successful on your custom board i.e. was writing to SPI FLASH was successful.

We can do one test to check if the problem is with PMODE line status or the SPI interface

- Program the SPI Flash with USBVideoBridge_bulk using control center (PMODE - USB Boot)

- After the programming is successful

- Program the FX3 RAM using Control center with the attached second stage bootloader code (PMODE - USB Boot)

- The second stage boot loader will program the FX3's RAM with the firmware in the SPI FLASH (PMODE - USB Boot)

If the booting fails the device will enumerate as BulkLoop Example. If the boot is a success, the device will enumerate with USBVideoBridge_bulk firmware. Please let me know the result of this test

failed_SSBL.PNG

Regards,

Rashi

Regards,
Rashi
0 Likes

Dear Rashi

As you said this was happening due to a hardware problem.

We have used a 10ohm series resistor in SPI lines. Between FX3 and FPGA.

These are the 10Ohm resistor removed, And replaced with Zero Ohm, (Snipping attached)

But still, we are confused about how this may create a problem in programming an FX3.  

pastedImage_0.png

0 Likes

Hello Praveen,

Please share the schematics of the custom board to help you better

Regards,

Rashi

Regards,
Rashi
0 Likes

Praveen,

I recently finished a design for a client using a Lattice ECP5 and the Cypress FX3.

I ran into a similar problem where I was not able to program the FX3 into flash only into SRAM.

Diagnosing the issue:

I found that the Lattice ECP5 on the SPI lines was holding up the bus.

This would not allow the Cypress FX3 device to program the SPI flash , since there was bus contention.

How I fixed the issue and to get past this point was to program the ECP5 with a blank image that did not touch the SPI lines.

This allowed me to program the FX3 device.

Hope that helps,

Mike

0 Likes

Hello Praveen,

From the schematics, the GPIOs used for connecting to FPGA are different then the SPI lines connected to SPI Flash.

It is strange that removing resistor on those GPIOs resolved the SPI Flash problem.

SPI lines are under VIO4 domain of FX3. I see that the SPI Flash is connected to 2.5 V domain whereas the VIO4 is connected to 3.3V (VIO_POW_FX3). Please confirm if VIO4 is also connected to 2.5 V power rail.

As per Mike's response (response 17) please check the status of the SPI lines before programming

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi

The board is now working fine,

Thanks for your great support.

0 Likes

Hi Mike

Yes, Because of the undesirable state in SPI lines I could not able to program the FX3.

Now, Everything works fine.

Thanks a lot, Mike

0 Likes