Skip to content

Commit 1663336

Browse files
📝 Updated README
1 parent 4ec3ee4 commit 1663336

File tree

3 files changed

+89
-148
lines changed

3 files changed

+89
-148
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM --platform=arm64 ubuntu:22.04
22

33
RUN apt update && apt upgrade -y
4-
RUN apt install gcc g++ valgrind neofetch git wget python3-pip clang-format software-properties-common locales pkg-config automake autoconf autoconf-archive libtool m4 -y
4+
RUN apt install gcc g++ valgrind neofetch git wget python3-pip clang-format software-properties-common locales pkg-config automake autoconf autoconf-archive libtool m4 clangd-17 -y
55

66
RUN wget https://apt.llvm.org/llvm.sh
77
RUN chmod +x llvm.sh

README.md

Lines changed: 26 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# libhal-linux
2+
> [!IMPORTANT]
3+
> There is not yet a published package on JFrog and you will need to build the package manually using `conan create . --version=latest`. This will be fixed soon.
4+
> No cross compiler profiles have been created yet, to use develop using this you currently need develop with the same archtecture and operating system as your build target. A Dockerfile has been provided for arm64 linux development. (Raspberry Pis and alike)
25
36
[![✅ Checks](https://github.com/libhal/libhal-linux/actions/workflows/ci.yml/badge.svg)](https://github.com/libhal/libhal-linux/actions/workflows/ci.yml)
47
[![Coverage](https://libhal.github.io/libhal-linux/coverage/coverage.svg)](https://libhal.github.io/libhal-linux/coverage/)
58
[![GitHub stars](https://img.shields.io/github/stars/libhal/libhal-linux.svg)](https://github.com/libhal/libhal-linux/stargazers)
69
[![GitHub forks](https://img.shields.io/github/forks/libhal/libhal-linux.svg)](https://github.com/libhal/libhal-linux/network)
710
[![GitHub issues](https://img.shields.io/github/issues/libhal/libhal-linux.svg)](https://github.com/libhal/libhal-linux/issues)
811

9-
Platform library for linux series of devices.
12+
Userspace library for embedded linux
13+
14+
Git History for implementations of output_pin, input_pin, i2c, and serial can be seen [here](https://github.com/PhazonicRidley/libhal-linux-alpha)
1015

1116
## Contributing
1217

@@ -18,161 +23,35 @@ Apache 2.0; see [`LICENSE`](LICENSE) for details.
1823

1924
---
2025

21-
## Making a new platform driver (Delete section below)
22-
23-
Use [libhal/libhal-lpc40](https://github.com/libhal/libhal-lpc40/) as an
24-
example of the sections a README should have.
25-
26-
To make your own libhal library:
27-
28-
1. Press the green "Use this Template" button then.
29-
2. Press the "Create a new repository".
30-
3. Name it `libhal-<insert_platform_name>` and replace `<insert_platform_name>`
31-
with the name of the device's family. For exmaple, if you want to make a
32-
library for the stm32f103 which is in the stm32f1 series of MCUs then call
33-
it `libhal-stm32f1`.
34-
4. Choose where to put the repo under.
35-
5. Go to `settings` > `Pages` > `Build and deployment` > `Source` and set the
36-
source to `Github Actions`.
37-
6. Go to `Pull Requests` and merge the library rename pull request.
38-
7. Done!
39-
40-
## About the libhal-platform template
41-
42-
The `libhal-linux` repository is a template for creating platform
43-
libraries in the libhal ecosystem. It provides a structured layout and a set of files to help you get started with creating your own platform library.
44-
45-
## .github/workflows
46-
47-
This directory contains GitHub Actions workflow files for continuous integration
48-
(CI) and other automated tasks. The workflows currently included are:
49-
50-
- `ci.yml`: This workflow runs the CI pipeline, which includes
51-
building the project, running tests, and deploying the library to the
52-
`libhal-trunk` package repository.
53-
- `take.yml`: This workflow is responsible for the "take" action, which assigns
54-
commits to
55-
- `deploy-version.yml`: A helper CI workflow that builds the library for each
56-
target architecture/os/etc.
57-
- `0.0.1.yml`: A launch file. This file is used to manually release a version
58-
of the project via the "work dispatch" function of github actions.
59-
- `update_name.yml`: This workflow updates the name of the repository when it's
60-
used as a template for a new repository.
26+
## 📚 Software APIs & Usage
27+
To learn about available kernel APIs, documentation will be be made available soon.
6128

62-
## conanfile.py
29+
To see some example code on how various APIs are used, see the programs inside the `demos` folder.
6330

64-
This is a [Conan](https://conan.io/) recipe file. Conan is a package manager for
65-
C and C++ that helps manage dependencies in your project. This file defines how
66-
Conan should build your project and its dependencies.
31+
## 🧰 Setup
6732

68-
### Update topics
33+
Following the
34+
[🚀 Getting Started](https://libhal.github.io/2.1/getting_started/)
35+
instructions.
6936

70-
Add more tags to the `topics` attribute of your the file.
37+
## 📡 Installing Profiles
7138

72-
### Setting the processor library
39+
Coming soon, see important notice.
7340

74-
The default processor library used is `libhal-armcortex`. Replace the follow
75-
code block in the file with the appropriate processor library.
41+
## 🏗️ Building Demos
7642

77-
```python
78-
# Replace with appropriate processor library
79-
self.requires("libhal-armcortex/[^3.0.2]")
80-
```
81-
82-
### Adding available platforms
43+
**ON the device that is to run this code, a computer that is the same OS and architecture, or inside the provided docker container:**
8344

84-
```python
85-
options = {
86-
"platform": [
87-
"profile1",
88-
"profile2",
89-
"not-me"
90-
],
91-
}
45+
To build demos, start at the root of the repo and execute the following command:
46+
```bash
47+
conan build demos
9248
```
9349

94-
Replace `"profile1"` and `"profile2"` with the exact names of each platform in
95-
the platform's family. For example, in the `stm32f1` family of microcontrollers
96-
there are `stm32f100`, `stm32f101`, `stm32f102`, `stm32f103`, `stm32f105`, and
97-
`stm32f107`.
98-
99-
Keep `default_options` as it is.
100-
101-
## linker_scripts/libhal-linux
102-
103-
This directory contains linker scripts for different configurations of the
104-
platform. Each linker script specifies how the linker should arrange the
105-
sections of the program in memory.
106-
107-
Each platform specified in the `conanfile.py` file must have a corresponding
108-
linker script in this directory. For example, the `stm32f1` family of
109-
microcontrollers would have `stm32f100.ld`, `stm32f101.ld`, `stm32f102.ld`,
110-
`stm32f103.ld`, `stm32f105.ld`, and `stm32f107.ld`.
111-
112-
For details of how these linker scripts should be composed in your library,
113-
please see the documentation for the processor library used for the platform.
114-
Usually this information is put in the processor library's README.md.
115-
116-
## conan/profiles
117-
118-
This directory contains Conan profiles for different configurations of the
119-
platform. Each profile specifies a set of settings and options that Conan should
120-
use when building the project.
50+
## 💾 Flashing/Programming
12151

122-
Each platform specified in the `conanfile.py` file must have a corresponding
123-
profile in this directory. Using the `stm32f1` family as an example, you will
124-
have the following profiles: `stm32f100`, `stm32f101`, `stm32f102`, `stm32f103`,
125-
`stm32f105`, `stm32f107`.
52+
The easiest way to get your compiled program onto hardware like a Raspberry Pi is via ssh. (Assuming your hardware's linux installation has sshd).
12653

127-
For details of how these profiles should be composed in your library,
128-
please see the documentation for the processor library used for the platform.
129-
Usually this information is put in the processor library's README.md.
130-
131-
## datasheets
132-
133-
This directory is intended for storing data sheets related to the platform that
134-
the library is being built for. It currently contains a placeholder file,
135-
`placeholder.txt`.
136-
137-
Many data sheets are subject to copyright and that must be considered when
138-
adding the data sheet to a libhal repo. If the data sheet cannot be
139-
redistributed on the repo for copyright and/or license reasons, then a markdown
140-
file with a link to the data sheet (and potentially mirrors of it) is an
141-
acceptable alternative.
142-
143-
## demos
144-
145-
This directory contains demonstration applications showing how to use the
146-
platform library. It includes:
147-
148-
- `applications/blinker.cpp`: A sample application demonstrating usage of the
149-
platform library.
150-
- `main.cpp`: The main entry point for the demo applications.
151-
152-
## include/libhal-linux
153-
154-
This directory contains the header files for the platform library. It currently
155-
includes `output_pin.hpp`, which is a placeholder for the main header file of
156-
your platform library.
157-
158-
## src
159-
160-
This directory contains the source files for the platform library. It currently
161-
includes `output_pin.cpp`, which is a placeholder for drivers for this platform
162-
library.
163-
164-
## test_package
165-
166-
This directory contains a test package for the Conan recipe. It includes a
167-
simple application that uses the platform library, which helps verify that the
168-
Conan recipe is working correctly.
169-
170-
## tests
171-
172-
This directory contains tests for the platform library. It includes:
173-
174-
- `linux.test.cpp`: A placeholder for tests for the platform library.
175-
- `main.test.cpp`: The main entry point for the tests.
176-
177-
Remember to replace all instances of `linux` with the actual name of the
178-
platform that your library is being built for.
54+
Run the following command:
55+
```bash
56+
scp path/to/your.bin username@hardware_device:new_path/to/app
57+
```

demos/compile_commands 2.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[
2+
{
3+
"directory": "/code/demos/build/unspecified/Release",
4+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_gpio.dir/main.cpp.o -c /code/demos/main.cpp",
5+
"file": "/code/demos/main.cpp",
6+
"output": "CMakeFiles/linux_demos_gpio.dir/main.cpp.o"
7+
},
8+
{
9+
"directory": "/code/demos/build/unspecified/Release",
10+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_gpio.dir/applications/gpio.cpp.o -c /code/demos/applications/gpio.cpp",
11+
"file": "/code/demos/applications/gpio.cpp",
12+
"output": "CMakeFiles/linux_demos_gpio.dir/applications/gpio.cpp.o"
13+
},
14+
{
15+
"directory": "/code/demos/build/unspecified/Release",
16+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_blinker.dir/main.cpp.o -c /code/demos/main.cpp",
17+
"file": "/code/demos/main.cpp",
18+
"output": "CMakeFiles/linux_demos_blinker.dir/main.cpp.o"
19+
},
20+
{
21+
"directory": "/code/demos/build/unspecified/Release",
22+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_blinker.dir/applications/blinker.cpp.o -c /code/demos/applications/blinker.cpp",
23+
"file": "/code/demos/applications/blinker.cpp",
24+
"output": "CMakeFiles/linux_demos_blinker.dir/applications/blinker.cpp.o"
25+
},
26+
{
27+
"directory": "/code/demos/build/unspecified/Release",
28+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_i2c_test.dir/main.cpp.o -c /code/demos/main.cpp",
29+
"file": "/code/demos/main.cpp",
30+
"output": "CMakeFiles/linux_demos_i2c_test.dir/main.cpp.o"
31+
},
32+
{
33+
"directory": "/code/demos/build/unspecified/Release",
34+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_i2c_test.dir/applications/i2c_test.cpp.o -c /code/demos/applications/i2c_test.cpp",
35+
"file": "/code/demos/applications/i2c_test.cpp",
36+
"output": "CMakeFiles/linux_demos_i2c_test.dir/applications/i2c_test.cpp.o"
37+
},
38+
{
39+
"directory": "/code/demos/build/unspecified/Release",
40+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_uart.dir/main.cpp.o -c /code/demos/main.cpp",
41+
"file": "/code/demos/main.cpp",
42+
"output": "CMakeFiles/linux_demos_uart.dir/main.cpp.o"
43+
},
44+
{
45+
"directory": "/code/demos/build/unspecified/Release",
46+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_uart.dir/applications/uart.cpp.o -c /code/demos/applications/uart.cpp",
47+
"file": "/code/demos/applications/uart.cpp",
48+
"output": "CMakeFiles/linux_demos_uart.dir/applications/uart.cpp.o"
49+
},
50+
{
51+
"directory": "/code/demos/build/unspecified/Release",
52+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_steady_clock_test.dir/main.cpp.o -c /code/demos/main.cpp",
53+
"file": "/code/demos/main.cpp",
54+
"output": "CMakeFiles/linux_demos_steady_clock_test.dir/main.cpp.o"
55+
},
56+
{
57+
"directory": "/code/demos/build/unspecified/Release",
58+
"command": "/usr/bin/clang++-17 -I/code/demos/. -isystem /root/.conan2/p/b/libhaf431e523fb55f/p/include -isystem /root/.conan2/p/b/libhac2ef268c2495b/p/include -isystem /root/.conan2/p/libha6f1566c3082ef/p/include -isystem /root/.conan2/p/tl-fu31454aa876889/p/include -stdlib=libc++ -O3 -DNDEBUG -std=c++23 -o CMakeFiles/linux_demos_steady_clock_test.dir/applications/steady_clock_test.cpp.o -c /code/demos/applications/steady_clock_test.cpp",
59+
"file": "/code/demos/applications/steady_clock_test.cpp",
60+
"output": "CMakeFiles/linux_demos_steady_clock_test.dir/applications/steady_clock_test.cpp.o"
61+
}
62+
]

0 commit comments

Comments
 (0)