./Src/usb_host.c:26:24: fatal error: usbh_audio.h: No such file or directory
That's actually expected. It's a side effect due to CubeMX generating some files that we don't want to use (i.e. that usbd_audio_if.c file). There's a script "cube-update.sh" in Magus directory that you should run to restore everything in order.
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"
I'm not sure why is there include for Biosignals, but you're not suppose to use it when building Magus files.
- Is there a way to upgrade the firmware without building it myself?
Yes, certainly. This (and many other stuff) is exposed to MIDI protocol, example usage for Linux is here . You'll need to build this firmware sender program to convert firmware to SySex, then call bootloader mode, upload firmware and restart device.
Here's script that I use (you probably will have to change device HW id for ALSA):
#!/bin/bash
PROJECT=Magus
make clean
TOOLROOT=`pwd`/../Tools/gcc-arm-none-eabi-9-2019-q4-major/bin/ make -j17 CONFIG=Release PLATFORM=MagusBus || exit 1
FirmwareSender -in Build/${PROJECT}.bin -flash `crc32 Build/${PROJECT}.bin` -save ${PROJECT}.syx || exit 1
echo "Entering bootloader mode"
amidi -p hw:3,0,0 -S f07d527ef7 || exit 1
sleep 1
echo "Sending firmware"
amidi -p hw:3,0,0 -s ${PROJECT}.syx || exit 1
sleep 1
echo "Restart"
amidi -p hw:3,0,0 -S f07d527df7 || exit 1
echo "Done!"
The README references an "openocd"?
Openocd is the program that you would use for debugging with a programmer. You can also use it to burn firmware.
Can't comment on USB issues as I don't use it myself. Other than that:
- the encoder issue is something that I've fixed myself, I think it was included in one of the recent firmware releases
- you'll probably have to do it yourself, but the code for accessing MAX11300 that Magus uses is present in HAL_MAX11300.* files. Also, there's an example of access to that GPIO peripheral from Owl internals. It definitely possible to expose it to user patches if you want to add a custom service call for that.
- you don't need a custom firmware to draw or use any device-specific functions - just build code for your device in OwlProgram repo
Besides this, you should get St-link v2 programmer before trying any sort of custom firmware on Magus. Otherwise you can end up with unbootable device that you can't recover (without programmer). I've made a guide about connecting it a while ago.
Also, it's possible to update bootloader to a newer version that would return to bootloader mode if you boot unusable firmware. Again, this needs a programmer.