45 | but the documentation on this web page is not up to date (?\!):
46 |
47 | 1. git clone https://git.busybox.net/buildroot
48 |
49 | 2. cd buildroot
50 |
51 | 3. make raspberrypi4\_64\_defconfig
52 |
53 | fetches the Buildroot archive, and configures for the RaspberryPi4 in
54 | 64 bit mode (obviously for RPi3, select
55 | raspberrypi3\_64\_defconfig). Because Python support for
56 | GNU Radio will require the glibc library rather than the
57 | default uClibc, we must tune the default configuration
58 |
59 | 4. make menuconfig
60 |
61 | 5. Toolchain -> C library (uClibc-ng) -> glibc
62 |
63 | 6. Exit
64 |
65 | Once the proper C-library has been selected
66 |
67 | 7. make
68 |
69 | builds all tools needed for cross-compilation. This operation will take
70 | about 40 min on an 8-core 2.33 GHz Xeon CPU with fast internet connexion
71 | and require 7.4 GB of hard disk space. While compiling, Buildroot
72 | *only updates files stored* in the output
73 | directory. Thus, removing this directory (and sub-directories) will
74 | return to the original Buildroot configuration. All software related to
75 | the host computer – Intel x86/AMD64 architecture most of the time – is
76 | located in output/host, while all software related to the
77 | target (here ARM architecture) is stored in output/target.
78 | We shall not be interested in the content of the directory in which
79 | source files are stored but might have to erase some of its content to
80 | force re-compilation: such files are stored in the
81 | output/build directory. Finally, the last compilation stage
82 | will result in a complete image including bootloader, kernel, libraries
83 | and userspace applications: this file is stored in
84 | output/images.
85 |
86 | After completing buildroot compilation, we find in the
87 | output/images directory the file sdcard.img
88 | which holds the binary datastream (about 150 MB) to be stored on the
89 | microSD card holding the operating system to be run on the RPi. Here,
90 | “stored” doe not mean copying since we must clone each byte from the
91 | binary file to the storage medium. Such an operation is achieved under
92 | GNU/Linux with the Disk Dump dd command.
93 |
94 | /!\ The following line might definitely **corrupt a
95 | hard disk** if the wrong storage medium is selected. Alway
96 | **check** the name of the peripheral associated with the SD
97 | card (`dmesg | tail`) before running the dd command.
98 |
99 | The image resulting from Buildroot compilation is transfered to the
100 | microSD card with
101 |
102 |
103 |
104 | sudo dd if=output/images/sdcard.img of=/dev/sdc
105 |
106 |
107 |
108 |
109 | where we have on purpose selected the /dev/sdc peripheral
110 | name in this example since it is ever hardly used. Usually, the microSD
111 | card is accessed as /dev/sdb (second hard disk storage
112 | medium compatible with the Linux SCSI driver) or
113 | /dev/mmcblk0 (internal SD medium interface).
114 |
115 | In case a Desktop Manager or a File Manager is used, make sure the SD
116 | card is unmounted before executing dd, as these tools will
117 | interfere with the cloning process.
118 |
119 | Once the image has been flashed on the SD card, we can see two
120 | partitions: the first one is a VFAT (format compatible with Microsoft
121 | Windows) with the devicetree, the Linux kernel and the bootloader, and a
122 | second one holding the GNU/Linux userspace filesystem
123 | (rootfs).
124 |
125 | # Adding custom packages (GNU Radio and PlutoSDR/UHD
126 |
127 | So far we have compiled a standard Buildroot image without dedicated GNU
128 | Radio support. Dedicated packages not selected in the default
129 | configuration can be activated. This is achieved from the Buildroot
130 | directory with make menuconfig and selecting Target
131 | packages. Searching (“/” command as in vi) allows
132 | for quickly finding the appropriate package, such as GNU Radio.
133 |
134 | Up to now we have only worked with “official” Buildroot packages
135 | properly maintained by the Buildroot community. Some packages are not
136 | yet integrated in the official repository but can nevertheless be
137 | appended as external packages thanks to the BR2\_EXTERNAL
138 | mechanism. As an example of supporting the PlutoSDR thanks to
139 | gr-iio, this support is available thanks to the
140 | BR2\_EXTERNAL repository found at
141 | and most significantly its
142 | for\_next branch. Hence, after going to any directory out
143 | of the Buildroot source tree:
144 |
145 | 1. `git clone https://github.com/oscimp/PlutoSDR`
146 |
147 | 2. `cd PlutoSDR`
148 |
149 | 3. `git checkout for_next`
150 |
151 | 4. `source sourceme.ggm`
152 |
153 | Now that the BR2\_EXTERNAL has been cloned, the appropriate
154 | branch selected, and the environment variables set (last command),
155 | return in the Buildroot directory and make menuconfig.
156 | Running make menuconfig will now show a new menu named
157 | External options including gr-iio,
158 | libuhd or gnss-sdr.
159 |
160 | 1. `make menuconfig`
161 |
162 | 2. `/eudev`
163 |
164 | 3. Select the last item indicating
165 | BR2\_ROOTFS\_DEVICE\_CREATION\_DYNAMIC\_EUDEV and
166 | replace /dev management with Dynamic using
167 | devtmpfs + eudev
168 |
169 | 4. `/python3`
170 |
171 | 5. Select item (4) indicating BR2\_PACKAGE\_PYTHON3
172 |
173 | 6. `/gnuradio`
174 |
175 | 7. Select item (1) indicating BR2\_PACKAGE\_GNURADIO
176 |
177 | 8. Select additional GNU Radio functionalities as needed (we will need
178 | gr-zeromq support and python support)
179 |
180 | 9. `/osmosdr`
181 |
182 | 10. Select BR2\_PACKAGE\_GR\_OSMOSDR (with Python support
183 | and Osmocom RTLSDR support)
184 |
185 | 11. in External options select uhd and for the
186 | B210 b200 support and python API support,
187 |
188 | 12. in External options select gr-iio for
189 | PlutoSDR support.
190 |
191 | The resulting file will be about 550 MB, requiring increasing the
192 | configuration in .config with
193 | BR2\_TARGET\_ROOTFS\_EXT2\_SIZE="420M".
194 |
195 | Tuning the configuration prior to dd the SD card is
196 | possible by adding files in output/target, e.g. a
197 | etc/network/interfaces network configuration with a static
198 | IP for example, or copying the USRP firmware from the host PC in the
199 | usr/share/uhd/images subdirectory of
200 | output/target for these files to be available later on the
201 | target embedded board. After tuning the content of
202 | output/target, execute make in the Buildroot
203 | directory to re-build the output/images/sdcard.img file.
204 |
205 | # GNU Radio on RPi
206 |
207 | As a demonstration of the proper operation of GNU Radio on the embedded
208 | board, we generate using GNU Radio Companion on the host computer a
209 | command line interface (“No GUI”) processing flow since obviously no
210 | graphical interface is running on the embedded target, and will execute
211 | the resulting Python3 script on the Raspberry Pi. The audio stream
212 | resulting from broadcast FM demodulation will be streamed to the host PC
213 | for playing on the sound card.
214 |
215 | On the host computer, run GNU Radio Companion (as part of GNU Radio 3.8)
216 | and generate the following chart:
217 |
218 | 
219 |
220 | The generated Python script will be transfered and run on the RPi
221 | platform. Make sure to adapt the 0-MQ TCP IP address to the RPi address:
222 | the server is running on the embedded board and being a
223 | Publish-Subscribe (like UDP broadcast) configuration, any client
224 | connecting to the server running on the embedded board will be streamed
225 | the dataflow. The IP address must match the subnet of the host PC for
226 | easier routing configuration, and the port might be anything above 1024.
227 | The only constraints on this flowgraph is to achieve a final sampling
228 | rate matching the PC sound card sampling rate (here 48 kHz) following an
229 | integer decimation, here tuned with an initial sampling rate of
230 | \(48\time 24\) kS/s. The first low-pass filter selects a unique FM
231 | broadcast station while still keeping enough bandwidth (\(\geq\)200 kHz)
232 | for wideband FM demodulation, and the FM demodulator add the second
233 | decimation stage.
234 |
235 | # Communication RPi to PC
236 |
237 | After processing the raw RF (I/Q) signal collected from the FM broadcast
238 | band by the RPi, and preprocessing FM demodulation on the embedded
239 | target board, the audio stream is sent PC over 0-MQ.
240 |
241 |   Left: client
242 | flowchart, fetching a 0-MQ subscribe datastream and feeding the sound
243 | card of the host PC. Right: experimental testbed, with the RPi4
244 | connected though virtual serial port and Ethernet to the laptop PC. The
245 | RPi4 collects an I/Q stream from the DVB-T dongle tuned to an
246 | FM-broadcast station, streams the demodulated audio flow to the PC,
247 | allowing to listen to the program on the headset connected to the sound
248 | card output. Not heard on this figure is the excellent sound quality
249 | heard on the headset, demonstrating perfect functional capability of
250 | this setup.
251 |
252 | # Software development
253 |
254 | We are interested in tuning the gnss-sdr functionalities.
255 | The source code of the software has been downloaded in the
256 | output/build directory if selected and installed. The build
257 | directory for the target system is found in
258 | output/build/gnss-sdr-0.0.13/buildroot-build/ while a
259 | separate output/build/gnss-sdr-0.0.13/build allows for
260 | simultaneously testing source code modifications on the host PC. The
261 | output of compiling (make), either in
262 | buildroot-build (ARM target) or build (x86
263 | target), is found in src/main/gnss-sdr.
264 |
--------------------------------------------------------------------------------
/doc/danger.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/danger.pdf
--------------------------------------------------------------------------------
/doc/gnuradio_on_RPi_English.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/gnuradio_on_RPi_English.pdf
--------------------------------------------------------------------------------
/doc/gnuradio_on_RPi_English.tex:
--------------------------------------------------------------------------------
1 | \documentclass[a4paper]{article}
2 | \usepackage{color}
3 | \definecolor{grey}{rgb}{0.95,0.95,0.95}
4 | \definecolor{keyword}{rgb}{0,0,0.95}
5 | \definecolor{comment}{rgb}{0.95,0,0}
6 | \definecolor{string}{rgb}{0,0.65,00.65}
7 |
8 | \usepackage{listings}
9 | \lstset{backgroundcolor=\color{grey},
10 | language=C,
11 | numbers=left,
12 | numbersep=6pt,
13 | basicstyle=\small\ttfamily,
14 | extendedchars=true,
15 | tabsize=3,
16 | keywordstyle=\color{keyword}\bfseries,
17 | commentstyle=\color{comment},
18 | stringstyle=\color{string}\itshape,
19 | columns=fullflexible,
20 | keepspaces=true,
21 | }
22 | \usepackage{fullpage,graphicx,url}
23 | \begin{document}
24 | \begin{center}
25 | {\bf\Large Buildroot for cross-compiling GNU Radio to embedded boards}\\
26 | \today
27 | \end{center}
28 | The Raspberry Pi\{3,4\} (RPi) is a single board computer designed -- for the characteristics
29 | we are interested in for Software Defined Radio applications -- around a
30 | quad-core ARM processor clocked at 1.5~GHz with 1, 2 or 4~GB random access memory.
31 | The operating system is stored on a microSD card and is hence easily updated
32 | from the host computer (never {\em ever} compile on the target embedded board). Generating
33 | a dedicated toolchain -- as opposed to using a readily available binary distribution --
34 | allows for optimizing instructions for the chipset available on the targeted platform.
35 |
36 | Our objective is to {\bf execute GNU Radio on the RPi} in order to run some
37 | pre-processing on the embedded board before sending the processing result to
38 | the PC (e.g. receiving a broadcast FM station on the RPi and send the audio
39 | output to the PC through a Zero-MQ link).
40 |
41 | \section{Buildroot for RPi}
42 |
43 | Buildroot is a framework providing a consistent set of
44 | \begin{itemize}
45 | \item cross-compilation toolchain for the host (usually Intel x86/AMD64 processor)
46 | \item libraries and userspace applications for the ARM target,
47 | \item Linux kernel for the target,
48 | \item bootloader for embedded target board initialization in order to load the Linux
49 | kernel in charge of supervizing userspace applications.
50 | \end{itemize}
51 |
52 | This consistency avoids many pitfalls when cross-compiling target applications
53 | or kernel modules on the host. Obviously the low-computational power target is
54 | {\em not} designed for intensive computational load such as compiling GNU Radio, and
55 | {\tt gcc} should actually not even be available on the target, neither is the SD
56 | card with its finite number of write cycles designed for large compilation (at least
57 | make {\tt /tmp/} a RAM filesystem if trying such a compiltion on the target).
58 |
59 | Installing the result of Buildroot cross-compilation on the Raspberry Pi4 is
60 | described at \url{https://github.com/buildroot/buildroot/tree/master/board/raspberrypi} but
61 | the documentation on this web page is not up to date (?!):
62 | \begin{enumerate}
63 | \item {\tt git clone https://git.busybox.net/buildroot}
64 | \item {\tt cd buildroot}
65 | \item {\tt make raspberrypi4\_64\_defconfig}
66 | \end{enumerate}
67 | fetches the Buildroot archive, and configures for the RaspberryPi4 in 64~bit mode (obviously
68 | for RPi3, select {\tt raspberrypi3\_64\_defconfig}).
69 | Because Python support for GNU Radio will require the {\tt glibc} library rather than the default
70 | {\tt uClibc}, we must tune the default configuration
71 | \begin{enumerate}
72 | \setcounter{enumi}{3}
73 | \item {\tt make menuconfig}
74 | \item Toolchain $\rightarrow$ C library (uClibc-ng) $\rightarrow$ glibc
75 | \item Exit
76 | \end{enumerate}
77 |
78 | Once the proper C-library has been selected
79 | \begin{enumerate}
80 | \setcounter{enumi}{6}
81 | \item {\tt make}
82 | \end{enumerate}
83 | builds all tools
84 | needed for cross-compilation. This operation will take about 40~min on an 8-core 2.33~GHz Xeon
85 | CPU with fast internet connexion and require 7.4~GB of hard disk space. While compiling,
86 | Buildroot {\em only updates files stored} in the
87 | {\tt output} directory. Thus, removing this directory (and sub-directories) will return to
88 | the original Buildroot configuration. All software related to the host computer -- Intel x86/AMD64
89 | architecture most of the time -- is located in {\tt output/host}, while all software related
90 | to the target (here ARM architecture) is stored in {\tt output/target}. We shall not be
91 | interested in the content of the directory in which source files are stored but might have
92 | to erase some of its content to force re-compilation: such files are stored in the {\tt output/build}
93 | directory. Finally, the last compilation stage will result in a complete image including bootloader,
94 | kernel, libraries and userspace applications: this file is stored in {\tt output/images}.
95 |
96 | After completing buildroot compilation, we find in the {\tt output/images} directory
97 | the file {\tt sdcard.img} which
98 | holds the binary datastream (about 150~MB) to be stored on the microSD card holding the
99 | operating system to
100 | be run on the RPi. Here, ``stored'' doe not mean copying since we must clone each byte from
101 | the binary file to the storage medium. Such an operation is achieved under GNU/Linux with the
102 | Disk Dump {\tt dd} command.
103 |
104 | \includegraphics[width=.7cm]{danger}
105 | The following line might definitely {\bf corrupt a hard disk} if the wrong storage
106 | medium is selected. Alway {\bf check} the name of the peripheral associated with
107 | the SD card (\verb~dmesg | tail~) before running the {\tt dd} command.
108 |
109 | The image resulting from Buildroot compilation is transfered to the microSD card with\\
110 | \colorbox{white}{\begin{minipage}{0.9\textwidth}
111 | sudo dd if=output/images/sdcard.img of=/dev/sdc
112 | \end{minipage}} \\
113 | where we have on purpose selected the {\tt /dev/sdc} peripheral name in this example
114 | since it is ever hardly used. Usually, the microSD card is accessed as {\tt /dev/sdb}
115 | (second hard disk storage medium compatible with the Linux SCSI driver)
116 | or {\tt /dev/mmcblk0} (internal SD medium interface).
117 |
118 | In case a Desktop Manager or a File Manager is used, make sure the SD card is unmounted
119 | before executing {\tt dd}, as these tools will interfere with the cloning process.
120 |
121 | \noindent\fbox{\parbox{\linewidth}{
122 | \includegraphics[width=.7cm]{danger} %\danger
123 | {\bf Warning}: the content of the SD card, or any storage medium associated with
124 | the last argument of this command, will be {\bf definitely} lost. Make sure, double check,
125 | the name of the peripheral on which the Buildroot image will be stored.}}
126 |
127 | Once the image has been flashed on the SD card, we can see two partitions: the first one
128 | is a VFAT (format compatible with Microsoft Windows) with the devicetree, the Linux
129 | kernel and the bootloader, and a second one holding the GNU/Linux userspace filesystem
130 | ({\tt rootfs}).
131 |
132 | This basic image is missing basic functionalities such as secure network connection over
133 | {\tt ssh} or text editing on the remote target. We find most convenient to activate
134 | {\tt Target Packages}$\rightarrow${\tt Text editors and viewers}$\rightarrow${\tt nano} as
135 | text editor, {\tt Target Packages}$\rightarrow${\tt Shell and utilities}$\rightarrow${\tt screen}
136 | and {\tt Target Packages}$\rightarrow${\tt Networking applications}$\rightarrow${\tt dropbear}
137 | as {\tt ssh} server. Since Dropbear expects a password when logging in the target system,
138 | we must define the {\tt root} password (and not leave it empty as is the default configuration)
139 | using {\tt System configuration}$\rightarrow${\tt Root password}
140 |
141 | \section{Adding packages (GNU Radio)}
142 |
143 | So far we have compiled a standard Buildroot image without dedicated GNU Radio support.
144 | Dedicated packages not selected in the default configuration can be activated. This is
145 | achieved from the Buildroot directory with {\tt make menuconfig} and selecting {\tt Target
146 | packages}. Searching (``/'' command as in {\tt vi}) allows for quickly finding the appropriate
147 | package, such as GNU Radio.
148 |
149 | \begin{enumerate}
150 | \item \verb~make menuconfig~
151 | \item \verb~/eudev~
152 | \item Select the last item indicating {\tt BR2\_ROOTFS\_DEVICE\_CREATION\_DYNAMIC\_EUDEV} and
153 | replace {\tt /dev management} with {\tt Dynamic using devtmpfs + eudev}
154 | \item \verb~/python3~
155 | \item Select item (4) indicating {\tt BR2\_PACKAGE\_PYTHON3}
156 | \item \verb~/gnuradio~
157 | \item Select item (1) indicating {\tt BR2\_PACKAGE\_GNURADIO}
158 | \item Select additional GNU Radio functionalities as needed (we will need {\tt gr-zeromq support}
159 | and {\tt python support})
160 | \item \verb~/osmosdr~
161 | \item Select {\tt BR2\_PACKAGE\_GR\_OSMOSDR} (with Python support and Osmocom RTLSDR support)
162 | \end{enumerate}
163 |
164 | The resulting file will be about 550~MB, requiring increasing the configuration in {\tt .config}
165 | with {\tt BR2\_TARGET\_ROOTFS\_EXT2\_SIZE="1000M"}.
166 |
167 | Tuning the configuration prior to {\tt dd} the SD card is possible by adding files
168 | in {\tt output/target}, e.g. a {\tt etc/network/interfaces} network configuration with
169 | a static IP for example, or copying the USRP firmware from the host PC in the
170 | {\tt usr/share/uhd/images} subdirectory of {\tt output/target} for these files to be
171 | available later on the target embedded board. After tuning the content of {\tt output/target},
172 | execute {\tt make} in the Buildroot directory to re-build the {\tt output/images/sdcard.img}
173 | file.
174 |
175 | Finally, a graphical display of Python processing results can be activated using
176 | {\tt matplotlib} which depends on Qt5: first activate {\tt BR2\_PACKAGE\_QT5} (accessible
177 | from {\tt Graphic libraries and applications} in {\tt Target packages}): now the
178 | {\tt qt display} option from {\tt python-matplotlib} in {\tt External python modules} is
179 | active and both should be selected.
180 |
181 | \section{Adding custom packages (gnss-sdr, PlutoSDR/UHD)}
182 |
183 | Up to now we have only worked with ``official'' Buildroot packages properly maintained by
184 | the Buildroot community. Some packages are not yet integrated in the official repository
185 | but can nevertheless be appended as external packages thanks to the {\tt BR2\_EXTERNAL}
186 | mechanism. As an example of supporting the PlutoSDR thanks to {\tt gr-iio}, this support
187 | is available thanks to the {\tt BR2\_EXTERNAL} repository found at
188 | \url{https://github.com/oscimp/PlutoSDR} and most significantly its {\tt for\_next} branch.
189 | Hence, after going to any directory out of the Buildroot source tree:
190 | \begin{enumerate}
191 | \item \verb~git clone https://github.com/oscimp/PlutoSDR~
192 | \item \verb~cd PlutoSDR~
193 | \item \verb~git checkout for_next~
194 | \item \verb~source sourceme.ggm~
195 | \end{enumerate}
196 |
197 | Now that the {\tt BR2\_EXTERNAL} has been cloned, the appropriate branch selected, and the
198 | environment variables set (last command), return to the Buildroot directory and
199 | {\tt make menuconfig}. Running {\tt make menuconfig} will now show a new menu named
200 | {\tt External options} including
201 | {\tt gr-iio}, {\tt libuhd}:
202 | \begin{itemize}
203 | \item in {\tt External options} select {\tt uhd} and for the B210 {\tt b200 support} and
204 | {\tt python API support},
205 | \item in {\tt External options} select {\tt gr-iio} for PlutoSDR support.
206 | \end{itemize}
207 |
208 | Including {\tt gnss-sdr} requires activating Fortran in the Toolchain options for compiling
209 | Lapack which as needed for Armadillo, a dependence to {\tt gnss-sdr} ({\tt clapack} will not work
210 | with {\tt gnss-sdr}).
211 |
212 | Controlling the Raspberry Pi 4 GPIO is most easily achieved using the PiGPIO library, whose
213 | functioalitities are activated by setting {\tt PIGPIO} and {\tt PYTHON3\_PIGPIO} for calling
214 | from Python3 scripts.
215 |
216 | \section{GNU Radio on RPi}
217 |
218 | As a demonstration of the proper operation of GNU Radio on the embedded board, we
219 | generate using GNU Radio Companion on the host computer a command line interface (``No GUI'') processing flow
220 | since obviously no graphical interface is running on the embedded target, and will execute
221 | the resulting Python3 script on the Raspberry Pi. The audio stream resulting from broadcast
222 | FM demodulation will be streamed to the host PC for playing on the sound card.
223 |
224 | On the host computer, run GNU Radio Companion (as part of GNU Radio 3.8) and generate
225 | the following chart:
226 |
227 | \includegraphics[width=\linewidth]{target}
228 |
229 | The generated Python script will be transfered and run on the RPi platform. Make sure
230 | to adapt the 0-MQ TCP IP address to the RPi address: the server is running on the embedded board
231 | and being a Publish-Subscribe (like UDP broadcast) configuration, any client connecting to
232 | the server running on the embedded board will be streamed the dataflow. The IP address must
233 | match the subnet of the host PC for easier routing configuration, and the port might be
234 | anything above 1024. The only constraints on this flowgraph is to achieve a final sampling
235 | rate matching the PC sound card sampling rate (here 48~kHz) following an integer decimation,
236 | here tuned with an initial sampling rate of $48\time 24$~kS/s. The first low-pass filter selects
237 | a unique FM broadcast station while still keeping enough bandwidth ($\geq$200~kHz) for
238 | wideband FM demodulation, and the FM demodulator add the second decimation stage.
239 |
240 | \section{Communication RPi to PC}
241 |
242 | After processing the raw RF (I/Q) signal collected from the FM broadcast band
243 | by the RPi,
244 | and preprocessing FM demodulation on the embedded target board, the audio stream is
245 | sent PC over 0-MQ.
246 |
247 | \begin{center}
248 | \includegraphics[width=.65\linewidth]{host}
249 | \includegraphics[width=.33\linewidth]{IMG_20200527_211928small.jpg}
250 | \footnotesize{Left: client flowchart, fetching a 0-MQ subscribe datastream and feeding
251 | the sound card of the host PC. Right: experimental testbed, with the RPi4 connected
252 | though virtual serial port and Ethernet to the laptop PC. The RPi4 collects an I/Q stream
253 | from the DVB-T dongle tuned to an FM-broadcast station, streams the demodulated audio
254 | flow to the PC, allowing to listen to the program on the headset connected to the sound card
255 | output. Not heard on this figure is the excellent sound quality heard on the headset, demonstrating
256 | perfect functional capability of this setup.}
257 | \end{center}
258 |
259 | \section{Software development}
260 |
261 | We are interested in tuning the {\tt gnss-sdr} functionalities. The source code of
262 | the software has been downloaded in the {\tt output/build} directory if
263 | selected and installed. The build directory
264 | for the target system is found in \\
265 | {\tt output/build/gnss-sdr-0.0.12/buildroot-build/}
266 | \\while
267 | a separate {\tt output/build/gnss-sdr-0.0.12/build} allows for simultaneously testing source
268 | code modifications on the host PC. The output of compiling ({\tt make}), either in
269 | {\tt buildroot-build} (ARM target) or {\tt build} (x86 target), is found in {\tt
270 | src/main/gnss-sdr}.
271 | \end{document}
272 |
--------------------------------------------------------------------------------
/doc/gnuradio_sur_RPi4_Francais.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/gnuradio_sur_RPi4_Francais.pdf
--------------------------------------------------------------------------------
/doc/gnuradio_sur_RPi4_Francais.tex:
--------------------------------------------------------------------------------
1 | \documentclass[a4paper]{article}
2 | \usepackage{color}
3 | \definecolor{grey}{rgb}{0.95,0.95,0.95}
4 | \definecolor{keyword}{rgb}{0,0,0.95}
5 | \definecolor{comment}{rgb}{0.95,0,0}
6 | \definecolor{string}{rgb}{0,0.65,00.65}
7 |
8 | \usepackage{listings}
9 | \lstset{backgroundcolor=\color{grey},
10 | language=C,
11 | numbers=left,
12 | numbersep=6pt,
13 | basicstyle=\small\ttfamily,
14 | extendedchars=true,
15 | tabsize=3,
16 | keywordstyle=\color{keyword}\bfseries,
17 | commentstyle=\color{comment},
18 | stringstyle=\color{string}\itshape,
19 | columns=fullflexible,
20 | keepspaces=true,
21 | }
22 |
23 | \usepackage[french]{babel}
24 |
25 | \usepackage{fullpage,graphicx,url}
26 | \begin{document}
27 | \begin{center}
28 | {\bf\Large Buildroot pour la compilation crois\'ee de GNU Radio pour plateformes
29 | embarqu\'ees}
30 | \end{center}
31 |
32 | La Raspberry Pi \{3,4\} (RPi) est un ordinateur architectur\'e (pour les
33 | caract\'eristiques nous int\'eressant en radio logicielle) autour
34 | d'un processeur quad-c\oe urs ARM cadenc\'es \`a 1,5~GHz avec 1,2 ou 4~GB
35 | de m\'emoire volatile. Le syst\`eme d'exploitation est stock\'e sur
36 | carte uSD et sera donc simple \`a mettre \`a jour depuis un ordinateur (ne
37 | {\em jamais} compiler sur la cible embarqu\'ee). La g\'en\'eration d'une cha\^\i ne
38 | de compilation d\'edi\'ee -- contrairement \`a l'utilisation d'une distribution
39 | binaire -- permet d'optimiser le jeu d'instructions pour le processeur sp\'ecifique
40 | \`a la cible consid\'er\'ee.
41 |
42 | Notre objectif va \^etre d'{\bf ex\'ecuter GNU Radio sur RPi4} en vue d'effectuer
43 | un certain nombre de traitements sur la plateforme embarqu\'ee avant d'en envoyer
44 | le r\'esultat vers le PC (exemple~: recevoir une station FM sur la RPi et envoyer
45 | par une communication Zero-MQ le signal audio vers le PC).
46 |
47 | \section{Buildroot pour RPi}
48 |
49 | Buildroot est un environnement fournissant un ensemble coh\'erent de
50 | \begin{itemize}
51 | \item cha\^\i ne de compilation crois\'ee sur l'h\^ote ({\em host} Intel x86)
52 | \item biblioth\`eques et applications en espace utilisateur sur la cible ({\em target} ARM)
53 | \item noyau Linux sur la cible
54 | \item {\em bootloader} (s\'equence de d\'emarrage) pour initialiser le processeur et
55 | ses p\'eriph\'eriques sur la cible en vue de charger le noyau Linux qui supervisera les
56 | applications en espace utilisateur.
57 | \end{itemize}
58 |
59 | Cette coh\'erence \'evite bien des d\'eboires lors de la compilation sur l'h\^ote d'applications
60 | ou module noyau pour la cible (on ne compile {\bf jamais} sur la cible de ressources r\'eduites
61 | et dont la vocation est de contr\^oler un syst\`eme embarqu\'e et non d'\^etre muni d'un compilateur
62 | aussi lourd et complexe que {\tt gcc}).
63 |
64 | Pour installer Buildroot sur Raspberry Pi 4, tel que d\'ecrit \`a
65 | \url{https://github.com/buildroot/buildroot/tree/master/board/raspberrypi} mais la
66 | documentation de cette page n'est pas \`a jour (?!)~:
67 | \begin{enumerate}
68 | \item {\tt git clone https://github.com/buildroot/buildroot}
69 | \item {\tt cd buildroot}
70 | \item {\tt make raspberrypi4\_64\_defconfig}
71 | \end{enumerate}
72 | qui r\'ecup\`ere l'arborescence de Buildroot, et la configure pour la RaspberryPi4 en mode 64~bits (pour
73 | la RPi3, s\'electionner {\tt raspberrypi3\_64\_defconfig}). Puisque le support Python de GNU Radio n\'ecessitera
74 | la biblioth\`eque {\tt glibc} au lieu de {\tt uClibc} s\'electionn\'ee par d\'efaut, nous ajustons la
75 | configuration initiale par
76 | \begin{enumerate}
77 | \setcounter{enumi}{3}
78 | \item {\tt make menuconfig}
79 | \item Toolchain $\rightarrow$ C library (uClibc-ng) $\rightarrow$ glibc
80 | \item Exit
81 | \end{enumerate}
82 | Une fois la bonne biblioth\`eque s\'electionn\'ee
83 | \begin{enumerate}
84 | \setcounter{enumi}{6}
85 | \item {\tt make}
86 | \end{enumerate}
87 | compile l'ensemble des outils. Cette op\'eration prend environ 40~minutes sur un processeur Xeon \`a 8 c\oe urs
88 | cadenc\'es \`a 2,33~GHz avec une connexion internet rapide, et occupe environ 7.4~GB sur le disque dur.
89 | Au cours de la compilation, Buildroot n'affecte {\em que les fichiers contenus
90 | dans le r\'epertoire} {\tt output}. Ainsi, effacer ce r\'epertoire (et ses sous-r\'epertoires)
91 | permet de repartir d'une version propre de Buildroot. Dans {\tt output}, tout ce qui est
92 | relatif \`a l'h\^ote x86 se trouve dans {\tt host}, tout ce qui est relatif \`a la cible dans
93 | {\tt target}. Nous n'aurons pas ici besoin de regarder le contenu du r\'epertoire contenant
94 | les sources des outils compil\'es mais serons susceptibles d'en effacer certains contenus pour
95 | en forcer la recompilation dans {\tt build}. Enfin pour ce qui nous int\'eresse maintenant,
96 | le r\'esultat de la compilation se trouve dans {\tt images}.
97 |
98 | Dans ce r\'epertoire {\tt output/images}, nous trouvons {\tt sdcard.img} qui est l'image
99 | \`a transf\'erer sur la carte uSD en vue d'en ex\'ecuter le contenu sur RPi. Ici,
100 | ``transf\'erer'' ne signifie par copier car nous devons \'ecrire octet par octet le
101 | contenu du fichier .img sur la carte. Cette op\'eration est prise en charge sous GNU/Linux
102 | par {\tt dd}.
103 |
104 | \includegraphics[width=.7cm]{danger}
105 | La ligne qui va suivre peut {\bf corrompre le disque dur} si le
106 | mauvais p\'eriph\'erique est s\'electionn\'e. Toujours {\bf v\'erifier} le
107 | nom du p\'eriph\'erique associ\'e \`a la carte SD (\verb~dmesg | tail~) avant
108 | de lancer la commande {\tt dd}.
109 |
110 | L'image r\'esultant de la compilation est transf\'er\'ee sur la carte SD par\\
111 | \colorbox{white}{\begin{minipage}{0.9\textwidth}
112 | sudo dd if=output/images/sdcard.img of=/dev/sdc
113 | \end{minipage}} \\
114 | o\`u nous avons volontairement choisi le p\'eriph\'erique {\tt /dev/sdc} dans cet
115 | exemple car rarement utilis\'e~: en pratique, la carte SD sera souvent
116 | nomm\'ee {\tt /dev/sdb} (second disque dur compatible avec le pilote SCSI de
117 | Linux) ou {\tt /dev/mmcblk0} (cas du lecteur SD interne).
118 |
119 | En cas d'utilisation d'un gestionnaire de fichiers ou de bureau, bien v\'erifier
120 | que la carte SD n'est pas prise en charge par ces outils ({\em eject}) qui risquent
121 | d'interf\'erer avec {\tt dd}.
122 |
123 | \noindent\fbox{\parbox{\linewidth}{
124 | \includegraphics[width=.7cm]{danger} %\danger
125 | {\bf Attention}~: le contenu de la
126 | carte SD, ou de tout support point\'e par le dernier argument de cette
127 | commande, sera {\bf irr\'em\'ediablement} perdu. V\'erifier \`a deux fois le
128 | nom du p\'eriph\'erique cible de l'image issue de buildroot.}}
129 |
130 | Une fois l'image flash\'ee sur la carte SD, nous constaterons deux partitions~: une
131 | premi\`ere en VFAT (format compatible Microsoft Windows) avec le devicetree, le noyau
132 | Linux et le bootloader, et une seconde partition contenant le syst\`eme GNU/Linux ({\tt
133 | rootfs})
134 |
135 | \section{Ajouter des packages~: {\tt BR2\_EXTERNAL}}
136 |
137 | Pour le moment nous avons compil\'e une image standard Buildroot sans support de
138 | GNU Radio. Ces paquets d\'edi\'es ne sont pas s\'electionn\'es par d\'efaut mais
139 | peuvent \^etre activ\'es. Pour ce faire, ex\'ecuter dans le r\'epertoire de Buildroot
140 | la commande {\tt make menuconfig} et s\'electionner {\tt Target
141 | packages}. La recherche (``/'' comme dans {\tt vi}) permet de facilement trouver l'emplacement
142 | d'un paquet, par exemple GNU Radio.
143 |
144 | Jusqu'ici nous n'avons travaill\'e qu'avec les paquets Buildroot ``officiels'' maintenus
145 | par la communaut\'e des d\'eveloppeurs de Buildroot. Certains paquets ne sont pas encore
146 | int\'egr\'es sur le site officiel mais peuvent n\'eanmoins compl\'eter l'installation
147 | en cours gr\^ace au m\'ecanisme de {\tt BR2\_EXTERNAL}. Un exemple est le support
148 | de la PlutoSDR gr\^ace \`a {\tt gr-iio}, qui est fourni dans le d\'ep\^ot {\tt BR2\_EXTERNAL}
149 | disponible \`a \url{https://github.com/oscimp/PlutoSDR} et plus sp\'ecifiquement dans la branche
150 | {\tt for\_next}. Ainsi, apr\`es \^etre sorti du r\'epertoire Buildroot pour cr\'eer une nouvelle
151 | arborescence~:
152 | \begin{enumerate}
153 | \item \verb~git clone https://github.com/oscimp/PlutoSDR~
154 | \item \verb~cd PlutoSDR~
155 | \item \verb~git checkout for_next~
156 | \item \verb~source sourceme.ggm~
157 | \end{enumerate}
158 |
159 | Maintenant que le d\'ep\^ot {\tt BR2\_EXTERNAL} a \'et\'e t\'el\'echarg\'e, la branche
160 | appropri\'ee s\'electionn\'ee, et les variables d'environnement d\'efinies (derni\`ere commande),
161 | retourner dans le r\'epertoire de Buildroot et
162 | {\tt make menuconfig}. L'ex\'ecution de {\tt make menuconfig} donne maintenant acc\`es \`a un nouveau menu
163 | {\tt External options} qui inclut
164 | {\tt gr-iio}, {\tt libuhd} ou {\tt gnss-sdr}.
165 |
166 | \begin{enumerate}
167 | \item \verb~make menuconfig~
168 | \item \verb~/eudev~
169 | \item S\'electionner la derni\`ere option indiqu\'ee par {\tt BR2\_ROOTFS\_DEVICE\_CREATION\_DYNAMIC\_EUDEV} et
170 | remplacer {\tt /dev management} par {\tt Dynamic using devtmpfs + eudev}
171 | \item \verb~/python3~
172 | \item S\'electionner l'option (4) indiqu\'ee par {\tt BR2\_PACKAGE\_PYTHON3}
173 | \item \verb~/gnuradio~
174 | \item S\'electionner l'option (1) indiqu\'ee par {\tt BR2\_PACKAGE\_GNURADIO}
175 | \item S\'electionner les options additionnelles de GNU Radio selon les besoins (nous aurons besoin
176 | de {\tt gr-zeromq support} et {\tt python support})
177 | \item \verb~/osmosdr~
178 | \item S\'electionner {\tt BR2\_PACKAGE\_GR\_OSMOSDR} (avec support Python et support Osmocom RTLSDR)
179 | \item dans {\tt External options} s\'electionner {\tt uhd} et pour la B210 {\tt b200 support} et
180 | {\tt python API support},
181 | \item dans {\tt External options} s\'electionner {\tt gr-iio} si la PlutoSDR est utilis\'ee.
182 | \end{enumerate}
183 |
184 | Le fichier r\'esultant fera environ 550~MB, n\'ecessitant d'augmenter la taille disponible dans {\tt .config}
185 | par {\tt BR2\_TARGET\_ROOTFS\_EXT2\_SIZE="420M"}.
186 |
187 | Nous pouvons ajuster la configuration avant de {\tt dd} l'image sur la carte SD en ajoutant des fichiers
188 | dans {\tt output/target}, par exemple une configuration statique du r\'eseau dans {\tt etc/network/interfaces},
189 | ou copier les {\em firmware} des USRPs depuis le PC h\^ote dans le sous r\'epertoire {\tt usr/share/uhd/images}
190 | de {\tt output/target} afin que ces fichiers soient ult\'erieurement disponibles sur la cible embarqu\'ee. Une fois
191 | le contenu de {\tt output/target} convenablement ajust\'e, retourner dans le r\'epertoire racine de Buildroot
192 | et ex\'ecuter {\tt make} pour r\'eg\'en\'erer le fichier {\tt output/images/sdcard.img}.
193 |
194 | \section{GNU Radio sur RPi}
195 |
196 | \`A titre d'illustration de la fa\c con que nous abordons d'utiliser GNU Radio sur plateforme
197 | embarqu\'ee, nous g\'en\'erons en utilisant GNU Radio Companion sur le PC une application
198 | en ligne de commande (``No GUI'') puisque \'evidemment aucune interface graphique ne devrait
199 | \^etre disponible sur la cible embarqu\'ee. Le script Python3 r\'esultant sera ex\'ecut\'e sur
200 | la RPi. Le flux audio-fr\'equence r\'esultant de la d\'emodulation du signal de la bande FM
201 | commerciale sera transmis au PC pour \^etre jou\'e sur la carte son.
202 |
203 | Sur le PC, lancer GNU Radio Companion (fourni par GNU Radio 3.8) et g\'en\'erer la cha\^\i ne
204 | de traitement suivante~:
205 |
206 | \includegraphics[width=\linewidth]{target}
207 |
208 | Le script Python ainsi g\'en\'er\'e est transf\'er\'e \`a la RPi. Bien prendre soin
209 | d'adapter l'adresse IP de la liaison TCP sur 0-MQ \`a l'adresse de la RPi~: le serveur
210 | est ex\'ecut\'e sur la plateforme embarqu\'ee et en utilisant une liaison de type
211 | Publish-Subscribe (s'apparentant \`a une liaison UDP), tout client se connectant au serveur
212 | ex\'ecut\'e sur la cible embarqu\'ee peut recevoir le flux de donn\'ees. L'adresse IP
213 | se incluse id\'ealement dans le sous-r\'eseau du PC pour simplifier la configuration
214 | du routage, tandis que le port peut \^etre toute valeur au dessus de 1024. La seule
215 | contrainte sur cette cha\^\i ne de traitement est d'aboutir \`a la fin \`a une
216 | fr\'equence d'\'echantillonnage \'egale \`a une valeur compatible avec la cartes son du
217 | PC (ici 48~kHz) apr\`es une s\'equence de d\'ecimations par des facteurs entiers
218 | s\'electionn\'ee ici par le choix d'une fr\'equence d'\'echantillonnage initiale de
219 | $48\time 24$~kS/s. Le premier filtre passe-bas s\'electionne une unique station FM
220 | tout en gardant assez de bande passante ($\geq$200~kHz) pour la d\'emodulation FM
221 | \`a bande large, et le d\'emodulateur FM ajoute un second \'etage de d\'ecimation.
222 |
223 | \section{Communication RPi vers PC}
224 |
225 | Apr\`es traitement des donn\'ees radiofr\'equences brutes (I/Q) acquises sur la bande
226 | FM commerciale par la RPi, et avoir pr\'e-trait\'e le signal FM sur la plateforme
227 | embarqu\'ee, le flux audio-fr\'equence est transmis vers le PC par 0-MQ.
228 |
229 | \begin{center}
230 | \includegraphics[width=.59\linewidth]{host}
231 | \includegraphics[width=.39\linewidth]{IMG_20200527_211928small.jpg}
232 | \footnotesize{Gauche~: cha\^\i ne de traitement du client, qui r\'ecup\`ere un flux au format
233 | {\em subscribe} de 0-MQ et alimente la carte son du PC. Droite~: montage exp\'erimental,
234 | avec une RPi4 connect\'ee par un port s\'erie virtuel et par Ethernet au PC portable. La
235 | RPi4 \'echantillonne le flux de coefficients I/Q du r\'ecepteur de t\'el\'evision num\'erique
236 | terrestre utilis\'e comme source de radio logicielle en ajustant sa fr\'equence dans la bande
237 | FM, et transmet le flux audio-fr\'equence apr\`es d\'emodulation au PC, permettant d'\'ecouter
238 | le programme gr\^ace \`a un casque connect\'e \`a la sortie de la carte son. Cette figure ne
239 | permet pas d'illustrer l'excellente qualit\'e audio entendue \`a la sortie de la carte son,
240 | d\'emontrant le bon fonctionnement de ce montage.}
241 | \end{center}
242 |
243 | \section{D\'eveloppements logiciels}
244 |
245 | Nous nous int\'eressons \`a modifier les fonctionnalit\'es de {\tt gnss-sdr}. Le code source
246 | de ce logiciel a \'et\'e t\'el\'echarg\'e et plac\'e dans le r\'epertoire {\tt output/build} lors
247 | de sa s\'election et installation. Le r\'epertoire de compilation pour la cible se trouve
248 | \`a {\tt output/build/gnss-sdr-0.0.12/buildroot-build/} tandis qu'un r\'epertoire s\'epar\'e
249 | {\tt output/build/gnss-sdr-0.0.12/build} permet de simultan\'ement tester les modifications aux
250 | codes sources sur le PC h\^ote. Le r\'esultat de la compilation ({\tt make}), soit dans
251 | {\tt buildroot-build} (cible ARM) ou {\tt build} (cible x86), se trouve dans {\tt
252 | src/main/gnss-sdr}.
253 | \end{document}
254 |
--------------------------------------------------------------------------------
/doc/host.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/host.pdf
--------------------------------------------------------------------------------
/doc/host.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/host.png
--------------------------------------------------------------------------------
/doc/movie_FM_to_0MQstream.ogv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/movie_FM_to_0MQstream.ogv
--------------------------------------------------------------------------------
/doc/picture.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/picture.jpg
--------------------------------------------------------------------------------
/doc/pluto_embedded.grc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Tue Dec 4 18:43:20 2018
5 |
6 | options
7 |
8 | author
9 |
10 |
11 |
12 | window_size
13 |
14 |
15 |
16 | category
17 | [GRC Hier Blocks]
18 |
19 |
20 | comment
21 |
22 |
23 |
24 | description
25 |
26 |
27 |
28 | _enabled
29 | True
30 |
31 |
32 | _coordinate
33 | (8, 12)
34 |
35 |
36 | _rotation
37 | 0
38 |
39 |
40 | generate_options
41 | no_gui
42 |
43 |
44 | hier_block_src_path
45 | .:
46 |
47 |
48 | id
49 | top_block
50 |
51 |
52 | max_nouts
53 | 0
54 |
55 |
56 | qt_qss_theme
57 |
58 |
59 |
60 | realtime_scheduling
61 |
62 |
63 |
64 | run_command
65 | {python} -u {filename}
66 |
67 |
68 | run_options
69 | prompt
70 |
71 |
72 | run
73 | True
74 |
75 |
76 | sizing_mode
77 | fixed
78 |
79 |
80 | thread_safe_setters
81 |
82 |
83 |
84 | title
85 |
86 |
87 |
88 | placement
89 | (0,0)
90 |
91 |
92 |
93 | variable
94 |
95 | comment
96 |
97 |
98 |
99 | _enabled
100 | True
101 |
102 |
103 | _coordinate
104 | (280, 12)
105 |
106 |
107 | _rotation
108 | 0
109 |
110 |
111 | id
112 | freq
113 |
114 |
115 | value
116 | int(96.9e6)
117 |
118 |
119 |
120 | variable
121 |
122 | comment
123 |
124 |
125 |
126 | _enabled
127 | True
128 |
129 |
130 | _coordinate
131 | (184, 12)
132 |
133 |
134 | _rotation
135 | 0
136 |
137 |
138 | id
139 | samp_rate
140 |
141 |
142 | value
143 | 48000*24
144 |
145 |
146 |
147 | analog_sig_source_x
148 |
149 | amp
150 | 1
151 |
152 |
153 | alias
154 |
155 |
156 |
157 | comment
158 |
159 |
160 |
161 | affinity
162 |
163 |
164 |
165 | _enabled
166 | 0
167 |
168 |
169 | freq
170 | 50000
171 |
172 |
173 | _coordinate
174 | (200, 88)
175 |
176 |
177 | _rotation
178 | 0
179 |
180 |
181 | id
182 | analog_sig_source_x_0
183 |
184 |
185 | maxoutbuf
186 | 0
187 |
188 |
189 | minoutbuf
190 | 0
191 |
192 |
193 | offset
194 | 0
195 |
196 |
197 | type
198 | complex
199 |
200 |
201 | samp_rate
202 | samp_rate
203 |
204 |
205 | waveform
206 | analog.GR_COS_WAVE
207 |
208 |
209 |
210 | analog_wfm_rcv
211 |
212 | audio_decimation
213 | 8
214 |
215 |
216 | alias
217 |
218 |
219 |
220 | comment
221 |
222 |
223 |
224 | affinity
225 |
226 |
227 |
228 | _enabled
229 | True
230 |
231 |
232 | _coordinate
233 | (416, 272)
234 |
235 |
236 | _rotation
237 | 0
238 |
239 |
240 | id
241 | analog_wfm_rcv_0
242 |
243 |
244 | maxoutbuf
245 | 0
246 |
247 |
248 | minoutbuf
249 | 0
250 |
251 |
252 | quad_rate
253 | samp_rate/6
254 |
255 |
256 |
257 | blocks_null_sink
258 |
259 | alias
260 |
261 |
262 |
263 | bus_conns
264 | [[0,],]
265 |
266 |
267 | comment
268 |
269 |
270 |
271 | affinity
272 |
273 |
274 |
275 | _enabled
276 | True
277 |
278 |
279 | _coordinate
280 | (632, 256)
281 |
282 |
283 | _rotation
284 | 0
285 |
286 |
287 | id
288 | blocks_null_sink_0
289 |
290 |
291 | type
292 | float
293 |
294 |
295 | num_inputs
296 | 1
297 |
298 |
299 | vlen
300 | 1
301 |
302 |
303 |
304 | low_pass_filter
305 |
306 | beta
307 | 6.76
308 |
309 |
310 | alias
311 |
312 |
313 |
314 | comment
315 |
316 |
317 |
318 | affinity
319 |
320 |
321 |
322 | cutoff_freq
323 | 100000
324 |
325 |
326 | decim
327 | 6
328 |
329 |
330 | _enabled
331 | True
332 |
333 |
334 | type
335 | fir_filter_ccf
336 |
337 |
338 | _coordinate
339 | (216, 232)
340 |
341 |
342 | _rotation
343 | 0
344 |
345 |
346 | gain
347 | 1
348 |
349 |
350 | id
351 | low_pass_filter_0
352 |
353 |
354 | interp
355 | 1
356 |
357 |
358 | maxoutbuf
359 | 0
360 |
361 |
362 | minoutbuf
363 | 0
364 |
365 |
366 | samp_rate
367 | samp_rate
368 |
369 |
370 | width
371 | 100000
372 |
373 |
374 | win
375 | firdes.WIN_HAMMING
376 |
377 |
378 |
379 | pluto_sink
380 |
381 | attenuation
382 | 0
383 |
384 |
385 | alias
386 |
387 |
388 |
389 | buffer_size
390 | 0x8000
391 |
392 |
393 | comment
394 |
395 |
396 |
397 | affinity
398 |
399 |
400 |
401 | cyclic
402 | True
403 |
404 |
405 | _enabled
406 | 0
407 |
408 |
409 | auto_filter
410 | True
411 |
412 |
413 | filter
414 |
415 |
416 |
417 | _coordinate
418 | (384, 56)
419 |
420 |
421 | _rotation
422 | 0
423 |
424 |
425 | id
426 | pluto_sink_0
427 |
428 |
429 | uri
430 | local:
431 |
432 |
433 | frequency
434 | freq
435 |
436 |
437 | bandwidth
438 | 20000000
439 |
440 |
441 | samplerate
442 | samp_rate
443 |
444 |
445 |
446 | pluto_source
447 |
448 | bbdc
449 | True
450 |
451 |
452 | alias
453 |
454 |
455 |
456 | buffer_size
457 | 0x8000
458 |
459 |
460 | comment
461 |
462 |
463 |
464 | affinity
465 |
466 |
467 |
468 | uri
469 | local:
470 |
471 |
472 | _enabled
473 | True
474 |
475 |
476 | auto_filter
477 | True
478 |
479 |
480 | filter
481 |
482 |
483 |
484 | _coordinate
485 | (8, 96)
486 |
487 |
488 | _rotation
489 | 0
490 |
491 |
492 | gain
493 | "manual"
494 |
495 |
496 | id
497 | pluto_source_0
498 |
499 |
500 | frequency
501 | freq
502 |
503 |
504 | manual_gain
505 | 55
506 |
507 |
508 | maxoutbuf
509 | 0
510 |
511 |
512 | minoutbuf
513 | 0
514 |
515 |
516 | quadrature
517 | True
518 |
519 |
520 | rfdc
521 | True
522 |
523 |
524 | bandwidth
525 | 20000000
526 |
527 |
528 | samplerate
529 | samp_rate
530 |
531 |
532 |
533 | zeromq_pub_sink
534 |
535 | address
536 | tcp://0.0.0.0:5555
537 |
538 |
539 | alias
540 |
541 |
542 |
543 | comment
544 |
545 |
546 |
547 | affinity
548 |
549 |
550 |
551 | _enabled
552 | True
553 |
554 |
555 | _coordinate
556 | (632, 296)
557 |
558 |
559 | _rotation
560 | 0
561 |
562 |
563 | hwm
564 | -1
565 |
566 |
567 | id
568 | zeromq_pub_sink_0
569 |
570 |
571 | type
572 | float
573 |
574 |
575 | pass_tags
576 | False
577 |
578 |
579 | timeout
580 | 100
581 |
582 |
583 | vlen
584 | 1
585 |
586 |
587 |
588 | analog_sig_source_x_0
589 | pluto_sink_0
590 | 0
591 | 0
592 |
593 |
594 | analog_wfm_rcv_0
595 | blocks_null_sink_0
596 | 0
597 | 0
598 |
599 |
600 | analog_wfm_rcv_0
601 | zeromq_pub_sink_0
602 | 0
603 | 0
604 |
605 |
606 | low_pass_filter_0
607 | analog_wfm_rcv_0
608 | 0
609 | 0
610 |
611 |
612 | pluto_source_0
613 | low_pass_filter_0
614 | 0
615 | 0
616 |
617 |
618 |
--------------------------------------------------------------------------------
/doc/pluto_pc.grc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Tue Dec 4 20:54:47 2018
5 |
6 | options
7 |
8 | author
9 |
10 |
11 |
12 | window_size
13 |
14 |
15 |
16 | category
17 | [GRC Hier Blocks]
18 |
19 |
20 | comment
21 |
22 |
23 |
24 | description
25 |
26 |
27 |
28 | _enabled
29 | True
30 |
31 |
32 | _coordinate
33 | (8, 8)
34 |
35 |
36 | _rotation
37 | 0
38 |
39 |
40 | generate_options
41 | qt_gui
42 |
43 |
44 | hier_block_src_path
45 | .:
46 |
47 |
48 | id
49 | top_block
50 |
51 |
52 | max_nouts
53 | 0
54 |
55 |
56 | qt_qss_theme
57 |
58 |
59 |
60 | realtime_scheduling
61 |
62 |
63 |
64 | run_command
65 | {python} -u {filename}
66 |
67 |
68 | run_options
69 | prompt
70 |
71 |
72 | run
73 | True
74 |
75 |
76 | sizing_mode
77 | fixed
78 |
79 |
80 | thread_safe_setters
81 |
82 |
83 |
84 | title
85 |
86 |
87 |
88 | placement
89 | (0,0)
90 |
91 |
92 |
93 | variable
94 |
95 | comment
96 |
97 |
98 |
99 | _enabled
100 | True
101 |
102 |
103 | _coordinate
104 | (232, 12)
105 |
106 |
107 | _rotation
108 | 0
109 |
110 |
111 | id
112 | samp_rate
113 |
114 |
115 | value
116 | 48000/2
117 |
118 |
119 |
120 | audio_sink
121 |
122 | alias
123 |
124 |
125 |
126 | comment
127 |
128 |
129 |
130 | affinity
131 |
132 |
133 |
134 | device_name
135 |
136 |
137 |
138 | _enabled
139 | True
140 |
141 |
142 | _coordinate
143 | (232, 92)
144 |
145 |
146 | _rotation
147 | 0
148 |
149 |
150 | id
151 | audio_sink_0
152 |
153 |
154 | num_inputs
155 | 1
156 |
157 |
158 | ok_to_block
159 | True
160 |
161 |
162 | samp_rate
163 | samp_rate
164 |
165 |
166 |
167 | qtgui_time_sink_x
168 |
169 | autoscale
170 | False
171 |
172 |
173 | axislabels
174 | True
175 |
176 |
177 | alias
178 |
179 |
180 |
181 | comment
182 |
183 |
184 |
185 | ctrlpanel
186 | False
187 |
188 |
189 | affinity
190 |
191 |
192 |
193 | entags
194 | True
195 |
196 |
197 | _enabled
198 | True
199 |
200 |
201 | _coordinate
202 | (256, 160)
203 |
204 |
205 | gui_hint
206 |
207 |
208 |
209 | _rotation
210 | 0
211 |
212 |
213 | grid
214 | False
215 |
216 |
217 | id
218 | qtgui_time_sink_x_0
219 |
220 |
221 | legend
222 | True
223 |
224 |
225 | alpha1
226 | 1.0
227 |
228 |
229 | color1
230 | "blue"
231 |
232 |
233 | label1
234 |
235 |
236 |
237 | marker1
238 | -1
239 |
240 |
241 | style1
242 | 1
243 |
244 |
245 | width1
246 | 1
247 |
248 |
249 | alpha10
250 | 1.0
251 |
252 |
253 | color10
254 | "blue"
255 |
256 |
257 | label10
258 |
259 |
260 |
261 | marker10
262 | -1
263 |
264 |
265 | style10
266 | 1
267 |
268 |
269 | width10
270 | 1
271 |
272 |
273 | alpha2
274 | 1.0
275 |
276 |
277 | color2
278 | "red"
279 |
280 |
281 | label2
282 |
283 |
284 |
285 | marker2
286 | -1
287 |
288 |
289 | style2
290 | 1
291 |
292 |
293 | width2
294 | 1
295 |
296 |
297 | alpha3
298 | 1.0
299 |
300 |
301 | color3
302 | "green"
303 |
304 |
305 | label3
306 |
307 |
308 |
309 | marker3
310 | -1
311 |
312 |
313 | style3
314 | 1
315 |
316 |
317 | width3
318 | 1
319 |
320 |
321 | alpha4
322 | 1.0
323 |
324 |
325 | color4
326 | "black"
327 |
328 |
329 | label4
330 |
331 |
332 |
333 | marker4
334 | -1
335 |
336 |
337 | style4
338 | 1
339 |
340 |
341 | width4
342 | 1
343 |
344 |
345 | alpha5
346 | 1.0
347 |
348 |
349 | color5
350 | "cyan"
351 |
352 |
353 | label5
354 |
355 |
356 |
357 | marker5
358 | -1
359 |
360 |
361 | style5
362 | 1
363 |
364 |
365 | width5
366 | 1
367 |
368 |
369 | alpha6
370 | 1.0
371 |
372 |
373 | color6
374 | "magenta"
375 |
376 |
377 | label6
378 |
379 |
380 |
381 | marker6
382 | -1
383 |
384 |
385 | style6
386 | 1
387 |
388 |
389 | width6
390 | 1
391 |
392 |
393 | alpha7
394 | 1.0
395 |
396 |
397 | color7
398 | "yellow"
399 |
400 |
401 | label7
402 |
403 |
404 |
405 | marker7
406 | -1
407 |
408 |
409 | style7
410 | 1
411 |
412 |
413 | width7
414 | 1
415 |
416 |
417 | alpha8
418 | 1.0
419 |
420 |
421 | color8
422 | "dark red"
423 |
424 |
425 | label8
426 |
427 |
428 |
429 | marker8
430 | -1
431 |
432 |
433 | style8
434 | 1
435 |
436 |
437 | width8
438 | 1
439 |
440 |
441 | alpha9
442 | 1.0
443 |
444 |
445 | color9
446 | "dark green"
447 |
448 |
449 | label9
450 |
451 |
452 |
453 | marker9
454 | -1
455 |
456 |
457 | style9
458 | 1
459 |
460 |
461 | width9
462 | 1
463 |
464 |
465 | name
466 | ""
467 |
468 |
469 | nconnections
470 | 1
471 |
472 |
473 | size
474 | 1024
475 |
476 |
477 | srate
478 | samp_rate
479 |
480 |
481 | stemplot
482 | False
483 |
484 |
485 | tr_chan
486 | 0
487 |
488 |
489 | tr_delay
490 | 0
491 |
492 |
493 | tr_level
494 | 0.0
495 |
496 |
497 | tr_mode
498 | qtgui.TRIG_MODE_FREE
499 |
500 |
501 | tr_slope
502 | qtgui.TRIG_SLOPE_POS
503 |
504 |
505 | tr_tag
506 | ""
507 |
508 |
509 | type
510 | float
511 |
512 |
513 | update_time
514 | 0.10
515 |
516 |
517 | ylabel
518 | Amplitude
519 |
520 |
521 | yunit
522 | ""
523 |
524 |
525 | ymax
526 | 1
527 |
528 |
529 | ymin
530 | -1
531 |
532 |
533 |
534 | zeromq_sub_source
535 |
536 | address
537 | tcp://192.168.2.1:5555
538 |
539 |
540 | alias
541 |
542 |
543 |
544 | comment
545 |
546 |
547 |
548 | affinity
549 |
550 |
551 |
552 | _enabled
553 | True
554 |
555 |
556 | _coordinate
557 | (8, 76)
558 |
559 |
560 | _rotation
561 | 0
562 |
563 |
564 | hwm
565 | -1
566 |
567 |
568 | id
569 | zeromq_sub_source_0
570 |
571 |
572 | type
573 | float
574 |
575 |
576 | maxoutbuf
577 | 0
578 |
579 |
580 | minoutbuf
581 | 0
582 |
583 |
584 | pass_tags
585 | False
586 |
587 |
588 | timeout
589 | 100
590 |
591 |
592 | vlen
593 | 1
594 |
595 |
596 |
597 | zeromq_sub_source_0
598 | audio_sink_0
599 | 0
600 | 0
601 |
602 |
603 | zeromq_sub_source_0
604 | qtgui_time_sink_x_0
605 | 0
606 | 0
607 |
608 |
609 |
--------------------------------------------------------------------------------
/doc/target.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/target.pdf
--------------------------------------------------------------------------------
/doc/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oscimp/PlutoSDR/e27ee3de39040e24ed6e77aecec8b2e8daf03960/doc/target.png
--------------------------------------------------------------------------------
/doc/top_block_for_PC.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 | # -*- coding: utf-8 -*-
3 | ##################################################
4 | # GNU Radio Python Flow Graph
5 | # Title: Top Block
6 | # Generated: Wed Dec 5 19:39:16 2018
7 | ##################################################
8 |
9 | from distutils.version import StrictVersion
10 |
11 | if __name__ == '__main__':
12 | import ctypes
13 | import sys
14 | if sys.platform.startswith('linux'):
15 | try:
16 | x11 = ctypes.cdll.LoadLibrary('libX11.so')
17 | x11.XInitThreads()
18 | except:
19 | print "Warning: failed to XInitThreads()"
20 |
21 | from PyQt5 import Qt
22 | from PyQt5 import Qt, QtCore
23 | from gnuradio import audio
24 | from gnuradio import blocks
25 | from gnuradio import eng_notation
26 | from gnuradio import gr
27 | from gnuradio import qtgui
28 | from gnuradio import zeromq
29 | from gnuradio.eng_option import eng_option
30 | from gnuradio.filter import firdes
31 | from optparse import OptionParser
32 | import sip
33 | import sys
34 | from gnuradio import qtgui
35 |
36 |
37 | class top_block(gr.top_block, Qt.QWidget):
38 |
39 | def __init__(self):
40 | gr.top_block.__init__(self, "Top Block")
41 | Qt.QWidget.__init__(self)
42 | self.setWindowTitle("Top Block")
43 | qtgui.util.check_set_qss()
44 | try:
45 | self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
46 | except:
47 | pass
48 | self.top_scroll_layout = Qt.QVBoxLayout()
49 | self.setLayout(self.top_scroll_layout)
50 | self.top_scroll = Qt.QScrollArea()
51 | self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
52 | self.top_scroll_layout.addWidget(self.top_scroll)
53 | self.top_scroll.setWidgetResizable(True)
54 | self.top_widget = Qt.QWidget()
55 | self.top_scroll.setWidget(self.top_widget)
56 | self.top_layout = Qt.QVBoxLayout(self.top_widget)
57 | self.top_grid_layout = Qt.QGridLayout()
58 | self.top_layout.addLayout(self.top_grid_layout)
59 |
60 | self.settings = Qt.QSettings("GNU Radio", "top_block")
61 | self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))
62 |
63 |
64 | ##################################################
65 | # Variables
66 | ##################################################
67 | self.samp_rate = samp_rate = 48000/2
68 |
69 | ##################################################
70 | # Blocks
71 | ##################################################
72 | self.zeromq_sub_source_0 = zeromq.sub_source(gr.sizeof_float, 1, 'tcp://192.168.2.1:5555', 100, False, -1)
73 | self.qtgui_time_sink_x_0 = qtgui.time_sink_f(
74 | 1024, #size
75 | samp_rate, #samp_rate
76 | "", #name
77 | 1 #number of inputs
78 | )
79 | self.qtgui_time_sink_x_0.set_update_time(0.10)
80 | self.qtgui_time_sink_x_0.set_y_axis(-1, 1)
81 |
82 | self.qtgui_time_sink_x_0.set_y_label('Amplitude', "")
83 |
84 | self.qtgui_time_sink_x_0.enable_tags(-1, True)
85 | self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
86 | self.qtgui_time_sink_x_0.enable_autoscale(False)
87 | self.qtgui_time_sink_x_0.enable_grid(False)
88 | self.qtgui_time_sink_x_0.enable_axis_labels(True)
89 | self.qtgui_time_sink_x_0.enable_control_panel(False)
90 | self.qtgui_time_sink_x_0.enable_stem_plot(False)
91 |
92 | if not True:
93 | self.qtgui_time_sink_x_0.disable_legend()
94 |
95 | labels = ['', '', '', '', '',
96 | '', '', '', '', '']
97 | widths = [1, 1, 1, 1, 1,
98 | 1, 1, 1, 1, 1]
99 | colors = ["blue", "red", "green", "black", "cyan",
100 | "magenta", "yellow", "dark red", "dark green", "blue"]
101 | styles = [1, 1, 1, 1, 1,
102 | 1, 1, 1, 1, 1]
103 | markers = [-1, -1, -1, -1, -1,
104 | -1, -1, -1, -1, -1]
105 | alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
106 | 1.0, 1.0, 1.0, 1.0, 1.0]
107 |
108 | for i in xrange(1):
109 | if len(labels[i]) == 0:
110 | self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i))
111 | else:
112 | self.qtgui_time_sink_x_0.set_line_label(i, labels[i])
113 | self.qtgui_time_sink_x_0.set_line_width(i, widths[i])
114 | self.qtgui_time_sink_x_0.set_line_color(i, colors[i])
115 | self.qtgui_time_sink_x_0.set_line_style(i, styles[i])
116 | self.qtgui_time_sink_x_0.set_line_marker(i, markers[i])
117 | self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i])
118 |
119 | self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
120 | self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win)
121 | self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float*1, samp_rate,True)
122 | self.audio_sink_0 = audio.sink(samp_rate, '', True)
123 |
124 |
125 |
126 | ##################################################
127 | # Connections
128 | ##################################################
129 | self.connect((self.blocks_throttle_0, 0), (self.audio_sink_0, 0))
130 | self.connect((self.blocks_throttle_0, 0), (self.qtgui_time_sink_x_0, 0))
131 | self.connect((self.zeromq_sub_source_0, 0), (self.blocks_throttle_0, 0))
132 |
133 | def closeEvent(self, event):
134 | self.settings = Qt.QSettings("GNU Radio", "top_block")
135 | self.settings.setValue("geometry", self.saveGeometry())
136 | event.accept()
137 |
138 | def get_samp_rate(self):
139 | return self.samp_rate
140 |
141 | def set_samp_rate(self, samp_rate):
142 | self.samp_rate = samp_rate
143 | self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate)
144 | self.blocks_throttle_0.set_sample_rate(self.samp_rate)
145 |
146 |
147 | def main(top_block_cls=top_block, options=None):
148 |
149 | qapp = Qt.QApplication(sys.argv)
150 |
151 | tb = top_block_cls()
152 | tb.start()
153 | tb.show()
154 |
155 | def quitting():
156 | tb.stop()
157 | tb.wait()
158 | qapp.aboutToQuit.connect(quitting)
159 | qapp.exec_()
160 |
161 |
162 | if __name__ == '__main__':
163 | main()
164 |
--------------------------------------------------------------------------------
/doc/top_block_for_pluto.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 | # -*- coding: utf-8 -*-
3 | ##################################################
4 | # GNU Radio Python Flow Graph
5 | # Title: Top Block
6 | # Generated: Wed Dec 5 19:37:37 2018
7 | ##################################################
8 |
9 |
10 | from gnuradio import analog
11 | from gnuradio import blocks
12 | from gnuradio import eng_notation
13 | from gnuradio import filter
14 | from gnuradio import gr
15 | from gnuradio import iio
16 | from gnuradio import zeromq
17 | from gnuradio.eng_option import eng_option
18 | from gnuradio.filter import firdes
19 | from optparse import OptionParser
20 |
21 |
22 | class top_block(gr.top_block):
23 |
24 | def __init__(self):
25 | gr.top_block.__init__(self, "Top Block")
26 |
27 | ##################################################
28 | # Variables
29 | ##################################################
30 | self.samp_rate = samp_rate = 48000*24
31 | self.freq = freq = int(96.9e6)
32 |
33 | ##################################################
34 | # Blocks
35 | ##################################################
36 | self.zeromq_pub_sink_0 = zeromq.pub_sink(gr.sizeof_float, 1, 'tcp://0.0.0.0:5555', 100, False, -1)
37 | self.pluto_source_0 = iio.pluto_source('local:', freq, samp_rate, 20000000, 0x8000, True, True, True, "manual", 55, '', True)
38 | self.low_pass_filter_0 = filter.fir_filter_ccf(6, firdes.low_pass(
39 | 1, samp_rate, 100000, 100000, firdes.WIN_HAMMING, 6.76))
40 | self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_float*1)
41 | self.analog_wfm_rcv_0 = analog.wfm_rcv(
42 | quad_rate=samp_rate/6,
43 | audio_decimation=8,
44 | )
45 |
46 |
47 |
48 | ##################################################
49 | # Connections
50 | ##################################################
51 | self.connect((self.analog_wfm_rcv_0, 0), (self.blocks_null_sink_0, 0))
52 | self.connect((self.analog_wfm_rcv_0, 0), (self.zeromq_pub_sink_0, 0))
53 | self.connect((self.low_pass_filter_0, 0), (self.analog_wfm_rcv_0, 0))
54 | self.connect((self.pluto_source_0, 0), (self.low_pass_filter_0, 0))
55 |
56 | def get_samp_rate(self):
57 | return self.samp_rate
58 |
59 | def set_samp_rate(self, samp_rate):
60 | self.samp_rate = samp_rate
61 | self.pluto_source_0.set_params(self.freq, self.samp_rate, 20000000, True, True, True, "manual", 55, '', True)
62 | self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, 100000, 100000, firdes.WIN_HAMMING, 6.76))
63 |
64 | def get_freq(self):
65 | return self.freq
66 |
67 | def set_freq(self, freq):
68 | self.freq = freq
69 | self.pluto_source_0.set_params(self.freq, self.samp_rate, 20000000, True, True, True, "manual", 55, '', True)
70 |
71 |
72 | def main(top_block_cls=top_block, options=None):
73 |
74 | tb = top_block_cls()
75 | tb.start()
76 | try:
77 | raw_input('Press Enter to quit: ')
78 | except EOFError:
79 | pass
80 | tb.stop()
81 | tb.wait()
82 |
83 |
84 | if __name__ == '__main__':
85 | main()
86 |
--------------------------------------------------------------------------------
/external.desc:
--------------------------------------------------------------------------------
1 | name: PLUTOSDR
2 | desc: BR2_EXTERNAL_PLUTOSDR tree
3 |
--------------------------------------------------------------------------------
/external.mk:
--------------------------------------------------------------------------------
1 | include $(sort $(wildcard $(BR2_EXTERNAL_PLUTOSDR_PATH)/package/*/*.mk))
2 |
3 |
--------------------------------------------------------------------------------
/package/ad936x_ref_cal/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_AD936X_REF_CAL
2 | bool "Reference clock calibration utility for AD9361/3/4"
3 | depends on BR2_TOOLCHAIN_HAS_THREADS
4 | select BR2_PACKAGE_FFTW
5 | select BR2_PACKAGE_FFTW_DOUBLE
6 | select BR2_PACKAGE_LIBIIO_PLUTO
7 | help
8 | Reference clock calibration utility for AD9361/3/4
9 |
--------------------------------------------------------------------------------
/package/ad936x_ref_cal/ad936x_ref_cal.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # ad936x_ref_cal
4 | #
5 | ################################################################################
6 |
7 |
8 | AD936X_REF_CAL_VERSION = 01747db5cd60ff64115a73ac1f3bb97911f5c58e
9 | AD936X_REF_CAL_SITE = https://github.com/analogdevicesinc/plutosdr_scripts.git
10 | AD936X_REF_CAL_SITE_METHOD = git
11 | AD936X_REF_CAL_LICENSE = GPLv2
12 | AD936X_REF_CAL_LICENSE_FILES = LICENSE
13 | AD936X_REF_CAL_DEPENDENCIES = libiio-pluto fftw-double
14 |
15 | define AD936X_REF_CAL_BUILD_CMDS
16 | $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
17 | $(@D)/cal_ad9361.c -o $(@D)/ad936x_ref_cal -lm -lpthread -lfftw3 -liio
18 | endef
19 |
20 | define AD936X_REF_CAL_INSTALL_TARGET_CMDS
21 | $(INSTALL) -D -m 755 $(@D)/ad936x_ref_cal $(TARGET_DIR)/usr/sbin/ad936x_ref_cal
22 | endef
23 |
24 | $(eval $(generic-package))
25 |
--------------------------------------------------------------------------------
/package/gr-iio/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_GR_IIO
2 | bool "gr-iio"
3 | select BR2_PACKAGE_LIBAD9361_IIO
4 | select BR2_PACKAGE_GNURADIO
5 | select BR2_PACKAGE_GNURADIO_ANALOG
6 | select BR2_PACKAGE_GNURADIO_BLOCKS
7 | help
8 | GNU Radio IIO Blocks
9 | https://github.com/analogdevicesinc/gr-iio
10 |
--------------------------------------------------------------------------------
/package/gr-iio/gr-iio.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # gr-iio
4 | #
5 | ################################################################################
6 | GR_IIO_VERSION = e9d12b559c3efa085304fffba4a4310bb1297367
7 | GR_IIO_SITE = https://github.com/analogdevicesinc/gr-iio.git
8 | GR_IIO_SITE_METHOD = git
9 |
10 | GR_IIO_INSTALL_STAGING = YES
11 | GR_IIO_LICENSE = LGPL-2.1+
12 | GR_IIO_LICENSE_FILES = LICENSE
13 | GR_IIO_DEPENDENCIES = libad9361-iio gnuradio
14 |
15 | $(eval $(cmake-package))
16 |
--------------------------------------------------------------------------------
/package/libad9361-iio/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_LIBAD9361_IIO
2 | bool "libad9361-iio"
3 | select BR2_PACKAGE_LIBIIO_PLUTO
4 | help
5 | This is a simple library used for userspace, which manages multi-chip sync, on platforms (FMCOMMS5) where multiple AD9361 devices are used.
6 | https://github.com/analogdevicesinc/libad9361-iio
7 |
--------------------------------------------------------------------------------
/package/libad9361-iio/libad9361-iio.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # libad9361-iio
4 | #
5 | ################################################################################
6 | LIBAD9361_IIO_VERSION = 0.2
7 | LIBAD9361_IIO_SITE = $(call github,analogdevicesinc,libad9361-iio,v$(LIBAD9361_IIO_VERSION))
8 |
9 | LIBAD9361_IIO_INSTALL_STAGING = YES
10 | LIBAD9361_IIO_LICENSE = LGPL-2.1+
11 | LIBAD9361_IIO_LICENSE_FILES = LICENSE
12 | LIBAD9361_IIO_DEPENDENCIES = libiio-pluto
13 |
14 | $(eval $(cmake-package))
15 |
--------------------------------------------------------------------------------
/package/libiio-pluto/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_LIBIIO_PLUTO
2 | bool "libiio"
3 | select BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_BACKEND if !BR2_PACKAGE_LIBIIO_PLUTO_XML_BACKEND
4 | help
5 | Libiio is a library to ease the development of software
6 | interfacing Linux Industrial I/O (IIO) devices.
7 |
8 | http://wiki.analog.com/resources/tools-software/linux-software/libiio
9 |
10 | if BR2_PACKAGE_LIBIIO_PLUTO
11 |
12 | config BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_BACKEND
13 | bool "Local backend"
14 | default y
15 | help
16 | Enable the local backend of the library.
17 |
18 | config BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_CONFIG
19 | bool "Local context attributes"
20 | depends on BR2_PACKAGE_LIBINI
21 | default y
22 | help
23 | Read local context attributes from /etc/libiio.ini.
24 |
25 | config BR2_PACKAGE_LIBIIO_PLUTO_XML_BACKEND
26 | bool "XML backend"
27 | default y
28 | select BR2_PACKAGE_LIBXML2
29 | help
30 | Enable the XML backend of the library.
31 |
32 | config BR2_PACKAGE_LIBIIO_PLUTO_NETWORK_BACKEND
33 | bool "Network backend"
34 | default y
35 | select BR2_PACKAGE_LIBIIO_PLUTO_XML_BACKEND
36 | help
37 | Enable the network backend of the library.
38 |
39 | config BR2_PACKAGE_LIBIIO_PLUTO_USB_BACKEND
40 | bool "USB backend"
41 | default y
42 | depends on BR2_TOOLCHAIN_HAS_THREADS # from libusb
43 | select BR2_PACKAGE_LIBIIO_PLUTO_XML_BACKEND
44 | select BR2_PACKAGE_LIBUSB
45 | help
46 | Enable the USB backend of the library.
47 |
48 | comment "The USB backend needs a toolchain w/ threads"
49 | depends on !BR2_TOOLCHAIN_HAS_THREADS
50 |
51 | config BR2_PACKAGE_LIBIIO_PLUTO_SERIAL_BACKEND
52 | bool "Serial backend"
53 | default y
54 | select BR2_PACKAGE_LIBIIO_PLUTO_XML_BACKEND
55 | select BR2_PACKAGE_LIBSERIALPORT
56 | help
57 | Enable the serial backend of the library.
58 |
59 | config BR2_PACKAGE_LIBIIO_PLUTO_IIOD
60 | bool "IIO Daemon"
61 | default y
62 | depends on BR2_TOOLCHAIN_HAS_THREADS
63 | select BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_BACKEND
64 | help
65 | Install the IIO Daemon.
66 |
67 | config BR2_PACKAGE_LIBIIO_PLUTO_IIOD_USBD
68 | bool "USB support in the IIO Daemon (FunctionFS)"
69 | depends on BR2_PACKAGE_LIBIIO_PLUTO_IIOD
70 | depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18 # usb_functionfs_descs_head_v2
71 | select BR2_PACKAGE_LIBAIO
72 | help
73 | Add support for USB through FunctionFS with IIOD.
74 |
75 | comment "USB support in the IIO Daemon requires libaio, headers >= 3.18"
76 | depends on BR2_PACKAGE_LIBIIO_PLUTO_IIOD
77 | depends on !BR2_PACKAGE_LIBAIO || \
78 | !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
79 |
80 | comment "IIO Daemon needs a toolchain w/ threads"
81 | depends on !BR2_TOOLCHAIN_HAS_THREADS
82 |
83 | config BR2_PACKAGE_LIBIIO_PLUTO_TESTS
84 | bool "Install test programs"
85 | depends on BR2_TOOLCHAIN_HAS_THREADS
86 | help
87 | Install the test programs (iio_info, iio_genxml, iio_readdev).
88 |
89 | comment "IIO test programs need a toolchain w/ threads"
90 | depends on !BR2_TOOLCHAIN_HAS_THREADS
91 |
92 | config BR2_PACKAGE_LIBIIO_PLUTO_BINDINGS_CSHARP
93 | bool "Install C# bindings"
94 | depends on BR2_PACKAGE_MONO
95 | help
96 | Install the C# bindings.
97 |
98 | config BR2_PACKAGE_LIBIIO_PLUTO_BINDINGS_PYTHON
99 | bool "Install Python bindings"
100 | depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
101 | help
102 | Install the Python bindings.
103 |
104 | endif
105 |
--------------------------------------------------------------------------------
/package/libiio-pluto/S99iiod:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Server-side demuxing by default
4 | IIOD_OPTS=-D
5 |
6 | [ -r /etc/default/iiod ] && . /etc/default/iiod
7 |
8 | case "$1" in
9 | start)
10 | echo "Starting IIO Server Daemon"
11 | start-stop-daemon -S -b -q -m -p /var/run/iiod.pid -x /usr/sbin/iiod -- $IIOD_OPTS
12 | exit $?
13 | ;;
14 |
15 | stop)
16 | echo "Stopping IIO Server Daemon"
17 | start-stop-daemon -K -q -p /var/run/iiod.pid 2>/dev/null
18 | exit $?
19 | ;;
20 |
21 | restart)
22 | $0 stop
23 | sleep 1
24 | $0 start
25 | ;;
26 |
27 | *)
28 | echo "Usage: $0 {start|stop|restart}"
29 | exit 1
30 | esac
31 |
--------------------------------------------------------------------------------
/package/libiio-pluto/libiio-pluto.hash:
--------------------------------------------------------------------------------
1 | # From https://github.com/analogdevicesinc/libiio/archive/v0.7/
2 | sha256 c2b02f1cb51870db52368fdaa8087dc2a4ec43f2bc3c3514d8214952f14c3f39 libiio-0.7.tar.gz
3 | sha256 b9e4fd97fbbb1cfdf48362aa156ab2e61b41b368467c952698aaf6999d5560b9 libiio-0.7.164de86.tar.gz
4 | sha256 08abe0ee09629c874d5c98daf0c0dab5cf7cd66f373a77eecfa992eddc877036 libiio-0.8.tar.gz
5 | sha256 b6184876d192fbfd51e3a0a29736fa1be2dbaf07370cf861797076f40a85f823 libiio-0.9.tar.gz
6 | sha256 002d57f35715821efae66479859bc5357b4d8d33bfff1446b4e17b02ae2c10d2 libiio-0.10.tar.gz
7 | sha256 0174111b028d84f18fb3716b22834a372a1f2575938f87e20e5cbd76747d0fdb libiio-0.11.tar.gz
8 | sha256 36e164fc00535762c819db209928ee2704fc81657d41060ea47873bccfd5c4bc libiio-0.12.tar.gz
9 | sha256 12063db7a9366aa00bfd789db30afaddb29686bc29b3ce1e5d4adfe1c3b42527 libiio-0.14.tar.gz
10 | sha256 a729f8ff48137ad271a3e2951f322b35c1bf2ec075b488d75c8bd071c693fd19 libiio-0.15.tar.gz
11 | sha256 5eb3ec24342eb01c49235a1d8a053462f930835a3002e687371b680a9bb150f6 libiio-0.16.tar.gz
12 | sha256 f591693b8759b6f159ab7afcc1325854a883a486adaf8a849acbdfe0def9db56 libiio-0.17.tar.gz
13 |
--------------------------------------------------------------------------------
/package/libiio-pluto/libiio-pluto.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # libiio
4 | #
5 | ################################################################################
6 |
7 | LIBIIO_PLUTO_VERSION = 0.17
8 | LIBIIO_PLUTO_SOURCE = libiio-$(LIBIIO_PLUTO_VERSION).tar.gz
9 | LIBIIO_PLUTO_SITE = $(call github,analogdevicesinc,libiio,v$(LIBIIO_PLUTO_VERSION))
10 |
11 | #LIBIIO_PLUTO_VERSION = 60063cb20312c2f06cb8b33e8692e4a0a3546738
12 | #LIBIIO_PLUTO_SITE = https://github.com/analogdevicesinc/libiio.git
13 | #LIBIIO_PLUTO_SITE_METHOD = git
14 |
15 | LIBIIO_PLUTO_INSTALL_STAGING = YES
16 | LIBIIO_PLUTO_LICENSE = LGPL-2.1+
17 | LIBIIO_PLUTO_LICENSE_FILES = COPYING.txt
18 |
19 | LIBIIO_PLUTO_CONF_OPTS = -DENABLE_IPV6=ON \
20 | -DWITH_LOCAL_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_BACKEND),ON,OFF) \
21 | -DWITH_LOCAL_CONFIG=$(if $(BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_CONFIG),ON,OFF) \
22 | -DWITH_NETWORK_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_PLUTO_NETWORK_BACKEND),ON,OFF) \
23 | -DWITH_MATLAB_BINDINGS_API=OFF \
24 | -DMATLAB_BINDINGS=OFF \
25 | -DINSTALL_UDEV_RULE=$(if $(BR2_PACKAGE_HAS_UDEV),ON,OFF) \
26 | -DWITH_TESTS=$(if $(BR2_PACKAGE_LIBIIO_PLUTO_TESTS),ON,OFF) \
27 | -DWITH_DOC=OFF
28 |
29 | # -DLIBIIO_PLUTO_VERSION_GIT=60063cb \
30 |
31 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_LOCAL_BACKEND),y)
32 | LIBIIO_PLUTO_DEPENDENCIES += libini
33 | endif
34 |
35 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_XML_BACKEND),y)
36 | LIBIIO_PLUTO_DEPENDENCIES += libxml2
37 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_XML_BACKEND=ON
38 | else
39 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_XML_BACKEND=OFF
40 | endif
41 |
42 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_USB_BACKEND),y)
43 | LIBIIO_PLUTO_DEPENDENCIES += libusb
44 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_USB_BACKEND=ON
45 | else
46 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_USB_BACKEND=OFF
47 | endif
48 |
49 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_SERIAL_BACKEND),y)
50 | LIBIIO_PLUTO_DEPENDENCIES += libserialport
51 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_SERIAL_BACKEND=ON
52 | else
53 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_SERIAL_BACKEND=OFF
54 | endif
55 |
56 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_IIOD),y)
57 | LIBIIO_PLUTO_DEPENDENCIES += host-flex host-bison libaio
58 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_IIOD=ON -DWITH_AIO=ON
59 | else
60 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_IIOD=OFF
61 | endif
62 |
63 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_IIOD_USBD),y)
64 | LIBIIO_PLUTO_DEPENDENCIES += libaio
65 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_IIOD_USBD=ON
66 | else
67 | LIBIIO_PLUTO_CONF_OPTS += -DWITH_IIOD_USBD=OFF
68 | endif
69 |
70 | # Avahi support in libiio requires avahi-client, which needs avahi-daemon and dbus
71 | ifeq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_DBUS),yy)
72 | LIBIIO_PLUTO_DEPENDENCIES += avahi
73 | endif
74 |
75 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_BINDINGS_PYTHON),y)
76 | ifeq ($(BR2_PACKAGE_PYTHON),y)
77 | LIBIIO_PLUTO_DEPENDENCIES += python
78 | else ifeq ($(BR2_PACKAGE_PYTHON3),y)
79 | LIBIIO_PLUTO_DEPENDENCIES += python3
80 | endif
81 | LIBIIO_PLUTO_CONF_OPTS += -DPYTHON_BINDINGS=ON
82 | else
83 | LIBIIO_PLUTO_CONF_OPTS += -DPYTHON_BINDINGS=OFF
84 | endif
85 |
86 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_BINDINGS_CSHARP),y)
87 | define LIBIIO_PLUTO_INSTALL_CSHARP_BINDINGS_TO_TARGET
88 | rm $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_PLUTO_VERSION)/libiio-sharp.dll.mdb
89 | $(HOST_DIR)/bin/gacutil -root $(TARGET_DIR)/usr/lib -i \
90 | $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_PLUTO_VERSION)/libiio-sharp.dll
91 | endef
92 | define LIBIIO_PLUTO_INSTALL_CSHARP_BINDINGS_TO_STAGING
93 | $(HOST_DIR)/bin/gacutil -root $(STAGING_DIR)/usr/lib -i \
94 | $(STAGING_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_PLUTO_VERSION)/libiio-sharp.dll
95 | endef
96 | LIBIIO_PLUTO_POST_INSTALL_TARGET_HOOKS += LIBIIO_PLUTO_INSTALL_CSHARP_BINDINGS_TO_TARGET
97 | LIBIIO_PLUTO_POST_INSTALL_STAGING_HOOKS += LIBIIO_PLUTO_INSTALL_CSHARP_BINDINGS_TO_STAGING
98 | LIBIIO_PLUTO_DEPENDENCIES += mono
99 | LIBIIO_PLUTO_CONF_OPTS += -DCSHARP_BINDINGS=ON
100 | else
101 | LIBIIO_PLUTO_CONF_OPTS += -DCSHARP_BINDINGS=OFF
102 | endif
103 |
104 | ifeq ($(BR2_PACKAGE_LIBIIO_PLUTO_IIOD),y)
105 | define LIBIIO_PLUTO_INSTALL_INIT_SYSV
106 | $(INSTALL) -D -m 0755 package/libiio/S99iiod \
107 | $(TARGET_DIR)/etc/init.d/S99iiod
108 | endef
109 | endif
110 |
111 | $(eval $(cmake-package))
112 |
--------------------------------------------------------------------------------
/package/libini/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_LIBINI
2 | bool "libini"
3 | help
4 | Libini is a simple library to read INI configuration files.
5 |
6 | See: https://github.com/pcercuei/libini/
7 |
--------------------------------------------------------------------------------
/package/libini/libini.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # libini
4 | #
5 | ################################################################################
6 |
7 | LIBINI_VERSION = a467418
8 | LIBINI_SITE = https://github.com/pcercuei/libini.git
9 | LIBINI_SITE_METHOD = git
10 |
11 | LIBINI_INSTALL_STAGING = YES
12 | LIBINI_LICENSE = LGPLv2.1+
13 | LIBINI_LICENSE_FILES = LICENSE.txt
14 |
15 | $(eval $(cmake-package))
16 |
--------------------------------------------------------------------------------
/package/pluto-system-top-bit/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_PLUTO_SYSTEM_TOP_BIT
2 | bool "pluto default system_top.bit"
3 | help
4 | PlutoSDR default sytem_top.bit
5 |
6 | http://ghttps://github.com/analogdevicesinc/plutosdr-fw
7 |
--------------------------------------------------------------------------------
/package/pluto-system-top-bit/pluto-system-top-bit.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # pluto-system-top-bit
4 | #
5 | ################################################################################
6 |
7 | PLUTO_SYSTEM_TOP_BIT_VERSION = v0.30
8 | PLUTO_SYSTEM_TOP_BIT_SOURCE = plutosdr-jtag-bootstrap-$(PLUTO_SYSTEM_TOP_BIT_VERSION).zip
9 | PLUTO_SYSTEM_TOP_BIT_SITE = http://github.com/analogdevicesinc/plutosdr-fw/releases/download/$(PLUTO_SYSTEM_TOP_BIT_VERSION)
10 |
11 | PLUTO_SYSTEM_TOP_BIT_INSTALL_IMAGES = YES
12 | PLUTO_SYSTEM_TOP_BIT_INSTALL_TARGET = NO
13 |
14 | define PLUTO_SYSTEM_TOP_BIT_EXTRACT_CMDS
15 | $(UNZIP) $(PLUTO_SYSTEM_TOP_BIT_DL_DIR)/$(PLUTO_SYSTEM_TOP_BIT_SOURCE) system_top.bit -d $(@D)
16 | endef
17 |
18 | define PLUTO_SYSTEM_TOP_BIT_INSTALL_IMAGES_CMDS
19 | cp $(@D)/system_top.bit $(BINARIES_DIR)
20 | endef
21 |
22 | $(eval $(generic-package))
23 |
--------------------------------------------------------------------------------
/package/poll_sysfs/Config.in:
--------------------------------------------------------------------------------
1 | config BR2_PACKAGE_POLL_SYSFS
2 | bool "poll_sysfs"
3 | help
4 | The sysfs poll utility.
5 |
6 |
--------------------------------------------------------------------------------
/package/poll_sysfs/poll_sysfs.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Simple sysfs poll
3 | *
4 | * Copyright 2017 Analog Devices Inc.
5 | *
6 | * Licensed under the GPL-2.
7 | */
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 |
16 | int main(int argc, char *argv[]) {
17 | struct pollfd fdlist[1];
18 | int fd, err;
19 | char buf[80];
20 |
21 | if (argc < 2)
22 | return 1;
23 |
24 | fd = open(argv[1], O_RDONLY);
25 |
26 | fdlist[0].fd = fd;
27 | fdlist[0].events = POLLPRI | POLLERR;
28 |
29 | read(fdlist[0].fd, buf, sizeof(buf));
30 |
31 | err = poll(fdlist, 1, -1);
32 | if (err < 0) {
33 | perror("poll");
34 | return 1;
35 | }
36 |
37 | err = lseek(fdlist[0].fd, 0 , SEEK_SET);
38 | if (err < 0) {
39 | perror("lseek");
40 | return 1;
41 | }
42 |
43 | err = read(fdlist[0].fd, buf, sizeof(buf));
44 | if (err > 0) {
45 | buf[err] = 0;
46 | printf("%s", buf);
47 | close(fdlist[0].fd);
48 | return 0;
49 | }
50 |
51 | perror("read");
52 | return 1;
53 | }
54 |
--------------------------------------------------------------------------------
/package/poll_sysfs/poll_sysfs.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # poll_sysfs
4 | #
5 | ################################################################################
6 |
7 | POLL_SYSFS_LICENSE = GPLv2
8 |
9 |
10 | define POLL_SYSFS_BUILD_CMDS
11 | $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
12 | ${BR2_EXTERNAL_PLUTOSDR_PATH}/package/poll_sysfs/poll_sysfs.c -o $(@D)/poll_sysfs
13 | endef
14 |
15 | define POLL_SYSFS_INSTALL_TARGET_CMDS
16 | $(INSTALL) -D -m 755 $(@D)/poll_sysfs $(TARGET_DIR)/sbin/poll_sysfs
17 | endef
18 |
19 | $(eval $(generic-package))
20 |
--------------------------------------------------------------------------------
/sourceme.ggm:
--------------------------------------------------------------------------------
1 | ABSOLUTE_PATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
2 | unset LD_LIBRARY_PATH
3 |
4 | # Add this directory only if not already added to avoid problem
5 | # with Buildroot
6 | if [ -z "$(echo $BR2_EXTERNAL | grep $ABSOLUTE_PATH)" ]; then
7 | export BR2_EXTERNAL=$ABSOLUTE_PATH:$BR2_EXTERNAL
8 | fi
9 |
--------------------------------------------------------------------------------