MATLAB Answers

Why does disableI2C() stalls the Raspberry Pi?

1 view (last 30 days)
I have a Raspberry Pi 3B+ with MathWorks customized Raspbian image for R2020b. When I execute following commands, I see an error saying failed to disable I2C
>> r = raspi()
r =
raspi with properties:
DeviceAddress: '172.18.186.66'
Port: 18734
BoardName: 'Raspberry Pi 3 Model B'
AvailableLEDs: {'led0'}
AvailableDigitalPins: [2,3,4,5,6,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]
AvailableSPIChannels: {'CE0','CE1'}
AvailableI2CBuses: {'i2c-0'}
AvailableWebcams: {'Microsoft® LifeCam Cinema(TM): (usb-3f980000.usb-1.4)'}
I2CBusSpeed: 100000
Supported peripherals
>> r.disableI2C
Failed to disable I2C peripheral.
The putty terminal shows following message and hangs.
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460361] Internal error: Oops: 17 [#1] SMP ARM
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460726] Process modprobe (pid: 1777, stack limit = 0x28b3d0c1)
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460738] Stack: (0xa77e7e70 to 0xa77e8000)
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460754] 7e60: 7f1a92c8 b6adc040 a77e7e9c a77e7e88
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460772] 7e80: 7f1a92f8 80550c18 b9e56a10 b9e56a10 a77e7eb4 a77e7ea0 805ac594 7f1a92d4
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460790] 7ea0: b9e56a10 b9e56a44 a77e7edc a77e7eb8 805aaed0 805ac56c 00000002 b9e56a10
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460808] 7ec0: 7f1ab014 0167ce1c 00000081 801011c4 a77e7ef4 a77e7ee0 805aaff8 805aad54
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460826] 7ee0: 7f1ab014 7f1ab080 a77e7f0c a77e7ef8 805a9b30 805aafa0 7f1a9db0 7f1ab014
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460843] 7f00: a77e7f24 a77e7f10 805ab4f0 805a9ae0 7f1a9db0 80d04d48 a77e7f34 a77e7f28
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460861] 7f20: 805ac67c 805ab4c4 a77e7f44 a77e7f38 7f1a9dc8 805ac66c a77e7fa4 a77e7f48
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460879] 7f40: 801b5fdc 7f1a9dbc 5f633269 326d6362 00353338 801011c4 a77e6000 00000006
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460896] 7f60: a77e7f8c 80c92ad8 80101068 7ef21a38 00000006 801011c4 a77e6000 00000006
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460914] 7f80: 007e7fac 024286d7 80201c0c 0167cde0 0167ce1c 00000000 00000000 a77e7fa8
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460932] 7fa0: 80101000 801b5e48 0167cde0 0167ce1c 0167ce1c 00000800 5eaf0700 00000000
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460949] 7fc0: 0167cde0 0167ce1c 00000000 00000081 0167ce1c 0003fce8 0167cde0 7ef23ddc
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.460967] 7fe0: 0003ff88 7ef22a1c 00022bb8 76c37fcc 20000010 0167ce1c 00000000 00000000
Message from syslogd@raspberrypi-0kU9Oq4mxq at Sep 10 05:53:00 ...
kernel:[10881.461317] Code: e8bd4000 e2504000 089da818 ebfff6c8 (e5943014)
Upon ctrl+c or executing cmd sudo reboot in pi terminal the Pi doesn't reboot successfully and creating a new ssh stalls. This issue is resolved upon power cycling the board

Accepted Answer

MathWorks MATLAB Hardware Team
This is due to the upstream Linux issue for BCM 2835 based devices. This issue has been reported in following Raspberry Pi forum
https://www.raspberrypi.org/forums/viewtopic.php?t=255294
Due to issue being present in Linux kernel, it is seen in MathWorks customized Raspbian image for R2020b
Do following steps to resolve the issue:
1. Create raspi object in MATLAB
>> r = raspi()
2. Open terminal of the pi using
>> r.openShell();
3. In the terminal window execute $ sudo raspi-config
4. Go to Interface Options, select I2C and select No to disable the I2C peripheral.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by