Embedded Coder Interface to QEMU Emulator on Linux hosts.
Unfortunately, original Embedded Coder Interface to QEMU Emulator (https://www.mathworks.com/matlabcentral/fileexchange/57465-embedded-coder-interface-to-qemu-emulator) doesn't support Linux hosts officially.
Unoficially, it works just fine.
Embedded Coder targets for ARM Cortex-A and ARM Cortex-M can be used with QEMU, but with several modifications.
Basically, this package ships original files for QEMU target and some modified files for ARM Cortex-A and ARM Cortex-M targets.
Search for "QEMULNX" in files to see what has changed.
To make it work:
1) Install ARM Cortex-M and/or ARM Cortex-A target support packages (they support Linux hosts).
2) Add top directory of this submission to MATLAB path. It should be higher on path than ARM Cortex-M and ARM Cortex-A files, because it overrides one of the files from the targets.
3) Make sure qemu-system-arm resides in /usr/bin.
Mikhail (2019). Embedded Coder Interface to QEMU Emulator on Linux hosts (https://www.mathworks.com/matlabcentral/fileexchange/64797-embedded-coder-interface-to-qemu-emulator-on-linux-hosts), MATLAB Central File Exchange. Retrieved .
You should install it using your Linux distribution's package manager.
How should I install qemu-system-arm that you mentioned in step 3?
Since R2019a QEMU target is not available on Linux (again).
R2019a suffers from the same problem, see below.
Recent qemu has deprecated and then removed the "-redir" option. Therefore, to make it work with ARM Cortex-A, one has to make this change in R2018b:
In SupportPackages/R2018b/toolbox/target/supportpackages/arm_cortex_a/+codertarget/+arm_cortex_a/runQemu.m around line 83:
%redirString = sprintf(' -redir tcp:%d::22 -redir tcp:%d::%d -redir tcp:%d::%d ',sshport,extmodePort,extmodePort,sdiport,sdiport);
redirString = sprintf(' -nic user,hostfwd=tcp::%d-:22,hostfwd=tcp::%d-:%d,hostfwd=tcp::%d-:%d',sshport,extmodePort,extmodePort,sdiport,sdiport);
You can also change the line 72 accordingly:
tempFwd = sprintf(',hostfwd=tcp::%d-:%d ', currentPort,currentPort);
As of R2018b, Embedded Coder Interface to QEMU Emulator works out of the box for ARM Cortex-A.
For ARM Cortex-M, however, manual changes of SupportPackages/R2018b/toolbox/target/supportpackages/arm_cortex_m/+codertarget/+arm_cortex_m/runQemu.m are required. This submission can be served as a reference for these changes.
The ARM Cortex-A target is also available on Linux at least in R2018a. To make it work with QEMU, modify this file:
%installDir = matlab.internal.get3pInstallLocation('armcortexalinuxbinaries.instrset');
installDir = fullfile(matlab.internal.get3pInstallLocation('armcortexalinuxbinaries.instrset'),'armcortexa9_busybox');
Also, delete the p-coded version of getBusyboxLinuxDir.m from the same location.
Note: Since R2018a, Embedded Coder Interface to QEMU Emulator can be installed on Linux. Unfortunately, the ARM Cortex-M target itself doesn't yet support running in QEMU on Linux. So the runQemu.m from this submission can be used as a reference to modify runQemu.m from ARM Cortex-M target installation.
Update installation note.
Inspired by: Embedded Coder Interface to QEMU Emulator