-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix of reading of IMU magnetometer in boards mtb4
, mtb4c
, strain2
, strain2c
#361
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…2 (only latest V1D3 version)
…PIO ones as cube-mx does.
…ootloader are: mtb4 v1.21.0, mtb4.bootloader v1.8, mtb4.updaterofbootloader v1.8.222 mtb4c v2.1.0, mtb4c.bootloader v2.8, mtb4c.updaterofbootloader v2.8.222 strain2 v2.1.0, strain2.bootloader v2.8, strain2.updaterofbootloader v2.8.222 strain2c v2.1.0, strain2c.bootloader v2.8, strain2.updaterofbootloader v2.8.222
Nicogene
added a commit
to robotology/icub-firmware-build
that referenced
this pull request
Mar 30, 2023
Also the bootloader and updaterofbootloader have been changed: - mtb4.bootloader v1.8, mtb4.updaterofbootloader v1.8.222 - mtb4c.bootloader v2.8, mtb4c.updaterofbootloader v2.8.222 - strain2.bootloader v2.8, strain2.updaterofbootloader v2.8.222 - strain2c.bootloader v2.8, strain2.updaterofbootloader v2.8.222 built w/ robotology/icub-firmware@b845e3a and robotology/icub-firmware-shared@8033eaf main changes: - the magnetometer is now fixed in both mtb4* and strain2*, and the yaw measurements are more stable See robotology/icub-firmware#361
Nicogene
added a commit
to robotology/icub-firmware-build
that referenced
this pull request
Mar 31, 2023
Also the bootloader and updaterofbootloader have been changed: - mtb4.bootloader v1.8, mtb4.updaterofbootloader v1.8.222 - mtb4c.bootloader v2.8, mtb4c.updaterofbootloader v2.8.222 - strain2.bootloader v2.8, strain2.updaterofbootloader v2.8.222 - strain2c.bootloader v2.8, strain2.updaterofbootloader v2.8.222 built w/ robotology/icub-firmware@af7c9dd and robotology/icub-firmware-shared@8033eaf main changes: - the magnetometer is now fixed in both mtb4* and strain2*, and the yaw measurements are more stable See robotology/icub-firmware#361
Nicogene
added a commit
to robotology/icub-firmware-build
that referenced
this pull request
Mar 31, 2023
Also the bootloader and updaterofbootloader have been changed: - mtb4.bootloader v1.8, mtb4.updaterofbootloader v1.8.222 - mtb4c.bootloader v2.8, mtb4c.updaterofbootloader v2.8.222 - strain2.bootloader v2.8, strain2.updaterofbootloader v2.8.222 - strain2c.bootloader v2.8, strain2.updaterofbootloader v2.8.222 built w/ robotology/icub-firmware@af7c9dd and robotology/icub-firmware-shared@8033eaf main changes: - the magnetometer is now fixed in both mtb4* and strain2*, and the yaw measurements are more stable See robotology/icub-firmware#361
valegagge
pushed a commit
to valegagge/icub-firmware
that referenced
this pull request
May 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the reading of magnetometer of IMU Bosch
BNO055
in some boards:mtb4
,mtb4c
,strain2
,strain2c
.In short: the fix is done by reducing the I2C speed towards the
BNO055
and by making sure that the internal CPU and bus speeds are higher.Description
We noticed that some boards (
mtb4
,mtb4c
,strain2
andstrain2c
) were reading zero magnetometer values from the IMU BoschBNO055
which is mounted on their PCB and is accessible viaI2C
.On the other hand, the
rfe
board was behaving correctly.After careful analysis of the SW and HW differences we found out that if we align the
mtb4
,mtb4c
,strain2
andstrain2c
to have a higher clock for its internal buses and also if we keep theI2C
speed to be standard mode (100 kbit/s) then the magnetometer values are non-zero. Note that the datasheet of theBNO055
allow both standard and fast mode but surely that is not the case w/ our boards.As a result of that I have aligned the
CPU
andI2C
speeds on the above boards to be as specified in the following table. And that only was enough to fix the reading.mtb4
mtb4c
mtb4
strain2
strain2c
strain2
rfe
Table. The CPU and I2C speeds of the boards w/ the BNO055.
Also, I have updated a bit the
embot::hw::bno055
driver so that now it is more aligned to the datasheet names and has a more correct boot mechanism performed in runtime duringembot::hw::bno055::init()
. I have also made sure that the pins used for selecting the communication mode (I2C
orUSART
) are effectively managed by the FW and not only by pull down resistors.Note that the cleanup of the
embot::hw::bno055
driver is a good thing but is not what does the fix on magnetometer.In order to align the speeds I had to start from the lowest level of of ST Microelectronics's CubeMX sources, the .ioc files, change the HW settings, generate the low level code, use it. However, most of the .ioc file were very old and superseded by a new format and also in the meantime ST Microelectronics has release new HAL libraries. And the boards, being released in different times had all a different version of the STM's HAL.
So, I have aligned all the low level code to the latest .ioc format and to the HAL for L4 MPUs version 1.13.3 (
v1D3
).And this alignment and cleanup produced ... thousands of files being changed.
Tests
I have verified that on the
mtb4
,mtb4c
,strain2
andstrain2c
if we use the configuration of CPU and I2C speeds reported in the above table the values of the magnetometer are non-zero. And they are zero if we use the former configuration.Tests by @Nicogene also confirmed that: see robotology/icub-tech-support#1485 (comment)
Important
In icub-firmware-build new binaries will be published for the application, the bootloader and the updater of the bootloader, BUT ... to fix the behavior it is enough to update the application only and not also the bootloader.