Skip to content

everedero/asynthosc_fw

Repository files navigation

AsynthOsc Zephyr RTOS firmware

This repository contains the firmware application for the AsynthOsc project. The hardware design for the board is available here.

This board is based upon STM32H743VITx.

This repository depends on the Zephyr project. The manifest is used the select the compatible Zephyr version.

Note: do not "git clone" this project, see installation instructions to run "west init" in order to initialize the project.

Probe connection

Connect ST-Link

You will need an ST-Link probe to flash the firmware to the board. Two different connectors allow to flash the board:

  • J4, a standard 2.54mm header, to be soldered on bottom side
  • J3 TagConnect, a pogo pin solution, no soldering needed but you will have to make a custom cable.

Pinout

DUT connectors
J4 JTAG connector

This pinout follows the ST-Link connector pinout, with an additional row for JTAG JTDI. The second column in only GND, it was added for connector mechanical stability and easy GND access.

Kroki generated Ditaa

J3 TagConnect TC2030

TBD: Not sure about this pinout. The J3 pinout follows the manufacturers's recommendation for JTAG.

ST-Link connectors
Nucleo ST-Link/V2 pinout CN2

If you are using the ST-Link embedded on a Nucleo board as your debugger, do not forget to remove the 2 jumpers CN2, as shown on the overlay.

  • Jumpers equipped: flash the Nucleo
  • Jumpers removed: flash an external board connected on CN2

You can even separate the ST-Link part from the Nucleo part with the breakout pads!

Kroki generated Ditaa

BlackMagic Probe on STM32F103RCT6 breakout board

This adapter was made following instructions here using a STM32F103 breakout board

  • In order to flash the BlackMagicProbe on the STM32F106 board
ST-Link connector pin Name STM32F106 breakout
1 3V3 3V3
2 JTCK A14
3 GND G
4 JTMS A13
5 nRST RST
  • Once BlackMagic is flashed, the STM32F106 becomes the probe with the following pinout
ST-Link connector pin Name STM32F106 breakout
1 3V3 NE (R bridge to A0)
2 JTCK A5
3 GND G
4 JTMS B14 (100o B12)
5 nRST B0
6 JTDO A6
7 JTDI A7
  • Pin 4 (SWDIO) needs to be connected to B14 and also to B12 via a 100 ohms resistor
  • 3V3 is the target voltage detection, it needs a divide-by-two resistor bridge to A0 to be working correctly

The adapter also provides a target debug UART:

UART Target STM32F106 UART STM32F106 breakout
TX RX A3
RX TX A2

In order to install the adapter, you will have to configure udev rules (on Linux) or install a custom driver (on Windows) so that the BlackMagic probe serial connections will appear with aliases "/dev/ttyBmpTarg" and "/dev/ttyBmpGdb".

The configuration files are available here.

Official ST-LinK/V2

Oh yeah, you can actually by the probe too. Be careful when buying those, there are quite a fair amount of ST-Link counterfeits and not all of them are fully functional.

Kroki generated Ditaa

Pinout recap
JTAG Signal SWIO Signal Board J4 Board TagConnect J3 Nucleo ST-Link CN2 ST-Link 2x10
JTCK SWCLK 3 4 2 9
JTMS SWDIO 7 2 4 7
JTDI 13 NC NC 5
JTDO SWO 11 6 6 13
nRST nRST 9 3 5 15
VDD VDD 1 1 1 19
GND GND 5, 2-14 5 3 2-20

Connect UART

No USB-UART chip is provided onboard, you will need to get a third party 3V3 USB-UART gizmo such as the FTDI one or any equivalent.

The Zephyr debug UART is set up to be RX2 and TX2, and 115200 2N1.

Kroki generated Ditaa

Software compilation

Before getting started, make sure you have a proper Zephyr development environment. Follow the official Zephyr Getting Started Guide.

Quick summary:

  • Install a venv and activate it
  • Then install west meta-tool:
pip3 install west

Initialization

The first step is to initialize the workspace folder (my-workspace) where the asynthosc-application and all Zephyr modules will be cloned. Run the following command:

  • Initialize my-workspace for the asynthosc-application (main branch)
west init -m https://github.com/everedero/asynthosc_fw --mr main my-workspace
  • Update Zephyr modules
cd my-workspace
west update

Git key magic

By default west configures the repository to be http identification, if you want to get back to ssh, you can do it with:

git config remote.origin.url [email protected]:everedero/asynthosc_fw.git

Building and running

To build the application, run the following command:

cd asynthosc_fw
west build -b asynthosc app

You can use the asynthosc board found in this repository. Note that Zephyr sample boards may be used if an appropriate overlay is provided (see app/boards).

Once you have built the application, run the following command to flash it:

west flash

Emulation

This project supports emulation. Left and right pushbuttons are emulated by keyboard left and right. Rotary encoder click is by keyboard enter.

west build -b native_sim/native/64 app

Then, execute:

./build/zephyr/zephyr.exe -display_zoom_pct=200

Testing

To execute Twister application tests, run the following command:

west twister -T app --integration

Notes for USB to OSC

Interact with echo server

UDP echo server
ncat -e /bin/cat -k -u -l 4242
Server display, not echo
nc -lu 4242

Compile Shell over USB support

It means we don’t need an FTDI

cd ~/zephyrproject/zephyr/samples/subsys/shell

west build -p always -b asynthosc ./shell_module -DOVERLAY_CONFIG=overlay-usb.conf -DDTC_OVERLAY_FILE=usb.overlay

Documentation

A minimal documentation setup is provided for Doxygen and Sphinx. To build the documentation first change to the doc folder:

cd doc

Before continuing, check if you have Doxygen installed. It is recommended to use the same Doxygen version used in CI. To install Sphinx, make sure you have a Python installation in place and run:

pip install -r requirements.txt

API documentation (Doxygen) can be built using the following command:

doxygen

The output will be stored in the _build_doxygen folder. Similarly, the Sphinx documentation (HTML) can be built using the following command:

make html

The output will be stored in the _build_sphinx folder. You may check for other output formats other than HTML by running make help.

About

Firmware for asynthosc project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 18