-
Notifications
You must be signed in to change notification settings - Fork 2
Getting started
Welcome to WhateverDSP (wdsp for short)!
This guide aims to give a beginner-level introduction to setting up your project. It is a work-in-progress and help is appreciated!
This introduction assumes:
- You will be programming in C. You don't have to know much of it to get started.
- You are running Linux or Mac OS (Mojave and up has been tested).
- You have downloaded and set up Visual Studio Code.
The following extensions are necessary for you to use VS Code effectively:
- C/C++
- Cortex-debug
You will need the following packages installed:
-
arm-none-eabi-gcc
GCC toolchain -
arm-none-eabi-newlib
C library -
arm-none-eabi-gdb
andopenocd
for use with
Optionally, if you want to flash the board using DFU:
dfu-util
You can use brew
to install the necessary dependencies:
brew install gcc-arm-embedded gdb openocd
Optionally, if you want to flash the board using DFU:
brew install dfu-util
After you have your toolchain set up, you can download WhateverDSP. You can:
- Download the repository as a ZIP file and include it as a subfolder in your project folder (or elsewhere on your disk), or
- Include this library into your project as a git submodule.
Once you have WhateverDSP
on your disk, you need to create a Makefile
in your project folder. A minimal setup follows:
# Makefile
# Your project name
TARGET = example
# Target board- at the moment there is just the one
BOARD = wdsp-dev
# Point this whereever you cloned WhateverDSP
include WhateverDSP/libwdsp.mk
You can then run:
make init
to initialise a default project. It will:
- Create a
config.ini
- Create your main target file (in this case
example.c
). - Run
make vscode
if there is no.vscode
folder.
Open the target file (example.c
) to get started!
To start running and debugging your project, first invoke:
make vscode
This sets up a workspace with all required settings to get you started with development and debugging in VSCode.
Connect your STLinkV3-Mini debugger to your computer and plug in the cable to the debug header on the dev board (just under the DC power jack). You can now hit F5 to run the project and start debugging directly on the hardware!
If you want to show CPU usage graphs while debugging, uncomment the "System Load" section inside .vscode/launch.json
.
In the example Makefile configuration, WhateverDSP would automatically compile the example.c into a ready to flash binary once you invoke make
. For more complex projects you can specify your own dependencies like usual.
If you have dfu-util
installed the resulting binary can be flashed onto the board by connecting it to your computer via USB, holding down the "Boot" button while plugging the 9V DC power in, and running make dfu
.