2021-04-04 21:04:12 +01:00
|
|
|
## Bloom
|
2021-04-06 02:10:14 +01:00
|
|
|
|
2021-04-24 21:11:29 +01:00
|
|
|
Bloom can be downloaded at https://bloom.oscillate.io/download.
|
2021-04-06 02:10:14 +01:00
|
|
|
|
2022-06-01 21:48:27 +01:00
|
|
|
Bloom is a debug interface for embedded systems development on GNU/Linux. This is the official repository for Bloom's
|
2021-04-06 02:10:14 +01:00
|
|
|
source code. For information on how to use Bloom, please visit https://bloom.oscillate.io.
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2022-05-02 13:19:03 +01:00
|
|
|
Bloom implements a number of user-space device drivers, enabling support for many debug tools (such as the Atmel-ICE,
|
2021-12-27 14:44:08 +00:00
|
|
|
Power Debugger, MPLAB SNAP, etc). Bloom exposes an interface to the connected target, via a GDB RSP server. This allows
|
|
|
|
|
any IDE with GDB RSP client capabilities to interface with Bloom and gain full access to the target.
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2022-05-02 13:19:03 +01:00
|
|
|
Currently, Bloom only supports AVR8 targets from Microchip. Bloom was designed to accommodate targets from different
|
2021-04-04 21:04:12 +01:00
|
|
|
families and architectures. Support for other target families will be considered as and when requested.
|
|
|
|
|
|
|
|
|
|
### License
|
2021-11-09 21:00:38 +00:00
|
|
|
Bloom is released under the LGPLv3 license. See LICENSE.md
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2021-04-10 17:39:52 +01:00
|
|
|
---
|
|
|
|
|
|
2021-04-04 21:04:12 +01:00
|
|
|
### Bloom Architecture
|
2021-04-10 02:07:33 +01:00
|
|
|
|
2021-04-04 21:04:12 +01:00
|
|
|
Bloom is a multithreaded event-driven program written in C++. It consists of four components:
|
|
|
|
|
|
|
|
|
|
- TargetController
|
|
|
|
|
- DebugServer
|
|
|
|
|
- Insight
|
|
|
|
|
- SignalHandler
|
|
|
|
|
|
|
|
|
|
##### TargetController
|
2022-05-02 13:19:03 +01:00
|
|
|
The TargetController possesses full control of the connected debug tool and target. Execution of user-space
|
2021-04-04 21:04:12 +01:00
|
|
|
device drivers takes place here. All interaction with the connected hardware goes through the TargetController.
|
2022-05-02 13:19:03 +01:00
|
|
|
It exposes an interface to the connected hardware via a command-response mechanism. The TargetController runs on a
|
|
|
|
|
dedicated thread. See the [TargetController documentation](./src/TargetController/README.md) and source code in
|
|
|
|
|
src/TargetController/ for more.
|
2021-04-04 21:04:12 +01:00
|
|
|
|
|
|
|
|
##### DebugServer
|
2022-11-16 23:51:07 +00:00
|
|
|
The DebugServer exposes an interface to the connected target, for third-party programs such as GDB and IDEs (GDB
|
|
|
|
|
front-ends). Currently, Bloom only supports one server - the AVR GDB RSP server. With this server, any AVR compatible
|
2022-11-17 00:49:59 +00:00
|
|
|
version of GDB (or any IDE with GDB RSP support) can interface with Bloom and thus the connected AVR target. The
|
2022-11-16 23:51:07 +00:00
|
|
|
DebugServer runs on a dedicated thread. See the
|
2022-03-31 17:57:09 +01:00
|
|
|
[DebugServer documentation](./src/DebugServer/README.md) and source code in src/DebugServer/ for more.
|
2021-04-04 21:04:12 +01:00
|
|
|
|
|
|
|
|
##### Insight
|
2022-05-02 13:19:03 +01:00
|
|
|
Insight is a graphical user interface that provides insight into the connected target. It presents the target's
|
2023-06-10 20:51:29 +01:00
|
|
|
memories, GPIO pin states & registers, along with the ability to manipulate them. Insight runs on Bloom's main thread
|
2022-09-08 16:07:22 +01:00
|
|
|
and employs several worker threads for background tasks. Unlike other components within Bloom, Insight relies heavily
|
2021-12-27 14:44:08 +00:00
|
|
|
on the Qt framework for its GUI capabilities and other useful utilities. See source code in src/Insight/ for more.
|
2021-04-04 21:04:12 +01:00
|
|
|
|
|
|
|
|
##### SignalHandler
|
|
|
|
|
The SignalHandler is responsible for handling any UNIX signals issued to Bloom. It runs on a dedicated thread. All
|
|
|
|
|
other threads within Bloom do not accept any UNIX signals.
|
2021-04-06 02:10:14 +01:00
|
|
|
See source code in src/SignalHandler/ for more.
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2021-04-10 17:39:52 +01:00
|
|
|
---
|
|
|
|
|
|
2022-05-09 22:36:44 +01:00
|
|
|
### Building Bloom from source
|
2021-04-10 17:39:52 +01:00
|
|
|
|
2023-01-15 21:26:45 +00:00
|
|
|
> Bloom is typically distributed via binary packages, which can be downloaded via the
|
|
|
|
|
> [downloads page](https://bloom.oscillate.io/download). These packages contain a prebuilt binary of Bloom, as well as
|
|
|
|
|
> some of its dependencies (dynamically linked libraries). These dependencies are distributed with Bloom because they
|
|
|
|
|
> work well with it. This is known because countless hours have been spent, testing them, on many Linux distros. If you
|
|
|
|
|
> choose to use a binary package, you can be fairly confident that you won't run into any compatability issues.
|
|
|
|
|
>
|
|
|
|
|
> However, if you choose to build Bloom from source, it will use your system's shared libraries, which may be of a
|
|
|
|
|
> different version to the one that was tested against. You will be more likely to face compatability issues.
|
|
|
|
|
>
|
2023-01-20 18:40:29 +00:00
|
|
|
> In an ideal world, using a shared library with a different minor version won't break anything, but this is not always
|
2023-01-15 21:26:45 +00:00
|
|
|
> the reality.
|
|
|
|
|
|
|
|
|
|
#### Dependencies
|
|
|
|
|
|
2023-01-18 00:43:08 +00:00
|
|
|
To compile Bloom, the following dependencies must be resolved:
|
2023-01-15 21:26:45 +00:00
|
|
|
|
2023-01-20 23:04:46 +00:00
|
|
|
The accompanying package names are from the Debian (APT) package repositories - package names will vary across package
|
|
|
|
|
repositories.
|
|
|
|
|
|
2023-05-24 19:37:59 +01:00
|
|
|
- CMake version 3.22 or later
|
2023-01-15 21:26:45 +00:00
|
|
|
- G++10 or later
|
2023-01-20 23:04:46 +00:00
|
|
|
- libusb v1.0 (`libusb-1.0-0-dev`)
|
|
|
|
|
- libhidapi (0.11.2 or later) (`libhidapi-dev`)
|
|
|
|
|
- yaml-cpp (version 0.7.0 or later) (`libyaml-cpp-dev`)
|
|
|
|
|
- libprocps (`libprocps-dev`)
|
2023-12-13 21:03:50 +00:00
|
|
|
- PHP CLI version 8.2 or later, with the xml extension (`php8.2-cli`, `php8.2-xml`)
|
2023-01-15 21:26:45 +00:00
|
|
|
- Qt Version 6.2.4 or later (see note below)
|
|
|
|
|
|
|
|
|
|
When installing Qt, it's best to install via the Qt installer: https://www.qt.io/download
|
2021-04-10 17:39:52 +01:00
|
|
|
|
|
|
|
|
You may also need to install mesa-common-dev and libglu1-mesa-dev (Qt dependencies):
|
|
|
|
|
|
2021-04-11 00:16:00 +01:00
|
|
|
If you already have another version of Qt installed, you may need to temporarily point qtchooser to the right place
|
|
|
|
|
(unless you can figure out another way to make cmake use the right Qt binaries (specifically, the moc)):
|
|
|
|
|
```
|
|
|
|
|
# Set the appropriate paths to your Qt installation in here. You may want to backup this file incase you wish to revert the changes
|
|
|
|
|
# You may need to change the path below
|
|
|
|
|
sudo nano /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-10 19:53:47 +01:00
|
|
|
#### Example build
|
2023-01-14 13:05:57 +00:00
|
|
|
|
2023-01-15 21:26:45 +00:00
|
|
|
```shell
|
|
|
|
|
# Build Bloom in [SOME_BUILD_DIR]
|
|
|
|
|
mkdir [SOME_BUILD_DIR];
|
|
|
|
|
cd [SOME_BUILD_DIR];
|
2021-04-10 17:39:52 +01:00
|
|
|
|
2023-01-15 21:26:45 +00:00
|
|
|
cmake [PATH_TO_BLOOM_SOURCE] -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=[PATH_TO_QT_INSTALLATION]/gcc_64/;
|
|
|
|
|
cmake --build ./;
|
|
|
|
|
|
|
|
|
|
# Install Bloom to /opt/bloom
|
|
|
|
|
sudo cmake --install ./;
|
|
|
|
|
|
2023-01-18 00:43:08 +00:00
|
|
|
# OR, install Bloom to [SOME_OTHER_INSTALLATION_DIR]
|
2023-01-15 21:26:45 +00:00
|
|
|
sudo cmake --install ./ --prefix [SOME_OTHER_INSTALLATION_DIR];
|
|
|
|
|
```
|
|
|
|
|
#### Other notes on building from source:
|
|
|
|
|
|
|
|
|
|
- To specify the compiler path, use `-DCMAKE_CXX_COMPILER=...`:
|
2021-04-10 17:39:52 +01:00
|
|
|
```
|
2023-01-15 21:26:45 +00:00
|
|
|
cmake [PATH_TO_BLOOM_SOURCE] -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=[PATH_TO_QT_INSTALLATION]/gcc_64/ -DCMAKE_CXX_COMPILER=/usr/bin/g++-10;
|
2021-04-10 17:39:52 +01:00
|
|
|
```
|
2023-09-29 11:33:20 +01:00
|
|
|
- We do **not** modify the RUNPATH of release builds. This means that running your release build, directly, may fail,
|
|
|
|
|
due to missing Qt shared libraries. We create an invocation script (`[INSTALL_DIR]/bin/bloom.sh`) upon installation,
|
|
|
|
|
which will set the `LD_LIBRARY_PATH` environment variable. You'll need to use that script to run a release build
|
|
|
|
|
(unless all of your shared libraries can be found in the typical locations).
|
|
|
|
|
- For debug builds, we **do** modify the RUNPATH (as it's easier for me, during development), but you should note that
|
|
|
|
|
this is currently hardcoded to point to my Qt installation. See the root CMakeLists.txt for more.
|
|
|
|
|
- Once you've installed Bloom, you'll need to create a symlink to Bloom's invocation script, in `/usr/bin/`, to run
|
|
|
|
|
`bloom` without having to supply the full path: `sudo ln -s /opt/bloom/bin/bloom.sh /usr/bin/bloom;`
|
2023-01-18 22:00:11 +00:00
|
|
|
- If you're installing on Ubuntu 20.04 or older, you may need to move the installed udev rules, as they're expected
|
|
|
|
|
to reside in `/lib/udev/rules.d` on those systems. Move them via: `sudo mv /usr/lib/udev/rules.d/99-bloom.rules /lib/udev/rules.d/;`
|
2023-05-10 19:53:39 +01:00
|
|
|
|
|
|
|
|
### Excluding Insight at build time
|
|
|
|
|
|
|
|
|
|
The Insight component can be excluded at build time, via the `EXCLUDE_INSIGHT` flag.
|
|
|
|
|
You'll still need to satisfy the Qt dependency on the build machine, as other parts of Bloom use Qt, but you'll no
|
|
|
|
|
longer need to install GUI dependencies on every machine you intend to run Bloom on. Just build it once and distribute
|
|
|
|
|
the binary, along with the necessary shared objects.
|
|
|
|
|
|
|
|
|
|
To identify the necessary shared objects, copy the binary to one of those machines and run `ldd [PATH_TO_BLOOM_BINARY]`.
|
|
|
|
|
That will output a list of all the dependencies that `ld` couldn't satisfy - those will be what you need to distribute
|
|
|
|
|
(or manually install on each machine).
|
|
|
|
|
|
|
|
|
|
#### Example build excluding Insight
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
# Build Bloom in [SOME_BUILD_DIR]
|
|
|
|
|
mkdir [SOME_BUILD_DIR];
|
|
|
|
|
cd [SOME_BUILD_DIR];
|
|
|
|
|
|
|
|
|
|
cmake [PATH_TO_BLOOM_SOURCE] -DEXCLUDE_INSIGHT=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=[PATH_TO_QT_INSTALLATION]/gcc_64/;
|
|
|
|
|
cmake --build ./;
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
|
```
|