cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sumenthus
Visitor
Visitor
14,331 Views
Registered: ‎03-04-2012

XAPP1052 Win7 64-bit BSOD and Ubuntu 11.10 32-bit Error

Jump to solution
Win7 64-bit: I compiled the XAPP1052 win32 driver in a fre x64 win7 environment using the WinDDK and added the NTamd64 information to the .INF file to install the driver. Held the computer at the bootloader, JTAG programmed the SP605, soft reset, disabled driver signature enforcement, found the device and used the associated driver. Installed the associated demo app, execute it...blue screen: pcie_demo.sys

Ubuntu 11.10 32-bit: Installed dev packages, set up a bunch of symlinks so all the headers could be found. Executed run_xbmd.csh, completed sucessfully, kernel module loaded, /dev/xbmd created. Ran xbmd_app get the error: Negotiated link speed invalid: LW = 0

I realize neither Win7 nor Ubuntu are the reference environments from the example, but my UMPC is the only device with WinXP and PCIe expansion isn't an option. I chose Ubuntu because the latest Fedora has some show stopping GUI bugs and windows is ultimately the target.


Since 2 independent implementations are each having problems, and the PCIe slot indeed works with other cards, I suspect the FPGA programming (which was the easiest of it all with the copy command posted elsewhere on the forum) is the issue. Further, if it were a critical problem then the card would never be detected or the computer wouldn't boot. This likely means it's something subtle and/or intimately entangled in the details of PCIe. This is my first experience with PCIe design and I was hoping the dissect a working example to learn more.

I need to get this working before Thursday if possible. At that, I have to choose between losing another weekend of productivity or overnight shipping on a TI DSP kit. I would like to use Xilinx since I want integrate PCIe DSP and peripheral management in parallel. I just need a trustworthy starting point, then I can reverse engineer it. I will accept any help I can get.

BTW: Already scoured Google, Bing, Xilinx, comp.arch.fpga, semantic and related searches, etc. for 3 days. Going to need something new here.

I haven't customized any source code (aside from unlocked_ioctl and pci_get_device updates in xbmd_app), but I'll glady post it if needed. Would prefer a clean solution with source code without any contamination from me.

EDITED: previously no break lines
0 Kudos
1 Solution

Accepted Solutions
sumenthus
Visitor
Visitor
20,057 Views
Registered: ‎03-04-2012

Fixed it on Ubuntu.  The issue was a matter of updating the drivers.

change:  ioctl:      XPCIe_Ioctl
and:  int XPCIe_Ioctl(struct inode *inode, <BR>
                struct file *filp, <BR>
                unsigned int cmd,<BR>
                unsigned long arg)<BR>

to:  unlocked_ioctl:      XPCIe_Ioctl
and:  int XPCIe_Ioctl(struct file *filp, <BR>
                unsigned int cmd,<BR>
                unsigned long arg)<BR>

ioctl and the next solution (manual kernel locking) are both deprecated from what I read.  The old 4 vs new 3 argument calls were misaligning the arguments.  While I would like to move to Win7 in the future, I will not be putting this effort into those drivers.  Hopefully by the time I'm ready to code the PC application, Xilinx will have updated their examples.  *cough DSP cough*  Let me know if anyone is unable to reproduce this fix, I'll clean up my code and post a diff patch.

View solution in original post

10 Replies
sumenthus
Visitor
Visitor
14,326 Views
Registered: ‎03-04-2012
Also tried without the copy command, just vanilla process, nothing changed.
0 Kudos
jpiat
Visitor
Visitor
14,312 Views
Registered: ‎02-16-2012

Hi,

 

i ran into the exact same probelm. I recompiled the source code of the xap1052 driver using WDDK and visual studio. Installing the driver on windows 7 did not fail but running it (by allowing unsigned driver on startup) caused a BSOD. I have no clue of what can go wrong, and reading the driver code a is painful. 

It would be nice from Xilinx to start supporting today's architecture in their example because winXP and 32 bit are quite outdated in the PC world ...

I'll keep digging, but i'am afraid the solution is far from my expertise ...

0 Kudos
dougst41
Contributor
Contributor
14,306 Views
Registered: ‎04-04-2011

Hi there,

 

Make sure that you aren't running driver verifier, which seems very unlikely since you have just installed the driver, but you never know.

 

Driver Verifier under Windows 7 x64 picks up a load of errors that verifier under Windows XP x86 didn't, one of which BSODs the PC before you get into Windows... I know it seems stupid, but it's a place to start.

 

