Error running BNO055 through Simulink on an Arduino Uno

조회 수: 18 (최근 30일)
Walker Hare
Walker Hare 2023년 2월 8일
답변: Raj 2024년 2월 8일
I am simply trying to read output data from a BNO055 through Simulink on an Arduino Uno. This is the error code I am recieving when I try to run it on hardware:
MATLAB System block 'bno055test/BNO055 IMU Sensor' error occurred when invoking 'getSampleTime' method of 'codertarget.arduinobase.internal.arduinoBNO055'. The error was thrown from ' 'C:\Program Files\MATLAB\R2022b\toolbox\rtw\rtw\tlc_c.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\coder\simulinkcoder_core\+coder\+internal\ModelBuilder.m' at line 722 'C:\Program Files\MATLAB\R2022b\toolbox\coder\simulinkcoder_core\+coder\+internal\ModelBuilder.m' at line 119 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\private\build_target.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\private\build_target.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\private\build_standalone_rtw_target.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\private\slbuild_private.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\private\slbuild_private.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\sl_feval.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\slbuild.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\slbuild.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\simulink\core\general\slprivate.p' at line 0 'C:\Program Files\MATLAB\R2022b\toolbox\coder\sltoolstrip_base_hw\m\+coder\+internal\+toolstrip\HardwareBoardHandler.m' at line 121 'C:\Program Files\MATLAB\R2022b\toolbox\target\codertarget\sltoolstrip\m\+codertarget\+sltoolstrip\EmbeddedHardwareBoardContext.m' at line 252 'C:\Program Files\MATLAB\R2022b\toolbox\target\codertarget\sltoolstrip\m\+codertarget\+sltoolstrip\EmbeddedHardwareBoardContext.m' at line 218 'C:\Program Files\MATLAB\R2022b\toolbox\coder\sltoolstrip_base_hw\m\+coder\+internal\+toolstrip\HardwareBoardContext.m' at line 346'.
Caused by:
  • The return value from 'getSampleTimeImpl' must be an instance of 'matlab.system.SampleTimeSpecification'.
It is not a board issue as I am able to run a Servo with no issues through Simulink. It also isnt a problem with the BNO055 as I am able to use it using the test code through Arduino. Any help would be much appreciated. Thanks
  댓글 수: 3
Walker Hare
Walker Hare 2023년 2월 14일
R2022b
Thanks
Radko
Radko 2023년 11월 19일
Hi, very similar here:
MATLAB System block 'IMU_0/BNO055 IMU Sensor/Base sensor block' error occurred when invoking 'setupImpl' method of 'codertarget.arduinobase.internal.arduinoBNO055'. The error was thrown from '
'C:\Program Files\MATLAB\R2023b\toolbox\target\shared\ioserver\+matlabshared\+ioclient\IOProtocol.p' at line 0
'C:\Program Files\MATLAB\R2023b\toolbox\target\shared\ioserver\+matlabshared\+ioclient\+peripherals\I2C.p' at line 0
'C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\target\supportpackages\arduinobase\+codertarget\+arduinobase\+internal\arduinoI2CWrite.p' at line 0
'C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\target\supportpackages\arduinobase\+codertarget\+arduinobase\+internal\arduinoBNO055.p' at line 0
'C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\target\supportpackages\arduinobase\+codertarget\+arduinobase\+internal\arduinoBNO055.p' at line 0
'C:\Program Files\MATLAB\R2023b\toolbox\target\codertarget\sltoolstrip\m\+codertarget\+internal\+sltoolstrip\ConnectedIOHandler.m' at line 106
'C:\Program Files\MATLAB\R2023b\toolbox\target\codertarget\sltoolstrip\m\+codertarget\+sltoolstrip\EmbeddedHardwareBoardContext.m' at line 523'.
Caused by:
Error writing IOServerBlock.
Invalid operation. Object must be connected to the serial port.
Matlab 2023b

댓글을 달려면 로그인하십시오.

답변 (1개)

Raj
Raj 2024년 2월 8일
Hi Walker,
I went through the Simulink model that you attached. I was able to run the model without any errors with few minor warnings in MATLAB R2022b and R2023a release. I have attached screenshots for both of them.
The issue you are facing might be due to incomplete installatation of the necessary libraries. Try reinstalling 'Simulink Support Package for Arduino Hardware' from Add-Ons icon in MATLAB Toolstrip.
Additionally you can refer to the 'Simulink Support Package for Arduino Hardware' documentation link below for better understanding-
Hope this fixes the error you had and you are able to proceed further!

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by