I have had a Magus for about a year but not really been able to use it because of some problems*. I think maybe the problems either are fixed in a newer firmware version (the website says my device is running v20.5) or I could maybe fix myself if I had the source. I could not find any instructions on where to get upgrade firmware or how to install firmware. I decided to build the source myself. I could not get it to compile (I got as far as linker errors). Here are the steps I followed:
(Steps performed on a Windows 10 machine, with Ubuntu for Linux for Windows already installed.)
- I downloaded and installed ā64-bit java for windowsā. https://www.java.com/en/download/windows-64bit.jsp
- I rebooted.
- I signed up for an account on st.com.
- I installed STM32CubeMX. STM32CubeMX - STM32Cube initialization code generator - STMicroelectronics
- I checked out GitHub - pingdynasty/OpenWare: Firmware for OWL devices to my Windows home directory, using a git client in Ubuntu for Linux. I got git revision
10a981bf68a2
from thedevelop
branch. - I ran STM32CubeMX.
- I selected an existing project and opened Magus/Magus.ioc. I migrated the project to the current version. I clicked āgenerateā
- I got a āWARNING: When RTOS used strongly recommended to use HAL timebase instead of Systickā. I ignored this.
- I selected an existing project and opened Magus/Magus.ioc. I migrated the project to the current version. I clicked āgenerateā
- In Ubuntu for Windows:
- I installed gcc (with
sudo apt install gcc-arm-none-eabi
). (I closed and reopened the Ubuntu terminal at this point.) - I DID THIS STEP, BUT ANYONE ELSE READING THESE STEPS SHOULDNāT: I edited checkout directory
common.mk
and replaced the GIT_REVISION line with:
GIT_REVISION = $(hg id)
This step is a byproduct of the git client I use.
- I changed magus: to _magus: in checkout directory
Makefile
. (This is because āmake magusā will instantly succeed because the Windows partition is case insensitive and so it treats the directory āMagusā like a file called āmagusā. I think .PHONY might also be a way to fix this.) - Ran
make _magus TOOLROOT=
in checkout directory. (TOOLROOT= is becuase the eabi tools are already in PATH thanks to apt.)
- I installed gcc (with
This is where things went wrongā¦
I got this error:
make[1]: Entering directory '/mnt/c/Users/Andi/work/gh/OpenWare/Magus'
./Src/usb_host.c:26:24: fatal error: usbh_audio.h: No such file or directory
I figured, the Makefile forgot to set one of the include directories. So I tried running again with an -I
in CPPFLAGS. This lead to more include-not-found errors, which again I was able to correct by adding -I
s.
make clean
PWD=`pwd` make _magus TOOLROOT= CPPFLAGS="-I$PWD/Magus/Inc -I$PWD/Biosignals/Inc -I$PWD/Magus/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Inc -I$PWD/Source -I$PWD/LibSource"
This gave me the errorsā¦
Build/usb_host.o: In function `MX_USB_HOST_Init':
usb_host.c:(.text+0xac): undefined reference to `AUDIO_Class'
Build/usbd_audio_if.o: In function `TransferComplete_CallBack_FS':
usbd_audio_if.c:(.text+0x20): undefined reference to `USBD_AUDIO_Sync'
Build/usbd_audio_if.o: In function `HalfTransfer_CallBack_FS':
usbd_audio_if.c:(.text+0x2c): undefined reference to `USBD_AUDIO_Sync'
./Drivers/CMSIS/DSP/Source/CommonTables/arm_const_structs.o:(.rodata+0xc): undefined reference to `realCoefAQ15'
./Drivers/CMSIS/DSP/Source/CommonTables/arm_const_structs.o:(.rodata+0x10): undefined reference to `realCoefBQ15'
./Drivers/CMSIS/DSP/Source/CommonTables/arm_const_structs.o:(.rodata+0x24): undefined reference to `realCoefAQ15'
./Drivers/CMSIS/DSP/Source/CommonTables/arm_const_structs.o:(.rodata+0x28): undefined reference to `realCoefBQ15'
./Drivers/CMSIS/DSP/Source/CommonTables/arm_const_structs.o:(.rodata+0x3c): undefined reference to `realCoefAQ15'
Many more errors of the same type as the last five follow.
I am not sure how to proceed. Grep suggests that realCoefAQ15 could be supplied either by a source file named arm_const_structs.c
, or any of a variety of lib files in ./Magus/Drivers/CMSIS/Lib/ARM/
.
My questions are:
- Is there a way to make this build work?
- Would the build work out of the box if I were building some other revision? For example instead of
10a981bf68a2
should I be building master or one of the release/ tags? - Is there a way to upgrade the firmware without building it myself?
- Once I have completed a build, how do I upload it to the device? (The README references an āopenocdā?)
Thanks.
* The problems Iām currently having with Magus that prevent me from using it as an instrument:
- MIDI input via the āHOSTā USB port is often dropped or late.
- When I turn a knob (any knob) a tick in one direction, it always registers one increment ābackwardā. If I turn it a second tick in the same direction, it will turn forward and return me to the starting point. I have to tick three times to move a value in the intended direction. This makes ālive playā almost impossible.
- āNice to haveā: I would like to be able to set the refresh rate and voltage range on the ābottom patch panelā ports.
- āNice to haveā: I would like to be able to draw to the screen. Apparently the website doesnāt have the headers for this but the OpenWare git repo does.