From memory, the standard xapp1052 DRIVER (can't speak for the Application) ran in Windows 7 x64 but had a few problems that shouldnt cause a BSOD. I can't be 100% about this though as I had made significant changes to the xapp 1052 Windows XP x86 Driver before I ported it to Windows 7 x64.

 

The BSOD you're getting could very well be caused by the xapp1052 Application, where there are several bugs that will cause a BSOD, but depending on your configuration may or may not occur. I cant really say what is most likely to be causing the Application to BSOD now as I had re-written 50% of the DriverMgr before it was ported to Windows 7 x64.

 

If you can fire up WinDBG or similar and tell me which function within the Driver is active when the PC crashes, I might be able to point you in the right direction. In saying that: If you could do a debug build of the DriverMgr DLL, attach a debugger to it, and let us know which function is causing the crashes, I may be able to shed some light. Do both and you're laughing!

 

If you want to have a crack at getting the driver working yourself, I would fire up WinDBG and start looking at where you're getting crashes then move on Static Driver Verifier and Driver Verifier.

 

Fixing the DriverMgr code shouldn't be too difficult, but I wouldn't suggest doing it without a proper debugger attached. Text won't cut it - trust me :)

 

Further driver fixing: Static verifier will complain about a few things in the xapp1052 driver, but I wouldn't expect any of them to be causing your BSOD. Also, Driver Verifier (Run->verifier) is an excellent way of catching bugs on the fly and is your friend (if you can get past the BSOD before windows loads...)!

 

And before anyone asks: sadly I'm unable to post source code, but I'm happy to give pointers if I can...

 

Good luck and let us know how you get on.

sumenthus
Visitor
Visitor
14,295 Views
Registered: ‎03-04-2012

Rather than compound driver debug with 32 to 64 bit migration on top of the relatively fewer diagnostic tools on Windows, I'm focusing on getting the Linux version working. I've also installed the card in an expresscard to pcie expansion slot on my laptop that allows me to power and program the card, then cold boot the system to ensure a clean start.

lspci -vv yields the following:

05:00.0 Memory controller: Xilinx Corporation Zomojo Z1
Subsystem: Xilinx Corporation Zomojo Z1
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 19
Region 0: Memory at f1c00000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
Capabilities: [58] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 unlimited, L1 unlimited
ClockPM- Surprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Capabilities: [100 v1] Device Serial Number 00-00-00-01-01-00-0a-35


"LnkCap: Port #0, Speed 2.5GT/s, Width x1"
and
"LnkSta: Speed 2.5GT/s, Width x1"
seem to state the device indeed has a link. I'm currently reading through the kernel module source code and "lspci -xxx" PCI configuration space to manually verify that the link width information is there in the right place. I suspect that the originally linux kernel 2.6 module code may simply be pointing to the wrong registers. I'm trying my best to salvage this purchase.

0 Kudos
sumenthus
Visitor
Visitor
20,058 Views
Registered: ‎03-04-2012

Fixed it on Ubuntu.  The issue was a matter of updating the drivers.

change:  ioctl:      XPCIe_Ioctl
and:  int XPCIe_Ioctl(struct inode *inode, <BR>
                struct file *filp, <BR>
                unsigned int cmd,<BR>
                unsigned long arg)<BR>

to:  unlocked_ioctl:      XPCIe_Ioctl
and:  int XPCIe_Ioctl(struct file *filp, <BR>
                unsigned int cmd,<BR>
                unsigned long arg)<BR>

ioctl and the next solution (manual kernel locking) are both deprecated from what I read.  The old 4 vs new 3 argument calls were misaligning the arguments.  While I would like to move to Win7 in the future, I will not be putting this effort into those drivers.  Hopefully by the time I'm ready to code the PC application, Xilinx will have updated their examples.  *cough DSP cough*  Let me know if anyone is unable to reproduce this fix, I'll clean up my code and post a diff patch.

View solution in original post

mad29
Visitor
Visitor
14,142 Views
Registered: ‎07-08-2010
Is there any possible way I can get a copy of your code? I am in the process of purchasing parts for a project and I don’t really want to go back to the win32 world to ensure that this card works when I get it.
0 Kudos
medanouar
Visitor
Visitor
13,944 Views
Registered: ‎07-25-2012

Thanks sumenthus for posting the fix, I have the same issue and your solution fixes the problem but when I run xbmd_app and I try to perform DMA transfer test by slecting either write or read using the default configuration, the application closed immediatly and I got this error:

 

ero page size is deprecated

Floating point exception

 

Please did you see this error also?

 

Thanks,

Anouar

0 Kudos
patrickyip
Observer
Observer
13,900 Views
Registered: ‎08-06-2012

Dear Sumenthus,

Can i get a copy of your driver code for xapp1052 on Win7? i want to test Xilinx PCIe on Win7. Win XP is outdated and the driver seems unstable.

My email is patrickyip0 at gmail dot com

Patrick

0 Kudos
sunkuranganath
Visitor
Visitor
13,860 Views
Registered: ‎08-23-2012

Hi Sementhus/Anone

Wondering if anyone got and solution for Win7 driver.

 

I have vanilla driver installed the way you described but get a BSOD, looking into Windbg stack says it asserted in USBHUB driver. While I am trying to decode and relate to my code any pointers on where I should focus for Win7 would help, if you are able to share any section of code that is really great!

 

Appreciate your time.

Thanks

Sunku

0 Kudos
miconk
Newbie
Newbie
6,469 Views
Registered: ‎12-10-2012

Recently we started a project based on the ML-605 card.

I just share here a something ralated to the "Negotiated link speed invalid: LW = 0" error, which I also used to get in Ubuntu 12.04. The problem was that I was starting the application as a normal user. When I ran it with 'sudo' it simply worked :)

I wonder if anyone succeded to compile a Win7 driver and made the example code work? Since WinXP is not supported anymore and our PC continuously and for unknown reason restarts while booting XP (while the ML-605 is connected and loaded with a PCIe design), I suppose our only option is to use Win7.  

0 Kudos