larytet / TDA8029

GNU General Public License v2.0
2 stars 4 forks source link

undefined symbols "IFDHCreateChannelByName" & "flush_uart" #1

Open girst opened 7 years ago

girst commented 7 years ago

hi, I am trying to get your driver running on Raspbian jessie, but I've run into trouble.

I've compiled the latest version, with one minor change (sed -i 's/ttyUSB/ttyAMA/' serial.c) with no problems. But when starting pcscd in debug-mode, I get this:

root@raspberrypi:/home/pi/TDA8029# pcscd -a -d -f
00000000 pcscdaemon.c:263:main() pcscd set to foreground with debug send to stdout
00002262 configfile.l:283:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00001547 configfile.l:317:DBGetReaderListDir() Skipping non regular file: ..
00001498 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libDT3000
00001879 configfile.l:212:evaluatetoken() Add reader: Infineer DT 3000
00001795 configfile.l:317:DBGetReaderListDir() Skipping non regular file: .
00001568 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00001942 readerfactory.c:1012:RFInitializeReader() Attempting startup of Infineer DT 3000 00 00 using /usr/lib/pcsc/drivers/serial/libDT3000.so
00002428 dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannelByName: /usr/lib/pcsc/drivers/serial/libDT3000.so: undefined symbol: IFDHCreateChannelByName
00001628 readerfactory.c:865:RFBindFunctions() Loading IFD Handler 2.0
00032765 readerfactory.c:355:RFAddReader() Using the reader polling thread
pcscd: symbol lookup error: /usr/lib/pcsc/drivers/serial/libDT3000.so: undefined symbol: flush_uart
root@raspberrypi:/home/pi/TDA8029# echo $?
0

The interesting lines are:

00002428 dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannelByName: /usr/lib/pcsc/drivers/serial/libDT3000.so: undefined symbol: IFDHCreateChannelByName
pcscd: symbol lookup error: /usr/lib/pcsc/drivers/serial/libDT3000.so: undefined symbol: flush_uart

systemd complains about the undefined symbol: flush_uart, but not about the other one. I tried to compile from commit 9d4bfe53792d05a11ee65c60f3ca2b72f7392537, which to my understanding is the last one without flush_uart, but gcc is throwing errors at me.

my /etc/reader.conf.d/libDT3000 looks like this: (taken from here)

FRIENDLYNAME  "Infineer DT 3000"
DEVICENAME    /dev/ttyAMA0
LIBPATH       /usr/lib/pcsc/drivers/serial/libDT3000.so
CHANNELID     1

I would greatly appreciate any help - thanks, Tobias

larytet commented 7 years ago

This is a dead project. I think that I cloned the code from the NXP WEB site because I did some work with a similar device. I tend to clone source trees to ensure their survival while I can need them.

larytet commented 7 years ago

Another though - If you have a choice use modern USB devices.

girst commented 7 years ago

I had the suspicion. Thanks for replying anyways!

I'm bound to serial devices, sadly.

larytet commented 7 years ago

I am leaving the issue opened. I do not have meanings to debug the problem besides Yocto/Qemu route. If you figure out what the problem is - I suspect a patch in the Infineer DT library or in the driver will be needed - feel free to update the issue. If you think that you hit an insurmountable road block let me know I will try to help you to link the driver.

girst commented 7 years ago

Thanks. Will do, but might take a while.

girst commented 6 years ago

I finally had some very little time over the holidays to have a look at this again.

Fistly, the IFDHCreateChannelByName was a PEBCAK: this driver uses IFDHCreateChannel instead, which doesn't need the DEVICENAME line in the configuration.

I am still stumped by the undefined symbol: flush_uart problem. According to the commits, it was you who introduced that function call -- do you happen to remember where it is implemented? (i've looked at the sources for PCSC and wasn't able to find it there, and neither duckduckgo nor google return any results for flush_uart)

(I might have taken on a bit too much for me. Sadly, the TDA is the only chip with somewhat-existing serial drivers (which I depend on because I'm using the raspberry pi's only USB port in host mode) I can get my hands on)

larytet commented 6 years ago

Appears that I was trying to add an interface for integration with some other code (u-boot? I can only guess at this point, my commit messages are not very informative) I would try git checkout 91a07 first to get the original code or as close as possible to the original. Things like FUNCTION_LOG is definitely what I would write. Looks like an attempt to implement ALPAR (https://github.com/edipermadi/teensy-alpar/wiki/ALPAR-Protocol) . My memory is a white page frankly. I do not recognize the code and it is not surprising after all these years. I think that you can add an empty

static void flush_uart()
{
    FUNCTION_LOG("Flushing UART\r\n");
}

It will resolve the problem with the link. I can only assume that flush_uart() can be implemented by calling Posix flush API for the opened serial device.