nxppy icon indicating copy to clipboard operation
nxppy copied to clipboard

bug in nxp lib?

Open iceman1001 opened this issue 5 years ago • 3 comments

Please answer these questions as part of your new issue.

Which version of Python are you using?

v2.7

Which OS and version are you running?

PI

Is SPI enabled?

yes

Are you trying to read/write a Mifare Classic card? (This is currently unsupported)

no

There seems to be a bug in the NxpLib.

https://github.com/JohnMcLear/NXP-Raspberry-Pi-Card-Polling-Demo/blob/master/source/NxpRdLib_PublicRelease/comps/phbalReg/src/R_Pi_spi/phbalReg_R_Pi_spi.c#L319

The source here, seems to be using the same buffer TX and RX

spi.tx_buf = (unsigned long)pTxBuffer ; spi.rx_buf = (unsigned long)pTxBuffer ;

-- gdb trace.

Thread 1 "python" received signal SIGSEGV, Segmentation fault. 0x76aa47e8 in phbalReg_Stub_Exchange () from /home/pi/.local/lib/python2.7/site-packages/nxppy.so (gdb) bt #0 0x76aa47e8 in phbalReg_Stub_Exchange () from /home/pi/.local/lib/python2.7/site-packages/nxppy.so #1 0x76a9127c in phhalHw_Rc523_ReadRegister () from /home/pi/.local/lib/python2.7/site-packages/nxppy.so #2 0x76a8e2e0 in phhalHw_Rc523_FieldOff () from /home/pi/.local/lib/python2.7/site-packages/nxppy.so #3 0x76a7fad0 in Mifare_select (self=0x3d7368) at Mifare.c:289 #4 0x0008be70 in PyEval_EvalFrameEx () #5 0x00084494 in PyEval_EvalCodeEx () #6 0x0008c8dc in PyEval_EvalFrameEx () #7 0x0008c7d0 in PyEval_EvalFrameEx () #8 0x0008c7d0 in PyEval_EvalFrameEx () #9 0x00084494 in PyEval_EvalCodeEx () #10 0x000841f8 in PyEval_EvalCode () #11 0x000bd8b8 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?)

iceman1001 avatar Oct 20 '18 13:10 iceman1001