Setting up MATLAB Support Package for Raspberry Pi Hardware (R2022b)

Leonard Mabele
4 min readSep 15, 2022

--

  1. Run the command supportPackageInstaller to open the interface that allows you to select the support installation packages.
  2. Select “MATLAB Support Package for Raspberry Pi” by scrolling through the page or search Raspberry Pi.
  3. Two options of “Set up Now” or “Set Up Later” appears. I recommend that you select “Set up Now” just like in this video: https://youtu.be/32ByiUdOwsw.
  4. In the next screen that appears, you are presented with two options again as shown in Figure 1. One option is “Setup hardware with Mathworks Raspbian Image” and the second one is “Customize the existing operating system running on hardware.”
Figure 1: Interface to select your OS set up for the Raspberry Pi.

5. Whichever option you select, it should lead you to the screen in Figure 2 where you can select the version of Raspberry Pi you are trying to set up. In my case, I have selected “Customize the existing operating system running on hardware” since I already have a Raspberry Pi 4 Model B with Raspbian OS.

Figure 2: The interface to select your Raspberry Pi board.

6. Once you click “Next” in Figure 2, the interface in Figure 3 appears for you to validate the access credentials of your Pi i.e. the IP it has on your network, username and password.

Figure 3: Interface to validate the details of your Raspberry Pi.

7. I share my details as an example in Figure 4.

Figure 4: Details to test connection.

8. If everything is successful as shown in Figure 4, you should click on “Next” to install the MATLAB libraries for the your OS. In my case, the following packages in Figure 5 crash but I can still install them using the pip package (I have mentioned PIP before in this post: https://lmabele.medium.com/installing-gnu-radio-for-the-hackrf-one-eb468ac2d33). So the crash should not worry you. Figure 6 is my installation on the Raspberry Pi via ssh. The same can be done for the libraries.

Figure 5: Library installation.
Figure 6: Installation of cffi via ssh.

9. Once you clock next on Figure 5, you are presented with Figure 7 to install the ARM Compute Library to set up the Deep Learning deployment. You can choose to skip it but in my case, I have selected the second option to install it. This takes you to the interface in Figure 8 and you can complete the installation by opening the shell of the Pi which is called via ssh. Run the command as provided by the instructions.

Figure 7: Interface to install ARM Compute Library.
Figure 8: Interface to install ARM Compute Library by opening Shell.

10. Once the installation is done similar to the interface in Figure 9, you can click “Next” to install OpenCV library as shown in Figure 10. This takes you to the screen in Figure 11 where you again open Shell and run the command provided to install OpenCV. Figure 12 shows the shell installation.

Figure 9: Shell installation of the ARM compute Library
Figure 10: Interface to select installation of OpenCV
Figure 11: Open Shell to install OpenCV
Figure 12: OpenCV installation on Shell.

11. Next you can configure the peripheral modules i.e. the interface used to connect sensors and actuators as well as communicate to the Pi via serial as shown in Figure 13. You can then reboot your Pi as per Figure 14 then your set up for the Raspberry Pi on MATLAB would be completed.

Figure 13: Interface to set up the peripheral modules.
Figure 14: Interface to reboot the Pi.

--

--

Leonard Mabele
Leonard Mabele

Written by Leonard Mabele

I am just a contributor of the innovation in telecommunications (Dynamic Spectrum Access, LPWANs), Programming and Engineering Design. IoT is also my coffee mug