Hi Don
I do like these kind of questions!
Hope to give some answers:
To compile or build all the code ; there is tooling required; these tooling are called dependencies and willl be installed on your RPI--- Installing dependency: raspberrypi-kernel-headers
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
libfuse2
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
raspberrypi-kernel-headers
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.7 MB of archives.
After this operation, 180 MB of additional disk space will be used.
Get:1
http://archive.raspberrypi.org/debian bullseye/main armhf raspberrypi-kernel-headers armhf 1:1.20220120-1 [27.7 MB]
Fetched 27.7 MB in 18s (1568 kB/s)
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package raspberrypi-kernel-headers.
(Reading database ... 100346 files and directories currently installed.)
Preparing to unpack .../raspberrypi-kernel-headers_1%3a1.20220120-1_armhf.deb ...
Unpacking raspberrypi-kernel-headers (1:1.20220120-1) ...
Setting up raspberrypi-kernel-headers (1:1.20220120-1) ...
--- Installing dependency: linux-headers-rpi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-rpi
--- Installing dependency: git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.30.2-1).
The following package was automatically installed and is no longer required:
libfuse2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
--- Installing dependency: device-tree-compiler
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
device-tree-compiler is already the newest version (1.6.0-1).
device-tree-compiler set to manually installed.
The following package was automatically installed and is no longer required:
libfuse2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
--- Installing dependency: pigpio
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pigpio is already the newest version (1.79-1+rpt1).
The following package was automatically installed and is no longer required:
libfuse2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Cloning into 'Radioberry-2.x'...
remote: Enumerating objects: 1021, done.
remote: Counting objects: 100% (1021/1021), done.
remote: Compressing objects: 100% (705/705), done.
remote: Total 1021 (delta 406), reused 745 (delta 274), pack-reused 0
Receiving objects: 100% (1021/1021), 28.47 MiB | 5.19 MiB/s, done.
Resolving deltas: 100% (406/406), done.
Before installing; we have to be certain that you do not an update install; we need to close the radioberry service
you are getting not loaded response because this is the first installation...
Failed to stop radioberry.service: Unit radioberry.service not loaded.
Failed to disable unit: Unit file radioberry.service does not exist.
Installing Radioberry gateware Cyclone 10 CL025...
Before installing; we have to be certain that you do not an update install; we need to close the radioberry device driver...
Radioberry gateware Cyclone 10 CL025 installed.
Installing Radioberry driver...
modprobe: FATAL: Module radioberry not found.
Fresh installation ; so this is a correct message; it is not installed before so we could not remove it.
make[1]: Entering directory '/usr/src/linux-headers-5.10.92-v7l+'
CC [M] /tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.o
In file included from /tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:62:
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry_gateware.h: In function 'prepare_gateware_loading':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry_gateware.h:52:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
52 | int count = 0;
| ^~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c: In function 'firmware_load':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:92:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
92 | u8 *buf = kmalloc(size + 1, GFP_KERNEL);
| ^~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:100:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
100 | int b = 0;
| ^~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c: In function 'loading_radioberry_gateware':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:112:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
112 | const struct firmware *fw_entry;
| ^~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:118:24: warning: passing argument 1 of 'firmware_load' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
118 | firmware_load(fw_entry->data, fw_entry->size);
| ~~~~~~~~^~~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:89:33: note: expected 'char *' but argument is of type 'const u8 * const' {aka 'const unsigned char * const'}
89 | static void firmware_load(char *firmware, int size) {
| ~~~~~~^~~~~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c: In function 'radioberry_open':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:152:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
152 | int *minor = (int *)kmalloc(sizeof(int), GFP_KERNEL);
| ^~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:153:6: warning: unused variable 'major' [-Wunused-variable]
153 | int major = MAJOR(inode->i_rdev);
| ^~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c: In function 'radioberry_probe':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:234:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
234 | struct device *dev = &pdev->dev;
| ^~~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:234:17: warning: unused variable 'dev' [-Wunused-variable]
234 | struct device *dev = &pdev->dev;
| ^~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c: In function 'radioberry_init':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:268:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
268 | int result = platform_driver_register(&radioberry_driver);
| ^~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:263:9: warning: unused variable 'size' [-Wunused-variable]
263 | size_t size;
| ^~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:262:6: warning: unused variable 'retval' [-Wunused-variable]
262 | int retval;
| ^~~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c: In function 'radioberry_exit':
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:333:8: warning: unused variable 'devno_top' [-Wunused-variable]
333 | dev_t devno_top;
| ^~~~~~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:332:8: warning: unused variable 'devno' [-Wunused-variable]
332 | dev_t devno;
| ^~~~~
/tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.c:331:6: warning: unused variable 'i' [-Wunused-variable]
331 | int i;
| ^
Some warnings... do not get nervous.... MODPOST /tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/Module.symvers
CC [M] /tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.mod.o
LD [M] /tmp/Radioberry-2.x/SBC/rpi-4/device_driver/driver/radioberry.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.92-v7l+'
filename: /lib/modules/5.10.92-v7l+/kernel/drivers/sdr/radioberry.ko
version: 93
license: GPL
description: Radioberry SDR device driver. (rpi-4)
author: Johan Maas -
pa3...@gmail.comsrcversion: 7DA31321808D83C8A35982D
alias: of:N*T*Csdr,radioberryC*
alias: of:N*T*Csdr,radioberry
depends:
name: radioberry
vermagic: 5.10.92-v7l+ SMP mod_unload modversions ARMv7 p2v8
Radioberry driver installed.
Here you see that the installation of the device driver was succesfull; it shows the detailed information
Now installing the firmware; the firmware does implement the openHPSDR protocol; this makes it possible to use different type of SDR programs like piHPSDR, Powersdr etc
Installing Radioberry firmware...
rm -f version.o
gcc -g -O3 -c -o register.o register.c
register.c: In function 'process_http':
register.c:105:2: warning: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration]
105 | write(sockfd, sendline, strlen(sendline));
| ^~~~~
| fwrite
register.c:107:14: warning: implicit declaration of function 'read'; did you mean 'fread'? [-Wimplicit-function-declaration]
107 | while ((n = read(sockfd, recvline, MAXLINE)) > 0) {
| ^~~~
| fread
register.c: In function 'postRadioberryConfiguration':
register.c:132:73: warning: implicit declaration of function 'inet_ntop' [-Wimplicit-function-declaration]
132 | _addrtype == AF_INET && (pptr = hptr->h_addr_list) != NULL) inet_ntop(hptr->h_addrtype, *pptr, str, sizeof(str));
| ^~~~~~~~~
register.c:137:2: warning: implicit declaration of function 'inet_pton' [-Wimplicit-function-declaration]
137 | inet_pton(AF_INET, str, &servaddr.sin_addr);
| ^~~~~~~~~
register.c:141:2: warning: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
141 | close(sockfd);
| ^~~~~
| pclose
gcc -g -O3 -c -o bias.o bias.c
bias.c: In function 'init_I2C_bias':
bias.c:15:10: warning: 'return' with a value, in function returning void
15 | return fd_i2c_bias;
| ^~~~~~~~~~~
bias.c:8:6: note: declared here
8 | void init_I2C_bias() {
| ^~~~~~~~~~~~~
bias.c:17:21: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration]
17 | i2c_bias_handler = ioctl(fd_i2c_bias, I2C_SLAVE, ADDR_BIAS);
| ^~~~~
bias.c: In function 'close_I2C_bias':
bias.c:35:18: warning: comparison between pointer and integer
35 | if (fd_i2c_bias != NULL) close(fd_i2c_bias);
| ^~
gcc -g -O3 -c -o measure.o measure.c
measure.c: In function 'openI2C_measure':
measure.c:30:10: warning: 'return' with a value, in function returning void
30 | return fd_i2c_measure;
| ^~~~~~~~~~~~~~
measure.c:21:6: note: declared here
21 | void openI2C_measure() {
| ^~~~~~~~~~~~~~~
measure.c:32:24: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration]
32 | i2c_measure_handler = ioctl(fd_i2c_measure, I2C_SLAVE, ADDR_MEAS);
| ^~~~~
measure.c: In function 'close_I2C_measure':
measure.c:48:21: warning: comparison between pointer and integer
48 | if (fd_i2c_measure != NULL) close(fd_i2c_measure);
| ^~
gcc -g -O3 -c -o radioberry.o radioberry.c
In file included from radioberry.c:56:
radioberry.h:57:1: warning: return type defaults to 'int' [-Wimplicit-int]
57 | mask(val) { return val & (CAPACITY - 1); }
| ^~~~
radioberry.h: In function 'mask':
radioberry.h:57:1: warning: type of 'val' defaults to 'int' [-Wimplicit-int]
radioberry.h: At top level:
radioberry.h:58:1: warning: return type defaults to 'int' [-Wimplicit-int]
58 | push(val) { assert(!full()); spi_commands[mask(p_write++)] = val; }
| ^~~~
radioberry.h: In function 'push':
radioberry.h:58:1: warning: type of 'val' defaults to 'int' [-Wimplicit-int]
In file included from radioberry.h:18,
from radioberry.c:56:
radioberry.h:58:22: warning: implicit declaration of function 'full' [-Wimplicit-function-declaration]
58 | push(val) { assert(!full()); spi_commands[mask(p_write++)] = val; }
| ^~~~
In file included from radioberry.c:56:
radioberry.h: At top level:
radioberry.h:59:1: warning: return type defaults to 'int' [-Wimplicit-int]
59 | pop() { assert(!empty()); return spi_commands[mask(p_read++)]; }
| ^~~
In file included from radioberry.h:18,
from radioberry.c:56:
radioberry.h: In function 'pop':
radioberry.h:59:22: warning: implicit declaration of function 'empty' [-Wimplicit-function-declaration]
59 | pop() { assert(!empty()); return spi_commands[mask(p_read++)]; }
| ^~~~~
In file included from radioberry.c:56:
radioberry.h: At top level:
radioberry.h:60:1: warning: return type defaults to 'int' [-Wimplicit-int]
60 | empty() { return p_read == p_write; }
| ^~~~~
radioberry.h:61:1: warning: return type defaults to 'int' [-Wimplicit-int]
61 | full() { return size() == CAPACITY; }
| ^~~~
radioberry.h: In function 'full':
radioberry.h:61:21: warning: implicit declaration of function 'size' [-Wimplicit-function-declaration]
61 | full() { return size() == CAPACITY; }
| ^~~~
radioberry.h: At top level:
radioberry.h:62:1: warning: return type defaults to 'int' [-Wimplicit-int]
62 | size() { return p_write - p_read; }
| ^~~~
In file included from radioberry.c:57:
filters.h: In function 'initFilters':
filters.h:347:21: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration]
347 | i2c_alex_handler = ioctl(fd_i2c_alex, I2C_SLAVE, ADDR_ALEX);
| ^~~~~
radioberry.c: In function 'initRadioberry':
radioberry.c:121:2: warning: implicit declaration of function 'init_I2C_bias'; did you mean 'write_I2C_bias'? [-Wimplicit-function-declaration]
121 | init_I2C_bias();
| ^~~~~~~~~~~~~
| write_I2C_bias
radioberry.c:125:2: warning: implicit declaration of function 'pthread_create' [-Wimplicit-function-declaration]
125 | pthread_create(&pid1, NULL, packetreader, NULL);
| ^~~~~~~~~~~~~~
radioberry.c:128:2: warning: implicit declaration of function 'start_rb_control_thread' [-Wimplicit-function-declaration]
128 | start_rb_control_thread();
| ^~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:129:2: warning: implicit declaration of function 'start_rb_measure_thread' [-Wimplicit-function-declaration]
129 | start_rb_measure_thread();
| ^~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:186:2: warning: implicit declaration of function 'start_rb_register_thread' [-Wimplicit-function-declaration]
186 | start_rb_register_thread();
| ^~~~~~~~~~~~~~~~~~~~~~~~
radioberry.c: In function 'runRadioberry':
radioberry.c:200:2: warning: implicit declaration of function 'start_timer_thread' [-Wimplicit-function-declaration]
200 | start_timer_thread();
| ^~~~~~~~~~~~~~~~~~
radioberry.c: At top level:
radioberry.c:485:6: warning: conflicting types for 'start_rb_control_thread'
485 | void start_rb_control_thread() {
| ^~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:128:2: note: previous implicit declaration of 'start_rb_control_thread' was here
128 | start_rb_control_thread();
| ^~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:512:6: warning: conflicting types for 'start_rb_measure_thread'
512 | void start_rb_measure_thread() {
| ^~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:129:2: note: previous implicit declaration of 'start_rb_measure_thread' was here
129 | start_rb_measure_thread();
| ^~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:527:6: warning: conflicting types for 'start_rb_register_thread'
527 | void start_rb_register_thread() {
| ^~~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:186:2: note: previous implicit declaration of 'start_rb_register_thread' was here
186 | start_rb_register_thread();
| ^~~~~~~~~~~~~~~~~~~~~~~~
radioberry.c:542:6: warning: conflicting types for 'start_timer_thread'
542 | void start_timer_thread() {
| ^~~~~~~~~~~~~~~~~~
radioberry.c:200:2: note: previous implicit declaration of 'start_timer_thread' was here
200 | start_timer_thread();
| ^~~~~~~~~~~~~~~~~~
gcc -o radioberry register.o bias.o measure.o radioberry.o -lrt -lm -lpthread
again some warning; no errors so the firmware is build
Radioberry firmware installed.
At least i like to start a radioberry service ; so after booting your RPI you do not need to type any command; used start your SDR program.
Installing radioberry service ...
Radioberry service installed.
Created symlink /etc/systemd/system/multi-user.target.wants/radioberry.service ��� /etc/systemd/system/radioberry.service.
============================================
Radioberry software is installed!
Have fun using the SDR Radioberry
73 Johan PA3GSB
73 from Holland.
============================================
pi@raspberrypi:/tmp $
Reading the script:
You will recognize the elemensts i highlighted.
Hope this helps
73 Johan
PA3GSB