-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
Odroid N2 | SPI unavailable #5645
Comments
I cannot see links or files I attached to this issue. |
Many thanks for your report. Note that RPi with its I'll take a look when I'm home: There are device tree overlays in |
Yes the RPi approach is different, but in essence what I read multiple places for how I tried to enable the SPI for N2 (not Pi) with commands I added to the dietpiEnv.txt is not working. I would not expect unless stated that Pi config.txt could be used for example with N2. Point is it should be easy to enable, and does not have to be exactly done same as Pi. The Pi does have many many extra special DTBs that happen to have extra I2C definitions and SPI agmonst the many DTBs one can use. All one has to do is either load the DTB post boot via CLI command or include in the config.txt. Either of these ways work just fine and I have used both. I use the load via CLI first as test to see if I have chosen correct for what I want and once confirmed then add to Pi config.txt. I should not have to spend days with no success to enable basic elements such as SPI. On Pi done in few seconds and then one can then compile the code one has for the SPI devices one has. This lack of ease for such basics via non Pi OS is likely causing many to just stay with a Pi despite the many shortfalls of Pi. Why I want to use N2 and only later Rock 3A, M1, et al as so much better hardware than Pi. As long as making enabling basics and alternate SPI and I2Cs difficult to impossible just drives people back to Pi with its many many issues of Pi's primary OS and many issues related to Pi hardware design rather than use better OS and many better than Pi hardware designs. The N2 and M1 are just two examples of many better hardware designs compared to Pi. |
I agree. We cannot change something about how device trees and related hardware features can be enabled in mainline U-Boot and mainline Linux, but we can add For SPI however, sadly there is no device tree overlay 😞. However, I think I found the device we need to toggle: cat /proc/device-tree/__symbols__/spicc0; echo
cat /proc/device-tree/soc/bus@ffd00000/spi@13000/status; echo We can write an overlay for this. This |
I had seen and read the N2 link you noted in your last entry. Rather messy compared to Pi one just enters line to enable SPI in config.txt and then good to go. I did not attempt as frankly which all I have read of what to do that is suppose to enable SPI not enabling the SPI I had no desire to try. Having to mess with compiler tree, edit DTBs and such is rather messy. Is there no way to create a SPI DTB that can then be loaded with option of which SPI (0 or 1) or both that can be enabled? Again is can be made simple it is best. |
Unlike Raspberry Pi at least the N2 (all I know as only alternate to PI SBC I have three of now as of week ago) has I2C enabled by default. Would it make sense to have SPI enabled by default on N2 and other alternate SBCs or to have both disabled by default and one chooses if want I2C and or SPI enabled and how many of those want enabled? |
This is what a device tree overlay does, which can then be enabled with a single value in
If we enable it, others may wonder why the GPIO pins are not working and ask the other way round. If it's easy to toggle an interface, I prefer to have it disabled by default, i.e. less kernel drives are loaded when not needed. |
I asked as at moment I2C appears enabled by default. I would agree makes sense for I2C and SPI to be disabled by default and then one can choose which of these one needs. By allow both disabled by default as you noted allows more GPIO pins for other uses that may need those GPIO pins and not I2C and/or SPI. No major rush and solution. I rather have right solution based on decisions such as off by default be vetted. As FYI the reason SPI is important in my case and maybe for others later is for ADCs normally used for seismic based use, i.e. measuring earthquakes. That said as you know there are many SPI devices on break out boards that then could be use by the many excellent alternate choices to Raspberry Pi that in my opinion are much better. The N2 is especially well suit for seismic type applications where common to process 20,000,000 records of seismic data multiple times (for different manners of data presentation) every 10-15 minutes. My hope is the 4GB N2+ will have enough RAM to do so. All done with CLI so no DE/GUI installed on the SBC. These no need for DE/GUI on SBC for such use. I only use SBC in CLI. |
Some Additional Testing: Manjaro-ARM no SPI defined no can find how to. Official Hardkernel 22.04 has SPI defined by default, but sould have set of pins defined for SPI not just one pin: Sun Jul 31 22:13:40 UTC 2022
|
I have missed a number of, including the significant events in the Indonesia Area 20220911-1855+0000-UTC-IndonesiaArea-Example-001 in last 36 hours due to this issue. It means the hundreds of dollars of investment in SPI based devices two years ago is useless and that work in RPi with usual SPI programming. The 1GB limit of pre RPi4B imposes serious limits due to the need to record and create graphs from the about 9,000,000 records that need to be logged every 24 hours at sampling rate typical for Seismic instruments. I am now having to seriously consider in next few days investing over $125 in new ICs as well as time and cost of developing PCBs for inferior solution that only SPI devices are suitable for. This means very reduced detail and data would be recorded for seismic events about world not to mention the development time of new PCBs, the time to develop, order, and test new PCBs and PCB revisions on top of 3-4 months of developing new code for new and inferior for seismic application ICs. Using a RPi4B is not option due to the many issues with RPi4B that I will not explain and why a N2+ was a much better solution unaware there is no SPI, and various issue related to GPS that all specific to the N2+ images, not just dietpi, but all N2+ images for basics such as SPI devices that are commonly used on RPi for non-seismic uses and reasons that SPI is only or best choice. |
With a device tree like this, we can get the bus and a dummy node enabled, but that does not result in a functional SPI device:
We'd need to look into the vendor kernel device tree to see how it is solved there. Similarly to the GPIO issue, the Odroid forum is probably the best place to bring up the question how to enable SPI with mainline kernel: https://forum.odroid.com/viewforum.php?f=176 And as workaround, also here, downgrading to legacy vendor Linux 4.9 should help: apt install linux-{image,dtb}-legacy-meson64 |
Creating a bug report/issue
Required Information
Linux DietPi 5.10.123-meson64 #22.05.3 SMP PREEMPT Wed Jun 22 07:23:04 UTC 2022 aarch64 GNU/Linux
Additional Information (if applicable)
Steps to reproduce
overlays=spi-spidev
param_spidev_spi_bus=0
param_spidev_max_freq=100000000
Expected behaviour
Actual behaviour
Extra details
The text was updated successfully, but these errors were encountered: