Topic: compiling example.c in BSP 06.02.2015  (Read 67598 times)

ec March 17, 2015, 12:24 PM (#15)

  • Member
  • *
  • Posts: 18
After a shutdown and reboot, I am running as root, the following is the output of memtestsip:

./memtestsip FM780 0 200 2 1
4DSP Memory Test Application (DDR2, DDR3 and QDR2)
--------------------------------------------------
Initalizing (synthesizer frequency = 200MHz), please wait... Done : FM780:0


Configuring memory FIFOs:
 - configured FM780_DDR3_V1   FIFOs

Starting test (1 loops)
LOOP00000001 | Bank index 0, FM780_DDR3_V1   |Could not send data
LOOP00000001 | Bank index 1, FM780_DDR3_V1   |Could not send data
LOOP00000001 | Bank index 2, FM780_DDR3_V1   |Could not send data
LOOP00000001 | Bank index 3, FM780_DDR3_V1   |Could not send data
Test succeeded!

Test efficiency (READ/WRITE) (including printfs, etc..) : 0.0[MB/s]
Test efficiency (DMA Read)                              : nan[MB/s]
Test efficiency (DMA Write)                             : 0.0[MB/s]


The output of lspci -vvv is attached.


The output of '4fm_get_information FM780 0' is as follows:
Successfully read information from device 0
Information:
        Library Version       : 1.56 build 001
        FPGA A PCI Revision   : 5.0
        FPGA A Revision       : 3.0
        FPGA A Customer Nr.   : 0
        FPGA A Firmware Type  : 380
        FPGA A Has Ext. Infos : 0
        CPLD Revision         : 1.4
        Board Serial Number   : 10
        User ROM Value        : 4294967295
        FPGA B Device Type    : XC6VX980T-1FFG1930C
        FPGA B Revision       : 1.3.0
        FPGA B Firmware Type  : 393


===================================================

A related question: When I run TrainMaterialStep1, it runs until it says "Could not receive random data from the hardware device...". Does that mean it sent data correctly (which it fails to do in memtestsip)?

I notice the training materials use functions _4FM_SendData and _4FM_ReceiveData (which are documented in the programmer's guide), while memtestsip uses sipif_writedata and sipif_readdata (which I cannot find in the documentation). Is one of these up to date and one deprecated? Is there documentation for the up to date functions?

Thanks a lot for your help

tonyku March 17, 2015, 01:28 PM (#16)

  • Administrator
  • Member
  • *****
  • Posts: 196
Hi Eli,


Yeah the lspci is not needed if you are able to retrieve the information from the PCIe.  It is just to make sure the board is detected by the driver.


Are you able to run this board with a Windows drive?  (i.e. using the standard 4FM GUI with the memory test module).     The board is verified with Windows 4FM setup.


Is the BSP 06.02.2015 the first time you install the BSP or has there been a previous version?    If there was a previous version we need to make sure the libraries, etc. are all properly recompiled and re-installed.

If you run "dmesg" as root, do you see any error message relating to 4FM? 


Tony





ec March 17, 2015, 02:19 PM (#17)

  • Member
  • *
  • Posts: 18
output of dmesg includes:

 Start loading IDM driver
 **************************************************************
Register PCI device driver
**********************************************************
******************************************************
/root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory
/root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory
/root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory
/root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory


There was a previous version (19.12.2014) installed as a user, but this is the only version that I installed as root, after the previous one was already installed.

ec March 17, 2015, 04:52 PM (#18)

  • Member
  • *
  • Posts: 18
after rmmod and insmod again, dmesg included:
PCI: Setting latency timer of device 0000:03:00.0 to 64
/root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: found 1 devices
 
then after running memtestsip as before, it had:
/root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory
root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory
root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory
root/4fm.bsp.06.02.2015/4fm-driver-0.1.1.6/4fm.c: Out of memory

arnaudNL March 18, 2015, 11:12 AM (#19)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 7110
What kind of host computer are you using? The driver could not allocate memory for the scatter and gather table, the kernel refused the allocation.

ec March 18, 2015, 11:35 AM (#20)

  • Member
  • *
  • Posts: 18
I'm using a desktop with Intel Xeon processors. Using a network file system (though root is local). Running Redhat 5. Output from uname -a is:

Linux adgeda12.md.hnsnet 2.6.18-274.el5 #1 SMP Fri Jul 8 17:36:59 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

arnaudNL March 18, 2015, 03:21 PM (#21)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 7110
And how much memory do you have on there, it is quite strange the driver is not having enough memory. As if the kernel memory space is scarce on this system.

ec March 18, 2015, 05:00 PM (#22)

  • Member
  • *
  • Posts: 18
cat /proc/meminfo
MemTotal:      6044292 kB
MemFree:       4593900 kB
Buffers:        125196 kB
Cached:         942408 kB
SwapCached:          0 kB
Active:         566828 kB
Inactive:       700756 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:      6044292 kB
LowFree:       4593900 kB
SwapTotal:    12586916 kB
SwapFree:     12586916 kB
Dirty:              16 kB
Writeback:           0 kB
AnonPages:      199940 kB
Mapped:          70480 kB
Slab:           107416 kB
PageTables:      24944 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:  15609060 kB
Committed_AS:   557712 kB
VmallocTotal: 34359738367 kB
VmallocUsed:    303120 kB
VmallocChunk: 34359434227 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

ec March 19, 2015, 05:05 PM (#23)

  • Member
  • *
  • Posts: 18
Where do the dbg() messages go to, and how can I turn it on (if necessary)?

Thanks

ec March 19, 2015, 06:09 PM (#24)

  • Member
  • *
  • Posts: 18
using err() messages, I've located where the allocation is failing. It's line 864 of 4fm.c, and it attempts to allocate 262144 bytes (pages_mapped * sizeof *sg), is that correct?

Thanks

arnaudNL March 20, 2015, 05:00 AM (#25)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 7110
That's correct, and we never seen that failing over 7 years. I am not able to tell why is it failing on your system, it is like if you don't have much kernel/pci space available.

arnaudNL March 24, 2015, 05:13 AM (#26)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 7110
Dear Sir,


Have you been able to move forward?


Best Regards,
Arnaud

ec March 24, 2015, 09:51 AM (#27)

  • Member
  • *
  • Posts: 18
I have not been able to move forward yet. I've never dealt with device drivers before, and my colleague has been out the past week, so it's been slow progress.

I do know that I read in Linux Device Drivers (3rd ed.) that kmalloc is not reliable on all systems for allocating greater than 128K, and that there's a better way if I need more than a few K. I know the book is old though, so I'm not sure what to make of that. And if you haven't seen your driver fail, it's probably pretty reliable.

My colleague should be back today, so I will contact you if I cannot get help from within the company.

Thanks

ec March 25, 2015, 10:14 AM (#28)

  • Member
  • *
  • Posts: 18
I ran the training materials, and it seems that it allocates a much smaller amount of memory, so it passed the sending data, but failed to receive data.

arnaudNL March 25, 2015, 10:31 AM (#29)

  • 4DSP Staff (EU)
  • Administrator
  • Member
  • *****
  • Posts: 7110
Maybe mem= boot parameters can help here. I understand you believe that there is an issue in our scheme but today I took a very simple machine with 4GB RAM on, installed a default x64 debian linux and could run the sipmemtest application without issue. Your machine has a little less than 6GB so I assume you have enough memory. It is more as if your specific kernel configuration is not having much kernel memory available.


Can you also confirm that you are using a 64 bit linux?


best Regards,
Arnaud