With the new version of Raspbian OS, “Raspbian Buster”, some header files of “i2c-dev” library got re-organized and our I2C source code is not compatible with the same. MATLAB IO server needs to be updated to fix this issue.
As a result, users working with this newer OS image and running OS customization from our Raspberry Pi Support Package during Hardware Setup will meet this build error while trying to run the command “r=raspi()”, or when using the I2C block from Simulink and trying to build the model.
MATLAB releases R2017b, R2018a, R2018b, and R2019a will be affected by this error as OS Customization support has been available from R2017b.
1) To fix error for MATLAB command “r = raspi()”:
Enter below command at the MATLAB prompt and edit the source code as shown in the attached screenshot:
>> edit(fullfile(raspi.internal.getRaspiRoot,'server','I2C.c'))
2) To fix the error in Simulink for I2C blocks:
Enter below command at the MATLAB prompt and edit the source code as shown in attached screenshot:
>>edit(fullfile(codertarget.raspi.internal.getSpPkgRootDir,'src','MW_I2C.c'))
Best Answer