Using ST-Link Instead of USB for Patching on Minimal Ksoloti Core

Hi,
I’m working on a minimal version of the Ksoloti Core and would like to remove the USB port to save space, as my module needs to be as compact as possible.
Would it be possible to use the patcher software via an ST-Link programmer instead of USB, so that I can completely omit the USB interface?

Thanks in advance!

1 Like

Hi, I believe we need to differentiate if you mean to have your mini Core connected to the Patcher, then no, I do not think ST-Link can mimick a USB connection. The Patcher and Core exchange a lot of data via USB, like real-time knob updates, waveform displays, CPU usage, file actions on SD card, even basic commands like “start patch”, “stop patch”, “upload patch to flash/sd” are just serial command packets sent via USB.

But if you mean you create your patch in the Patcher, then, in a sort of non-real-time way, upload it to your Core via ST-Link, I believe that would be possible.

  • First, you would activate Expert Mode by editing the ksoloti.prefs file and setting <ExpertMode>false</ExpertMode> to <ExpertMode>true</ExpertMode>.
  • This will unlock additional menu entries in the Patch window: Patch > Generate code, Patch > Compile code. You would use these two to create the patch binary, which would be saved either as {HOME}/ksoloti/build/xpatch.bin (1.0.12), or as {HOME}/ksoloti/{VERSION}/build/{UNIQUE SUBFOLDER STRUCTURE}/{uniquepatchname}.bin (1.1.0+), depending on the Patcher version.
  • This .bin you would upload via ST-Link to a specific memory address, which is the memory address the “internal flash startup patch“ is saved to. It is a define called PATCHFLASHLOC and you can find it here.
  • Make sure the patch bin was created with the same firmware version you’re running on your Core, as there is a CRC check upon every startup if the patch matches the current firmware. If you use the firmware supplied with the patcher (firmware/build/ksoloti.bin) you should be safe, though since you mention you’re creating your own mini board, you may have done some custom firmware edits? Anyway, all the Patcher cares about is the ksoloti.bin/axoloti.bin etc. it sees inside its firmware/build folder, as it creates a CRC based on that. Hard to explain in a few sentences, really!
  • If the patch .bin upload via ST-Link was successful and the patch CRC matches the firmware CRC, the patch should start automatically after you reboot your Core.
  • Once you have your firmware+startup patch combo running successfully, you can actually duplicate the whole flash content to get an all-in-one working binary, meaning you can flash virgin mini Cores with just that binary to have firmware and matching startup patch ready and running. This approach works well, I use ST’s CubeProgrammer to read and write such binaries.

This is the theory of it… Of course I may have overlooked or forgotten something…