Microblaze magic is great. But how to convert magic cell into a loadable binary in easy way?

I wrote some code with microblaze magic cell in Jupyter notebook. It is good for implement and debug microblaze code. However when code is final done. It takes time to compile on fly every time when I run the notebook. One way to speed up is rewrote in a normal microblaze device code. So the code need to modify into a main() with big mailbox loop. I wonder why we can’t get the result of microblaze magic and reuse it? Why we need to do thing twice?

Since microblaze magic compile our magic cell code into elf and convert it to binary in pynq.lib.pynqmicroblaze.compile. Create python class mapping to those C function in pynq.lib.pynqmicroblaze.rpc. I found that the C code was saved in /tmp/last.c then make a /tmp/last.elf there. That is mean I can convert it by mb-objcopy. Then I need to know how to load the binary into microblaze soft core. Then how to drive pynq.lib.pynqmicroblaze.rpc to write down python class into a text file. Put these step together, we could build microblaze code in pynq board with less effort.

May be rewrite in a big mailbox loop is more easy way in this stage?

Sorry for the delayed response. I’ve moved this to the Support category.

If you are still looking for a way to do this, I would suggest you look at some of the peripheral examples and see how the pre-compiled binary is loaded to a MicroBlaze.

Also some info here on MicroBlaze subsystem and how to write your own applications: https://pynq.readthedocs.io/en/latest/overlay_design_methodology/pynq_microblaze_subsystem.html