-
Notifications
You must be signed in to change notification settings - Fork 22
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
CPU / processor identification in hw.sh during compilation on later Raspberry Pi OS versions. #35
Comments
I have tested against RPi hardware up to version 4 Do you know which version of Raspberry Pi OS you are using? Also, have you checked out the latest version of this repository? Can you post the output here of running the command : ./hw_all.sh Thanks |
Operating system was written with the Linux variant of the Raspberry Pi Imager tool - Default selection "Raspberry Pi OS (64-bit) 2024-03-15" Output from shell: cat /etc/os-release Using the latest version of the code from this repo Output of ./hw_all.sh: ./hw_all.sh Tested as my local user and as root with the same result. |
Ok, thanks for the reply. The hardware setting is only used to report when the program is run what hardware it was compiled on, which is only an indicator when running the tool incase the code is compiled on a machine with a different clock and therefore SPI speed to the machine it's being run on. i.e. compiled on RPI3 but run on RPI2 would not give good results. The revision code is what is used to determine the actual hardware and set up the clock. Which is in turn used to work out the SPI divider values and buffer sizes. So for your revision code of a02082, the clock is set as 400.
The program will still work in the same way, despite not being able to get the hardware type from /proc/cpuinfo Maybe an improvement would be to ditch the hardware value and instead calculate it from the revision code. Thanks |
Good to know, I manually set the CPU value to just get things going without warning. Thanks for the work! Feel free to close or leave as a note for future improvement as you see fit. |
My Pi3 B with a revision code of a020d3, running on "Raspbian GNU/Linux 11 (bullseye)" gives ..
Which decodes as :
So the Hardware value returned here of BCM2835 is wrong, it should be reporting BCM2837 This might be why they took it out of /proc/cpuinfo. |
hw.sh no longer returns an expected string on later versions of Raspberry Pi OS
Building on a fresh Raspberry Pi OS install on a Raspberry Pi 3 and getting a few "Built on unknown processor" warnings. I looked into hw.sh and how it works. The expected output from
cat /proc/cpuinfo
is not as expected and always ends up withHW_UNKNOWN
.Here is a sample of what is returned:
This lead me to the following documentation: https://github.com/raspberrypi/documentation/blob/develop/documentation/asciidoc/computers/raspberry-pi/revision-codes.adoc
It seems the way to go is to read information from elsewhere and set the CPU accordingly through a lookup table or similar.
Hope this is a useful report.
The text was updated successfully, but these errors were encountered: