Skip to content

Conversation

@dnakhooda
Copy link
Member

@dnakhooda dnakhooda commented Nov 23, 2025

LIS2MDL & LSM6DSV & MotionFX

This is a large pull requests for many MSB related things.

  • Update the CubeMX pinout for the MSB
  • Add IMU (LSM6DSV) code
  • Add Magnometer (LIS2MDL) code
  • Add MotionFX rotation calculations

Most of what makes this PR so large is adding the motionfx library to the pinout updates. So, the important files to look at are: u_sensors.c and u_threads.c.

Closes #10, #11

@dnakhooda dnakhooda self-assigned this Nov 23, 2025
@dnakhooda dnakhooda changed the title Support LSM6DSV LIS2MDL & LSM6DSV & MotionFX Stuff Jan 27, 2026
@dnakhooda dnakhooda changed the title LIS2MDL & LSM6DSV & MotionFX Stuff LIS2MDL & LSM6DSV & MotionFX PR Jan 27, 2026
Copy link

@caiodasilva2005 caiodasilva2005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick note: HAL_Delay will likely not work on _delay on the imu due to ThreadX scheduler taking over. that should be changed to a tx_thread_sleep

as for iknob orientations, I believe your current one should be fine as we will have one msb in the front and in the back. As long as they share the same orientation physically (depends how they end up being harnessed), I believe we are good with this orientation on the software side)

.function = sensors_thread /* Thread Function */
};
void sensors_thread(ULONG thread_input) {
uint32_t count = 25;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably use a ner_timer with a set timeout for running code here less frequently instead of a magic number count that since this may be a bit undeterministic.

#include "u_can.h"
#include "u_statemachine.h"

void inbox_can(can_msg_t *message) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this copied from lightning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support SPI LSM6DSV in msb.c

3 participants