Magus doesn't connect anymore

Hello !

I’m having a little issue here. I was trying many different library patches over windows chrome until device stopped responding.

The last patch I was trying is acid groovebox. It never loaded in Magus so I erased/reset, maybe once or twice and the device started led flashing about every second. top left led being yellow (load color) and the rest blue. Flash is low except once in while it gets brighter (and color changes maybe ?).

After a little wait I simply repowered it and now it’s stucked like this every time I restart Magus. Device is not anymore detected whichever I try on windows or linux. So I cannot attempt a new erase/reset through browser.

Also worth mentioning I had another bug with the screen when I tried another patch. The screen sort of zoomed and parameters stopped responding before device restarted itself.

It was fw v21.0

Would you happen to have an ST-link programmer on hands?

I’m afraid I don’t. Could you link me infos about what I’d need ?
Is it what’s needed for building the fw ?

Otherwise I have a second digital board from a prototype that we made with @mars back then. I’m not using it, it’s mk2 same rev but not built for magus initially. I don’t know if that’s compatible.

We should probably wait for Martin, but I think that the preferred solution would be to replace board with the spare one and later you can restore original board with a programmer. You can find a Chinese clone of ST-link v2 in any major electronics store and they are very cheap. I’ve posted some info about connecting programmer here - Connecting programmer to Magus , but you don’t need to solder if you just have to reflash it once. It can be done by powering digital board from USB and connecting programmer to those pins (with digital board removed from the main breakout board).

The problem with Magus is that it doesn’t have a hardware button to return to bootloader mode. So if it can’t boot firmware, you can’t return to bootloader to restore correct firmware. We have an updated bootloader version that can be flashed with a programmer or from a running firmware. The updated bootloader would enable hardware watchdog that resets to bootloader if device hangs (i.e. if firmware can’t boot), this would solve your problem.

Oh yeah, if you have any ST Nucleo boards or something else with SWD programming support, that would probably work too.

owh yes I have this STM32F429I-DISC1. I see SWD pins on it.
So could that be used instead of st-link clone ?

I’m reading a bit of building-the-magus-firmware to get to understand better what’s need to be done.

Why do you need i/o and digital board to keep connected ? Is it so that you can try your fw hacks quicker ?
Can I simply take digi board off and connect four jumpers to my stm kit for flashing ?

Yeah, I’ve described how to use for debugging firmware on a fully functional device. For flashing you should just remove board to avoid soldering. Also, you should check manual for Discovery board, but at least on Nucleo boards you would typically have to change jumpers to use it as a programmer for other devices. Sometimes there’s a solder bridge to remove, etc.

Thanks for helping !

I’m not very familiar with all this FW stuff but I’m keen to learn. So I’ve been reading other discussions and I am not sure I understood everything correctly so I’ll try to resume.

The MidiBoot (or bootloader) is what makes magus visible as a midi device via usb connection. Some incorrect firmware can disable it because the bootloader isn’t able to reset itself. Then the only way to load a FW is to use a programer to flash FW with SWD connectors.
If FW flash is successful, I’ll have the bootloader set as it was before and my device behaving exactly as it was before with the same FW.

Then there is this thing about updating the bootloader so that it can reset itself. It is not yet a stable feature (why?). But as long as you have a programer and you are ok to remove the digi board everytime you want to reflash you’re fine.

Now I am not sure how you flash with SWD. I saw a video where you use this st-link utility to flash .hex or .bin files to your device (using program and verify). How do I get these FW files ?

Another thing worth mentioning is that the midi command did not work last time I tried with magus. I have some data overflow issues which I did not know how to fix. So flashing FW the old way could be a solution for that if I decide I do some FW hacking.

You’re right, bootloader update should be sufficient for making it possible to update firmware. It’s not advertised yet, because it’s something that I’ve added to firmware just recently. So latest FW version must be installed first before bootloader can be updated without a programmer. Eventually there should be a recommendation to do this for Magus owners, it’s not a problem for most other devices.

You can build bootloader with something similar to this:

git clone git@github.com:pingdynasty/OpenWare.git
cd OpenWare
git checkout develop
git submodule update --init
cd MidiBoot
make PLATFORM=Magus unlock upload

That’s the general direction, you might have to change TOOLROOT variable to point to gcc-arm directory like for building patches, etc. But most stuff is done with Makefile in that directory. You need openocd installed for it to work.

Regarding SWD pins, see this schematic, they are on the same location on newer revisions - https://www.openwarelab.org/OWL_Digital/Legacy/Owl-digital-pinout.pdf .

You can also erase patch storage with make erase-storage command in MidiBoot directory. It can be done with a MIDI command too, but probably easier to use programmer if you’ll have it connected.

I got some errors with both erase and upload makes. I only did them once.
But after I tried reconnecting to the i/o board, I noticed the usb connection worked and magus was V21.0
So from that point I just erased / reset from the patch library and then reflash from the uploader web page, don’t think that was necessary but just in case… Now it should be as it was before :innocent:

Not sure why all this happened in the first place… I tried the same acid groove box patch which doesn’t load but get stored.

You have to run “make unlock” before you can flash the updated bootloader. This can be done with openocd/programmer or by MIDI with command like this: OpenWare/openware-notes.txt at develop · pingdynasty/OpenWare · GitHub , maybe a different device ID depending on your audio setup.

After it’s unlocked you can send bootloader sysex to firmware to install an updated version, i.e.

make PLATFORM=Magus sysex
amidi -p hw:1 -s Build/MidiBoot-Magus.syx

You can see bootloader version in UI settings menu (near CPU/flash usage) if you update it successfully.