Create Hardware Configuration Object
Create a hardware configuration object by using the
targetHardwarefunction in the MATLAB® Command Window.targetObject = targetHardware('hardwareName')For Raspberry Pi with 32-bit OS use
targetHardware('Raspberry Pi')and for 64-bit OS usetargetHardware('Raspberry Pi (64bit)').For example, to create a configuration object for the Raspberry Pi® hardware, enter:
board = targetHardware('Raspberry Pi (64bit)')board = targetHardware with properties: Name: 'Raspberry Pi (64bit)' DeviceAddress: '172.98.233.234' Username: 'pi' Password: '*********' BuildDir: '/home/pi' BuildAction: 'Build, load, and run' CoderConfig: [1×1 coder.CodeConfig]Verify the
DeviceAddress,Username, andPasswordproperties listed in the output. If necessary, change the value of the properties by using dot notation syntax.targetObj.propertyName = newValue
For example, to change the device address to
173.21.22.327, enter:board.DeviceAddress = '173.21.22.327'If the MATLAB function has methods from Deep Learning Toolbox™, perform these steps:
Set the language of code generation to C++.
board.CoderConfig.TargetLang = 'C++';Create an
arm-computedeep learning configuration object and assign it to theDeepLearningConfigproperty of the Raspberry Pi configuration object.dlcfg = coder.DeepLearningConfig('arm-compute') dlcfg.ArmArchitecture = 'armv7'; board.CoderConfig.DeepLearningConfig = dlcfg;
For more information, see Identify Objects Within Live Video Using ResNet-50 on Raspberry Pi Hardware and Send Inputs to MATLAB Function from Command Line of Raspberry Pi.