-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug in nxp lib? #76
Comments
@michaelneurohr, can you verify? I agree with @iceman1001 that this line looks fishy. |
Forget my link to JohnMcLer, that was me trying to find the method via google.
|
The bug is triggered in my stress tests, when sending a select/write sequence in a loop with a sleep 1sec each iteration. It takes around 240-320 times before triggered. If the loop has a sleep for two seconds or more the loop can run to 3000 times at least. |
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?)
The text was updated successfully, but these errors were encountered: