This thread: https://sebiik.github.io/community.axoloti.com.backup/t/maximum-patch-size/1483/12 started out as a question about the maximum size of a patch, but in the end I determined that there is bug in ramlink.ld, which puts a couple of arrays before the patch init function. The net result is that when the firmware calls PATCHMAINLOC to initialize the patch, the data in the arrays (pointers) are interpreted as code, which is then run before the actual init function, which can potentially wreck havoc with patch initialization.
Problems I've seen include:
- Axoloti Core crashes and/or restarts
- Patch performs init properly but refuses to run
The fix is simple, simply put the arrays in question after the text segment in the patch binary, so that PATCHMAINLOC is actually the start of the patch init function.
I've got a patch ready in my github repository (https://github.com/polluxsynth/axoloti/tree/fix-patch-init) which I've tested with complete success in my own setup. @johannes, let me know if you want me to rework it, or raise an issue in the Axoloti github repository, etc.