Skip to content
Snippets Groups Projects
Commit 6b9c1486 authored by Pascal Koch's avatar Pascal Koch
Browse files

Sussy commit

parents
Branches
No related tags found
No related merge requests found
Showing
with 382 additions and 0 deletions
build
\ No newline at end of file
[submodule "pico-sdk"]
path = pico-sdk
url = https://github.com/raspberrypi/pico-sdk.git
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.hexeditor",
"ms-vscode.vscode-embedded-tools",
"ms-vscode.cmake-tools",
"twxs.cmake"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack",
"ms-vscode.makefile-tools"
]
}
\ No newline at end of file
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/main.elf",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "gdb-multiarch",
"miDebuggerServerAddress": "localhost:3333",
"preLaunchTask": "build",
"internalConsoleOptions": "neverOpen",
"postRemoteConnectCommands": [
{
"text": "monitor reset init"
},
{
"text": "load"
}
],
"svdPath": "${workspaceFolder}/pico-sdk/src/rp2040/hardware_regs/RP2040.svd"
}
],
}
\ No newline at end of file
{
"task.quickOpen.skip": true,
"task.autoDetect": "off",
"workbench.editor.editorActionsLocation": "hidden",
"cmake.options.advanced": {
"build": {
"statusBarVisibility": "inherit",
"inheritDefault": "hidden"
},
"launch": {
"statusBarVisibility": "inherit",
"inheritDefault": "hidden"
},
"debug": {
"statusBarVisibility": "inherit",
"inheritDefault": "hidden"
}
},
"cmake.debugConfig": {
"miDebuggerPath": "arm-none-eabi-gdb",
"setupCommands": [
{
"text": "target extended-remote :3333"
},
{
"text": "load ${command:cmake.launchTargetPath}"
}
]
},
"files.exclude": {
"**/.*": true
},
"files.associations": {
"*.hpp": "cpp",
"*.cpp": "cpp",
"*.h": "c",
"*.c": "c"
}
}
\ No newline at end of file
{
"version": "2.0.0",
"presentation": {
"reveal": "silent"
},
"tasks": [
{
"label": "openocd",
"icon": {
"id": "debug"
},
"type": "shell",
"command": "openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c 'adapter speed 5000'",
"problemMatcher": [],
"runOptions": {
"runOn": "folderOpen"
}
},
{
"label": "configure",
"icon": {
"id": "settings-gear"
},
"type": "cmake",
"command": "configure",
"runOptions": {
"runOn": "folderOpen"
}
},
{
"label": "build",
"icon": {
"id": "wrench"
},
"type": "cmake",
"group": "build",
"command": "build"
}
]
}
\ No newline at end of file
cmake_minimum_required(VERSION 3.10)
include(pico-sdk/pico_sdk_init.cmake)
project(ES VERSION 1.0)
pico_sdk_init()
include_directories(include)
add_executable(
main
src/main.c
)
target_link_libraries(main pico_stdlib)
\ No newline at end of file
README.md 0 → 100644
# Downlaod
```bash
git clone --recursive git@code.fbi.h-da.de:eingebettete-systeme/raspberry-pi-pico/ws2024.git
```
oder
```bash
git clone git@code.fbi.h-da.de:eingebettete-systeme/raspberry-pi-pico/ws2024.git
git submodule update --init --recursive
```
Wenn ihr eures eigenes git Benutzten wollt müsst ihr den `.git` Ordner löschen.
```bash
rm -rf .git
git init
git add .
...
```
# Entwicklungsumgebung
Im Rahmen des Praktikums kommen folgende Entwicklungstools zum Einsatz:
```
code (Visual Studio Code)
cmake
openocd
minicom
arm-none-eabi-binutils
arm-none-eabi-gcc
arm-none-eabi-gdb
arm-none-eabi-newlib
```
Für VSCode brauchen wir folgende Erweiterung:
- [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
- [Hex Editor](https://marketplace.visualstudio.com/items?itemName=ms-vscode.hexeditor)
- [Embedded Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-embedded-tools)
- [CMake](https://marketplace.visualstudio.com/items?itemName=twxs.cmake)
- [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
## Virtual Box
Ein aktualisiertes OVA Linux-Image für VirtualBox ist auf der [Labor-Webseite](https://fbi.h-da.de/studium/labore/mikroprozessor) verfügbar. Dieses Image enthält bereits alle erforderlichen Entwicklungstools vorinstalliert. Bitte beachten Sie, dass beim Einsatz von VirtualBox die notwendigen USB-Geräte entsprechend durchgereicht werden müssen.
## Windows WSL
Eine detaillierte Installationsanleitung für WSL finden Sie auf der [offiziellen Microsoft-Webseite](https://learn.microsoft.com/de-de/windows/wsl/install). Um die Installation zu starten, führen Sie den folgenden Befehl in PowerShell aus:
```powershell
wsl --install
```
Um USB-Geräte innerhalb von WSL verwenden zu können, nutzen wir USB/IP. Eine ausführliche Installationsanleitung dazu finden Sie [hier](https://learn.microsoft.com/de-de/windows/wsl/connect-usb). Installieren Sie USB/IP unter Windows mit dem folgenden PowerShell-Befehl:
```powershell
winget install --exact dorssel.usbipd-win
```
Die angeschlossenen USB-Geräte können mit dem folgenden Befehl in PowerShell angezeigt werden:
```powershell
usbipd list
```
Die Ausgabe des Befehls sollte in etwa folgendermaßen aussehen:
```
Connected:
BUSID VID:PID DEVICE STATE
10-1 2e8a:000c CMSIS-DAP v2 Interface, USB Serial Device (COM4) Not shared
Persisted:
GUID DEVICE
```
Bevor ein USB-Gerät an WSL angebunden werden kann, muss das Gerät für die Freigabe mittels des Befehls `usbipd bind` vorbereitet werden. Dieser Schritt erfordert Administratorrechte. Nach der Bindung sollte der Status des Geräts auf "Shared" wechseln. Verwenden Sie den folgenden Befehl in PowerShell mit Administratorrechten, um das Gerät freizugeben:
```powershell
usbipd bind -i 2e8a:000c
```
Das USB-Gerät kann mit dem folgenden Befehl an WSL angebunden werden. Dieser Schritt muss nach jedem Neustart des Computers wiederholt werden. Eine Automatisierung ist durch den Einsatz des Aufgabenplaners (`taskschd.msc`) möglich:
```powershell
usbipd attach -awi 2e8a:000c
```
Für die Installation der Tools innerhalb von WSL, beziehen Sie sich bitte auf die [Ubuntu-Installationsanleitung](#ubuntu).
Für die Entwicklung mit [Visual Studio Code](https://code.visualstudio.com/) verwenden wir die [WSL-Erweiterung](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl), die eine nahtlose Integration von VSCode mit dem Windows Subsystem for Linux ermöglicht. Eine detaillierte Anleitung zur Einrichtung und Nutzung finden Sie [hier](https://code.visualstudio.com/docs/remote/wsl).
In der Konfigurationsdatei `.vscode/launch.json` muss der `miDebuggerPath` auf `gdb-multiarch` angepasst werden, um den entsprechenden Debugger für die Entwicklung zu spezifizieren. Der angepasste Teil der Konfiguration sollte wie folgt aussehen:
```json
{
"configurations": [
{
"miDebuggerPath": "gdb-multiarch",
}
],
}
```
## Ubuntu
```bash
sudo apt install make openocd minicom binutils-arm-none-eabi gcc-arm-none-eabi gdb-multiarch libnewlib-arm-none-eabi
```
## Archlinux
btw
```bash
pacman -S make openocd minicom arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-newlib
```
\ No newline at end of file
File added
File added
File added
File added
File added
# Don't accidentally pick up external CMake deps with Bazel build files.
build
# Don't treat submodules as part of this project.
lib
# Required for new toolchain resolution API.
build --incompatible_enable_cc_toolchain_resolution
build --@rules_cc//cc/toolchains:experimental_enable_rule_based_toolchains
# Silence all C/C++ warnings in external code.
common --per_file_copt=external/.*@-w
common --host_per_file_copt=external/.*@-w
# Produce useful output when the build fails.
common --verbose_failures
7.2.1
_Instructions: (please delete)_
- _please do not submit against `master`, use `develop` instead_
- _please make sure there is an associated issue for your PR, and reference it via "Fixes #num" in the description_
- _please enter a detailed description_
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="gcc-arm-embedded" version="10.2.1" />
<package id="cmake" version="3.25.2" installArguments="ADD_CMAKE_TO_PATH=System" />
<package id="mingw" version="12.2.0" />
<package id="ninja" version="1.11.1" />
</packages>
name: CMake
on:
push:
branches-ignore:
- 'iar/**'
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# cannot specify filter for pull_request in on: above, so do it here
if: github.repository_owner == 'raspberrypi' && (github.event_name != 'pull_request' || !startsWith(github.head_ref, 'iar/'))
runs-on: [self-hosted, Linux, X64]
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout repo
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPICO_SDK_TESTS_ENABLED=1
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)
name: Build on macOS
on:
workflow_dispatch:
push:
branches:
- 'develop'
- 'master'
- 'test_workflow'
jobs:
build:
runs-on: macos-12
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout repo
uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init
- name: Install dependencies
run: |
brew install cmake
brew install --cask gcc-arm-embedded
- name: Build Project
# bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
shell: bash
run: |
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w
cmake --build .
- name: Build Native
# bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
shell: bash
run: |
mkdir build_native
cd build_native
cmake .. -G "Unix Makefiles" -DPICO_SDK_TESTS_ENABLED=1 -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=host
cmake --build .
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment