Re: [EXTERNAL] Re: GPIB as a pure slave

Stefan Olejnik <[email protected]> Wed, 18 Jan 2023 22:06:27 +0100
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <[email protected]>
Hello Frank

You are right, I have checked generated interrupts, and there in no 232 
interrupt in the list after communication is done:

  69:        117          0 0          0     GICv3  35 Level     galcore:0
  70:          2          0          0          0     GICv3  57 
Level     galcore:2d
  74:          2          0          0          0  gpio-mxc   3 
Edge      ads7846
  78:          0          0          0          0  gpio-mxc   7 
Edge      1-0020
  81:          0          0          0          0  gpio-mxc  10 
Edge      30b50000.mmc cd
  82:          0          0          0          0  gpio-mxc  11 
Edge      extcon_usb1
111:          0          0          0          0  gpio-mxc   8 Level     
bd718xx-irq
203:          0          0          0          0  gpio-mxc   4 Edge      
edt-ft5206
231:          0          0          0          0  bd718xx-irq 5 
Edge      gpio_keys
*232:          0          0          0          0     GICv3 157 
Level     ni-pci-gpib*
233:          0          0          0          0   PCI-MSI   0 Edge      
PCIe PME, aerdrv
234:          0          0          0          0    1-0020   1 Edge      
Back
235:          0          0          0          0    1-0020   2 Edge      
Home
236:          0          0          0          0    1-0020   3 Edge      
Menu
237:        329          0          0          0     GICv3 138 Level     
30902000.jr
238:          0          0          0          0     GICv3 146 Level     
30903000.jr

I am right trying to set "pci=nomsi" in Yocto image, but I am beginner 
in kernel commandline set. I will try to do It. Thanks for advise.

Stefan

On 1/17/23 19:20, Frank Mori Hess wrote:
> You might want to check that your board is generating interrupts.  I
> had to set the "pci=nomsi" kernel command line option in order to get
> interrupts working with an ARM SOC system.
>
> On Mon, Jan 16, 2023 at 12:38 PM Stefan Olejnik
> <[email protected]>  wrote:
>> Hi Dave,
>>
>> I have the same results with slave_test2 :
>>
>> root@imx8mm-var-dart:/home/stefan/bin# ./slave_test2
>> [  135.918117] tnt4882: minor 0 read timed out
>> [  135.922325] tnt4882: read timed out
>> Got *IDN?
>>
>> [  138.990013] tnt4882: write timed out
>> error: ibwrt fail
>>   - EABO 6: Operation aborted
>> root@imx8mm-var-dart:/home/stefan/bin#
>>
>>
>> I am using computer with Win10 and National Instruments GPIB packages -> NI-VISA interactive control program for GPIB. As a commands I am using "query", send the request and waiting for the answer. This Win10 computer is connected to HW (Variscite board with NI PCIe-GPIB (rev 02)) with Yocto linux 5.10 image via NI GPIB-USB-HS+ connector.
>>
>> I am handling scenarios as follows:
>>
>> No TACS or LACS is set => use poll timer to check if It is any change - 1second.
>>
>> LACS is set => use poll timer 200ms to check if read ( ibrd ) returns any data. If yes, read till end-of-the data and save them. Set flag to answer. When CIC do not address slave as a TACS ( use e.g. only write command ) I am getting, of course, read time out. But this is  OK, no data on the GPIB bus.
>>
>> TACS is set => try send the data back to the master - CIC. Clear flag to send data.
>>
>> I am not getting any notifier from the kernel to activate communication. Therefore I am using polling mechanism. It is OK for me now.
>>
>> As I have mentioned already. Reading seems to me OK. When data are on the GPIB bus, I am reading them. When no data, I am getting read time out. But I have somehow to check, if any data are ready to be read => poll mechanism.
>>
>> Write seems to me bigger problem, as I have already described.
>>
>> Stefan
>>
>>
>> On 1/16/23 14:01, dave penkler wrote:
>>
>> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>>
>>
>>
>> Hi Stefan,
>> It looks like in your case the slave board was already addressed as a listener before you started slave_test which is why you got the timeout.
>> Here is a new version that deals with this case. It loops until it reads a string when addressed as a listener and then writes back that string when addressed as talker. If the read times out it prints "read timeout" and goes back to the loop.
>> On the master side once a string has been written the response must be read before writing another. Are you using ibterm on the master or something else ?
>>
>> $ ./slave_test2
>> read timeout
>> read timeout
>> Got hello
>> Got bye
>> Got quit
>> slave done
>> $
>>
>> cheers,
>> -Dave
>>
>> On Sun, 15 Jan 2023 at 09:46, Stefan Olejnik<[email protected]>  wrote:
>>>   Hi, Dave
>>>
>>> Thanks a lot for Your effort.
>>>
>>> I have tested Your program, but it is almost the same as I have used. The result are as follows:
>>>
>>> root@imx8mm-var-dart:/home/stefan/bin#
>>> root@imx8mm-var-dart:/home/stefan/bin# ./slave_test
>>> [  124.896503] tnt4882: minor 0 read timed out
>>> [  124.900712] tnt4882: read timed out
>>> Got hello
>>> [  127.968496] tnt4882: write timed out
>>> error: ibwrt fail
>>>   - EABO 6: Operation aborted
>>> root@imx8mm-var-dart:/home/stefan/bin# ./slave_test
>>> [  187.105354] tnt4882: minor 0 read timed out
>>> [  187.109563] tnt4882: read timed out
>>> Got *IDN?
>>>
>>> [  190.177371] tnt4882: write timed out
>>> error: ibwrt fail
>>>   - EABO 6: Operation aborted
>>> root@imx8mm-var-dart:/home/stefan/bin#
>>>
>>> READING:
>>>
>>> Interesting is that during "ibrd" even read timeout is coming from TNT4882, the data are read OK. I am using reading per char,  till END or END-OF-STRING => "\n"  and I am getting no time-out during reading.
>>>
>>> WRITTING:
>>>
>>> First "ibwrt" is always time-outed, the second also, but data are delivered, as I am already described. Therefore I am using short TIMO ( e.g. 10ms ) for ibwrt, and on the receiver device is TIMO set to 3s, and I am getting the data. Of course from second "ibwrt".
>>>
>>> Stefan.
>>>
>>>
>>
>> _______________________________________________
>> Linux-gpib-general mailing list
>> [email protected]
>> https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/linux-gpib-general__;!!KPww_GFiJXw!dStM8yAfuh3c-g2DADHbI16c9tjl3JGNosqI3Iot8J8ca4a2dFSpRfVPrlbgFg5WJ_2JeC33Gjy440iMy6p_$
>>
>> _______________________________________________
>> Linux-gpib-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
>
>

_______________________________________________
Linux-gpib-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-gpib-general