News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TEBF0808 + TE0803 unable to initialize libusb: -99

Started by joseer, October 14, 2019, 11:31:57 AM

Previous topic - Next topic

joseer

Hello,

We've just receive our TEBF0808 + TE0803 (4ev-2gb) kit and we are trying to port our current USB3 camera video design to this platform, first we wanted to test the board and check USB3 interface and we followed the next ref. design:

https://wiki.trenz-electronic.de/display/PD/TE0803+StarterKit#TE0803StarterKit-VivadoHardwareManager (TE0803 ref design)

Steps followed:

- Create petalinux project.
- Copy the provided petalinux template folder files (StarterKit/os/petalinux) to the new project.
- Import prebuilt HDF (StarterKit/prebuilt/hardware/4ev_2gb)
- petalinux-build

But once petalinux is booted when I plug the USB3 camera nothing happens and if I run lsusb I've got:
"unable to initialize libusb: -99"

Looking in the boot log I see:
[    4.771380] dwc3-of-simple ff9d0000.usb0: dwc3_simple_set_phydata: Can't find usb3-phy
[    4.779940] xilinx-psgtr fd400000.zynqmp_phy: xpsgtr_config_usbpipe: No valid Platform_data found
[    4.790026] xilinx-psgtr fd400000.zynqmp_phy: PLL lock time out
[    4.795942] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:0 protocol:3 pll_locked:no
[    4.803675] phy phy-fd400000.zynqmp_phy.1: phy init failed --> -110
[    4.809932] dwc3 fe200000.dwc3: failed to initialize core
[    4.815341] dwc3: probe of fe200000.dwc3 failed with error -110

I didn't modify anything only I'm running the provided reference design.

Any ideas what I'm missing?

Thanks in advance.




JH

Hi,
did you use our FSBL modification to initilise GTR REF CLKs? If not, this is needed.
Can you also try out one time our reference designs prebuilt Boot.bin and image.ub from the newest reference designs please. Does USB works with our files?

br
John


joseer

Hi John,

Many thanks for your quick answer.

I tried the prebuilt  designs Boot.bin and image.ub, and USB3 detection works as expected. So the problem is the FSBL, we've got to use the modified version.

