-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ARM64 (JETSON TX2) not working... #525
Comments
It's possible that there's some kind of a data type size mismatch. However if you connect the module to your board and write a sample script that just reads the module's configuration (you can see which registers contain what from either RF24's source or from the datasheet), does that work? Also how does the library not work for you? If it hangs, please determine where exactly. Also just mentioning that if it's GCC (on Linux on the board) you can just do |
If I try to configure the radio on a RPi3 I obtain this: (correct)
Same code in the Jetson I obtain a complete different configuration: (wrong)
If I try to receive from jetson it simply doesn't receive nothing... If I try to send it shows me the fail message where it suggest that the wiring may be wrong... Today I will try to set some registers and read it back using the provided functions and I will let you know! Thanks for the help! EDIT: I've tried to operate directly with registers and the communication appear to be broken in some way... If I set a value in the channel register and take it back the value mismatch. I've exposed the private methods of radio and used the following code:
The output is the following: Any ideas?? May be some issue with a register mask? |
Can you use barebones SPI and see if that still has the issue? Knowing if the problem still exists or doesn't would narrow it down to read_register. |
I just personally suspect it's some lower-level issue because the one-bit-shift issue hasn't occurred before on other platforms. |
I suspect there's some kind of SPI bus misconfiguration, you can read about the different bus configuration possibilities here https://arduino.stackexchange.com/a/13092/11529 but I don't have a Jetson to provide you sample code to set a specific mode. (Also, post your findings as a new comment, edits don't send notifications out) |
Sorry for the late response but I was away from office and I couldn't make tries... I've some news: ---> I've found out that from the device tree the jetson is configured for spi mode 3:
I don't know if this may be a problem... I think that ioctl should have returned an error if mode 0 was not supported, am I wrong?? |
The mode Arduinos use for SPI is MODE0 (because the SPI bus is configured by the library):
You are correct that your board is configured differently. I would try setting CPHA and CPOL to 0, but I wouldn't change the speed because it's not really the issue here. |
I believe I might have found a relevant bug while working with the Jetson Nano. I was also running into an issue where my pipe addresses were not being set correctly. In RF24/utility/SPIDEV/spi.cpp, it seems that in SPI::transfernb, cs_change is set =0 by default, which would mean that the chip would not be automatically "hardware deselected" after every transfer. however, after I set the default value of cs_change to 1, I was able to have the pipe addresses set correctly and run the pingpair_dyn.py script successfully. |
Not sure about this one. https://docs.huihoo.com/doxygen/linux/kernel/3.7/structspi__transfer.html
You may be able to add a #define to SPI.cpp to detect the Jetson and configure cs_change to 1 |
Just to be clear, I should node that cs_change 1 does not work on RPi. I don't have a scope to see exactly what is going on. |
See #876 (comment) We may be able to close this issue in couple weeks (when Ububtu18.04 hits EoL).
This may be specific to the Jetpack SDK since it includes the Linux kernel (which may be customized though not explicitly mentioned in the docs). Remember that the payload data is only queued in the radio's TX FIFO when the CSN pin goes inactive (for any SPI transaction that involves a payload). Reminder to passers-by, the newer CMake install instructions are required for a 64-bit OS |
Dear all,
I'm trying to make the library work with a JETSON TX2 board but I have some issues.
I've modified the configure script and added a soc with the following flags:
-->> flags="-march=armv8-a -mtune=cortex-a57" (-mfpu=neon-vfpv4 -mfloat-abi=hard are not recognized by the compiler and SIMD is defaut in ARM64 i think)
I'm using the SPIDEV driver.
I'm able to correctly compile and link the library but the module wont configure correctly and obviously do not send/receive data.
Please note:
-> I've already tested the modules with two RPi3, using SPIDEV, and they work correctly.
-> the spidev driver itself is working correctly (I've jumped the MISO and MOSI pin and made a test)
-> the gpios seems also to work well (able to rise up the pin that I'm using via the device file)
-> I've used as cepin=388 (gpio388) and cspin=30 (/dev/spidev3.0)
I'm starting to think that the malfunctioning may be related to some issue with the 64 bit architecture of the board.. Have someone ever tried to build on arm64 machine??
Do you have some suggestion?? Am I missing something??
Thanks for the help,
Luca
The text was updated successfully, but these errors were encountered: