openamp#
OCaml bindings to the OpenAMP remoteproc sysfs interface.
OCaml bindings to the Linux remoteproc sysfs interface for managing remote processors via OpenAMP. Designed for Zynq UltraScale+ (K26) where the A53 application processor needs to load firmware and start/stop the R5 real-time co-processor. On macOS, all operations are no-ops.
All filesystem operations take an Eio path parameter for testability.
Installation#
opam install openamp
Usage#
Eio_main.run @@ fun env ->
let fs = Eio.Stdenv.fs env in
match Openamp.Remoteproc.find ~fs () with
| None -> Fmt.pr "No remote processor found@."
| Some rp ->
Openamp.Remoteproc.set_firmware ~fs rp "my-firmware.elf";
match Openamp.Remoteproc.start ~fs rp with
| Ok () -> Fmt.pr "Started %s@." (Openamp.Remoteproc.name ~fs rp)
| Error e -> Fmt.epr "Error: %s@." e
API#
Remoteproc-- Remote processor control via sysfs.findlocates a processor by index,find_alllists all available processors.statereads the current state (Offline, Running, Crashed, Suspended).set_firmwaresets the firmware filename,startandstopcontrol the processor lifecycle.Firmware-- Firmware file management under/lib/firmware.existschecks for a firmware file,installcopies a file into the firmware directory.For_testing-- Overrides for sysfs and firmware base paths to enable unit testing without real hardware.