Could you please tell me the steps to replace/add this FSBL to my petalinux project? (couldn't find how to do this in the documentation)

Thanks


JH

Hi,
modified FSBL is included as template for SDK
https://wiki.trenz-electronic.de/display/PD/TE0803+StarterKit#TE0803StarterKit-Application

you can use our scripts:
https://wiki.trenz-electronic.de/display/PD/TE0803+StarterKit#TE0803StarterKit-DesignFlow
--> especially step 7 up to 9
or you create manually with SDK, two ways are possible:
https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-CreateSDKProjectfromVivado

or you copy code from our template in your sdk fsbl project.

or for petalinux build enviroment recipes for fsbl should be possible to modify default fsbl, but  I never tried out so I can't help more if you try to change it in the petalinux build environment.

br
John

joseer

Hi John,

Sorry, I'm a bit confuse since it looks to me a bare metal application rather linux... and I'm not sure how to link this to petalinux....

Just to clarify, what I got to do:

- Create SDK fbsl template project, replace template files by the provided ones ( "zynqmp_fsbl" or "zynqmp_fsbl_flash").
- Build the project and generate U-Boot.elf file?
- How should I add this after to my petalinux project?

Thanks.

JH

Hi,

there are many different ways to generate files for zynqMP. Depending what you do, final boot.bin must include

       
  • FSBL(First Boot loader after boot rom which defines your PS) --> always needed can be generate standalone with SDK or also with petalinux build environment  or completely manually
  • PMU Firmware  --> need for linux application can be generate standalone with SDK or also with petalinux build environment  or completely manually
  • Bitstream --> PL part(FPGA design) --> optional but generated with Vivado
  • ATF Firmware   --> need for linux application can be generate with petalinux build environment  or completely manually
  • Uboot (second Boot loader) --> need for linux application can be generate with petalinux build environment  or completely manually
If you has enough space, you can also include linux image and put everything on qspi flash, but easier is to load image.ub from sdimage.ub is also an container, which includes default kernel, device tree, filesystem as ramdisk...this can also split if need.
Boot.bin container can be generated with petalinux or with SDK(HSI is script interface of SDK). We use SDK(HSI) to generate Boot.bin but also other ways are possible.
So where I can help is:https://wiki.trenz-electronic.de/display/PD/TE0803+StarterKit#TE0803StarterKit-DesignFlowFollow instruction and if you has an problem, let me know. Try at first without changes, and later modify when everything works without any changes.Important for your petalinux environment, install all required packages from the xilinx installation guide (normally newest version of every package is also good, but all should be installed)

You can also try out the other ways, but I can't give you an step by step tutorial to do all manually.
brJohn




joseer

Hi John,

Thanks for the info.

So, would it work (theoretically) if I'm generating (in SDK) the zynqmp_fsbl.elf file using the provided source code and replace the petalinux default one ( below in red) to generate BOOT.bin file?:

"petalinux-package --boot --fsbl zynqmp_fsbl.elf  --u-boot u-boot.elf --fpga system.bit"

JH

Hi,
yes.

Some note:
In case you use the completely same PS configuration like on our reference design (also PS-PL clks and AXI interface), you can also use our prebuilt FSBL.
In case you change something which is relevant for PS, you must regenerate all (depending on the changes) files again. FSBL initialised PS like it's defined in the HDF export from your vivado design. Also Linux can change configuration (for example disable/enable PS-PL CLKs), so always pay attention, when you use regenerate files from other projects...

PS: for linux include also generated PMU and ATF Firmware into the Boot.bin --> this is done when you create Boot.bin with petalinux-build command. So I expected you must set it also on your petalinux-package command.

br
John

joseer

#8
Hi John,

Yes, thanks for the heads up, I'll keep that on mind.

In order to make easier to port our project and workflow, we need to generate everything more "manually".
So the working flow I'm testing right now to work with TEBF0808 + TE0803, please correct me if something obvious is wrong, is:

1 - Create our own vivado design, import only PS config from reference design. Add our hardware in the PL and/or modify PS side, build and export hw to sdk.
2 - Open sdk and create a fsbl template project for the imported hardware.
3 - Replace fsbl source files by the modified (Trenz) ones, build and generate zynqmp_fsbl.elf.
4 - Create a new Petalinux project import hw description and replace system-user.dtsi from reference template petalinux design.
5 - Add/modify petalinux config rootfs/kernel drivers...etc (depending project needs) and build.
6 - Once petalinux is built replace zynqmp_fsbl.elf by the one already generated in the step 3.
7 - package and create BOOT.bin.


JH

Hi,
basically yes.

Some Notes to

step 1 you can also use the board part files for initial PS configuration (use this one with starterkit configuration)
https://wiki.trenz-electronic.de/display/PD/Installation
https://wiki.trenz-electronic.de/display/PD/Vivado+Board+Part+Flow

step 2 and 3 --> you can do it like you has described or you load our template into the sdk repository
https://wiki.trenz-electronic.de/display/PD/SDK+Projects#SDKProjects-Variant(b):UseXilinxGUIExport
-> in this case you can select our FSBL like xilinx default fsbl

step 5 --> all changes we have described here: https://wiki.trenz-electronic.de/display/PD/TE0803+StarterKit#TE0803StarterKit-SoftwareDesign-PetaLinux
--> option use our template instead of add all changes manually.

br
John

joseer

Hi John,

Thanks for the suggestions, we followed all steps (also adding what you suggested) and petalinux seems to boot fine now.

But we've got an issue regarding usb3 detection, if the device is plugged when petalinux is booting, it is no recognised, but if I unplug and plug it back again, it is detected. On our previous zynqmp dev board this was working fine (device detected when it is plugged and petalinux is booting), I'm comparing both setups and I'm not seeing any obvious difference....

Do you have any ideas why this could be happening with this boards/setup?

Thanks


JH

Hi,
this also happens with our prebuilt files?

Can you send me the serial number of your TEBF0808 please (white sticker with QR code and number on the TEBF0808).

Did your TEBF0808 use the newest firmware.
You can identify newest version with second xmod. https://wiki.trenz-electronic.de/display/PD/TEBF0808+Getting+Started#TEBF0808GettingStarted-CPLDFirmware

Update instructions, if needed:
https://wiki.trenz-electronic.de/display/PD/TEBF0808+CPLD+Firmware

br
John

joseer

#12
Hi,

Yes, this happens also with the prebuilt files.

The number is: 573990

The  firmware version is:  TEBF0808-x_CPLD-REV07A|MP:1-7|St:PIN1- 5;PEE1- 3;PES0- 0;PSR0- 4;PHR0- 4;POR0- 4;USB0- 8;PCI0- 6;
Is this the latest, right?

I'm seeing that the CPLD is on charge of the USB reset, so could it be related to this?


JH

Hi,

USB HUB and USB2 PHY resets pins are connected to the CPLD.
As long as the system is not powered on, all is hold into reset. After power one and power up, CPLD release resets and give control to MIO of the ZynqMP.
See CPLD description(source code is also available on the download area).
In case you use our FSBL Firmware, than FSBL  will generated reset signal to the MIO for USB (that's not done by Xilinx default FSBL at the moment, so I add this future). Which MIO is USB reset, is defined in Vivado ZynqMP IP (that's new since some Vivado versions, on older versions, it was an GPIO only, so ZynqMP could not reset USB by default). If Linux does reset depends on driver implementation from Xilinx. I never checked.
What you see on the second uart is the Firmware version and are small statistic (realised in vhdl(fast but not a good way), instead to use a small processing system for easier uart and better). That's simple counter which increase on the changing edge of the reset signals(maybe it also detect some glitches, because it's asynchrony and I didn't include some mechanism to prevent it).
Counter will be erased when you completely power off the system (12V or ATX power supply, depends what you has used).

I've test it on my system and it works (USB3 Stick directly connected before I boot). Which USB did you use? this one on the TEBF0808 or on the enclosure (in case you has one)?
Can you send me the whole boot console log?
-->Connect UART, and press Power on button.
-->On linux console (after login) type: lsusb
Save console log and send me the content please.
Which USB3 device did you use?

br
John




joseer

#14
Hi,

I'm plugging a USB3 camera, and it is working fine in this sense (being detected during booting) on other party zynqmp dev board...

With a USB3 memory stick plugged in I have not this problem only with the camera.

Please find attached the boot log (while camera was plugged in).

Thanks

JH

Hi,
we did not optimise linux to support everything.
So it can also happens some problem with drivers for your camera.

You say other zynqMP eval board. Which one?
Which kind of linux settings are activated there? Which vivado petalinux is used there?
We use only one lane for USB3 and also an USB3 hub. How is USB3 connected on your other eval board?

If only your camera does not work in first boot up, it's hard to say what's the reason.

I will check one time your boot log, if I can see something.
PS: your boot log is not complete part of the FSBL and uboot is missing. I need complete log

br
John

joseer

#16
Hi,

We used a Ultrazed-ev kit which is also using a single USB3 GT lane but without hub (as far as I remember). Petalinux and vivado versions are the same (2018.3). And I did check the USB/USB3 kernel drivers/options and looks like are setup in the same way....I'll double check it again for some case I missed something...

So just to clarify, the camera works, the problem is that if it is plugged when petalinux boots is not detected till I unplug and plug it back again which I don't understand...could it be caused by the USB3 hub that it is not initialised at time?

Our final target is to build a small carrier board based on TE0803 and 4xUSB3 support (without CPLD).

Also I forgot to mention that we are using the two USB3 ports on the carrier board, (we've got not enclosure).

Please find attached the complete boot log.

Best regards

JH

Hi,
I think FSBL, uboot and linux is generated by yourself and not our prebuilt version?
timestamps are from
-->  Oct 15 2019  -  11:42:28 FSBL
--> Oct 15 2019 - 10:29:13 +0000) UBoot
--> Oct 15 09:02:01 Linux kernel

but no matter, your boot log looks OK.

USB HUB has an suspend led
Position 14 (Designator D17) on the picture:
https://wiki.trenz-electronic.de/display/PD/TEBF0808+Getting+Started#TEBF0808GettingStarted-Figure_Overview
What's the LED status with your camera?
LED goes off, when Linux recognised device(with usb stick, led goes off, nearly on the end of the boot process). Maybe the camera has some problems with the suspend mode of the usb hub during boot process? So it still sleeping....

we has disabled suspend on device tree for the xilinx core:
https://wiki.trenz-electronic.de/display/PD/TE0808+StarterKit#TE0808StarterKit-DeviceTree
https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/usb/dwc3.txt

But this influence only the communication between ZynqMP and usb-hub. And is not a USB Hub configuration.
Do you know if on your Ultrazed-ev kit linux used also "dis_u3_susphy_quirk"?

PS: I checked shortly Xilinx Wiki, it seems Xilinx has add new features on 19.1 linux drivers
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841729/Zynq+Ultrascale+MPSOC+Linux+USB+device+driver
Maybe you should also try out to use 19.1?

br
John








joseer

Hi John, thanks again for the help and support.

You are right, I think the issue is the "snps,dis_u3_susphy_quirk" option.

The ultrazed board system it's not disabling the suspend mode, the device tree is:

&dwc3_0 {
    status = "okay";
    dr_mode = "host";
    phy-names = "usb3-phy";
    snps,usb3_lpm_capable;
    phys = <&lane2 4 0 2 52000000>;
};

Test I've done:

- Modify the TEBF0808  DT:

&dwc3_0 {
   status = "okay";
    dr_mode = "host";
    phy-names = "usb3-phy";
    snps,usb3_lpm_capable;
    phys = <&lane1 4 0 2 100000000>;
};

- Re-build petalinux and re-generate BOOT.bin.

And now it is detecting the camera fine (I test it only a few times), also the camera works as expected so far....

Keeping the above DT modification, would it be a problem or affect to the USB3 board/hub config.?





JH

Hi,

It's hard to say if it makes trouble or not. It doesn't exist any guideline how to configure it correctly. And you did also not know which parameters from device tree are really used from linux drivers. Sometimes you find workarounds  and patches from Xilinx to get periphery running until they fix the problem with some newer vivado/petalinux version. That doesn't mean Xilinx is to blame or anybody else, the problem is that such a Soc is to configurable to find directly a working driver solution for all variants. Every changes on PS-IP is more or less a new system.

So when it works on your place, leave it as it is now.

I think will remove this parameter on the next reference design update.

br
John

joseer

#20
Hi,

Yes, I'm agree, when we are on in the USB interface world + linux drivers, it could get a bit tricky....

I've done another test which it really doesn't make sense to me:

- I switched everything off (dev board, camera unplugged...etc) for a while, reconnect everything,  boot linux and the camera was not detected again and LED (D17) on.

- Switch dev board power off (keeping camera plugged), boot linux back, and camera is detected and LED (D17) off.

As long I'm keeping the camera physically plugged, (even having rest of cables disconnected) , when linux boots, it detects it. If I'm unplugging the camera, the first time OS boots it is not detected till it boots again.

The only obvious difference I can see so far between the two boards is that the  ultrazed one is not using a hub, but not sure how this would affect...could you please tell me what is the eeprom (U5) used for?

Thanks.




joseer

Hi,

After a bit more of tests and digging around the board setup/firmware, I realised that there was an inconsistency boot depending on how the board was started. So I traced down to a fsbl issue related.

I put back all default config in the DT (disabling suspending mode), build vivado HW export and open SDK, create a new app based on TE fsbl template and re-generate BOOT.bin, so basically, rebuild everything from scratch.

Everything seems to work fine so far. So it looks like I had an issue on the PS setup when fsbl was generated and the start up sequence was messed up.

Thanks for the support.


JH

Hi,
sorry for late reply, I had some meetings yesterday.
Good to hear that you solved the problem.

Maybe one last hint:
Sometimes it can happens, that petalinux build environment doesn't recognized some changes. If you are not sure after you has changes something, it's sometimes helpful to clear the project (petalinux-build -x mrproper), before you generate the binary files again (but this takes more time).
It does not clear all generate files. On our templates I removed much more, which will be regenerated on HDF import. I add some notes here: https://wiki.trenz-electronic.de/display/PD/PetaLinux+TE-Template

br
John

joseer

Hi John,

No problem at all. I'll keep that in mind thanks for the hint.

Best regards.