Skip to content

Conversation

@jeetrohan
Copy link

@jeetrohan jeetrohan commented Oct 22, 2024

ESP-BSP Pull Request checklist

Note: For new BSPs create a PR with this link.

  • Version of modified component bumped
  • CI passing

Related

Change description

A new mpu60xx library which uses the new I2C driver for reading raw and floating point values; from accelerometer, gyrometer and temperature sensor.
Added functionality to use inbuilt motion detection on mpu60xx using both, polling and interrupts.

header file for mpu60xx driver
definitions for mpu60xx driver functions
manifest file for mpu60xx driver
example C source file for using inbuilt motion detection.
Manifest file for mpu60xx_motion_detection example
CMakeLists for mpu60xx_motion_detect
mpu60xx driver information.
@CLAassistant
Copy link

CLAassistant commented Oct 22, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title Jeetrohan mpu60xx 1 Jeetrohan mpu60xx 1 (BSP-568) Oct 22, 2024
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

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

@jeetrohan That's a pretty good job for your first contribution!

@jeetrohan
Copy link
Author

I just realized the merge here is different from the fork where sync simply updates the branch. 😅

@jeetrohan
Copy link
Author

jeetrohan commented Oct 25, 2024

@espzav , @tore-espressif
If I'm not wrong the pre-commit failed because of incorrect indentation, which it has fixed (or so it indicates in output).
A rerun should do it.

@tore-espressif
Copy link
Collaborator

@espzav , @tore-espressif If I'm not wrong the pre-commit failed because of incorrect indentation, which it has fixed (or so it indicates in output). A rerun should do it.

The pre-commit job is always run on latest changes, so there are probably still some formating errors.

If you want to fix them locally, in your esp-bsp folder you can do

pip install pre-commit && pre-commit install

To install pre-commit. Then you can run the pre-commit check on you last 11 commits like this

pre-commit run --from-ref HEAD~11 --to-ref HEAD

@tore-espressif
Copy link
Collaborator

@jeetrohan Thanks again for the PR, I'll take over and fix the remaining things when I'm free

@jeetrohan
Copy link
Author

@espzav , @tore-espressif If I'm not wrong the pre-commit failed because of incorrect indentation, which it has fixed (or so it indicates in output). A rerun should do it.

The pre-commit job is always run on latest changes, so there are probably still some formating errors.

If you want to fix them locally, in your esp-bsp folder you can do

pip install pre-commit && pre-commit install

To install pre-commit. Then you can run the pre-commit check on you last 11 commits like this

pre-commit run --from-ref HEAD~11 --to-ref HEAD

@tore-espressif
Thank you.
I'll do this at the earliest. I'd have done it since the beginning but as I mentioned it was my first time using the git. So, I think I'll still need to look more into some documentation to do this properly.
I'll follow these for the next update onward too, so that merging process is not hindered by these simple problems which should be resolved at my end itself.

@jeetrohan
Copy link
Author

@jeetrohan Thanks again for the PR, I'll take over and fix the remaining things when I'm free

@tore-espressif I totally understand that. I myself had thought to do pre-commit test on branch, but due to some other liabilities and my lack of knowledge (about git itself) I wasn't able to do it ( even though I really want to).
I'll keep you posted, once I'll add more functionality (& this time with pre-commit check. I believe I should've been the one to do it.)
Thanks again.

@jeetrohan
Copy link
Author

hi @tore-espressif & @espzav
I know its been quite some time since I made the last commit.
There were some irl issues after then, and later I was unwilling to touch again mpu60xx because its quite the subsystem in itself.
I've made a recent commit which is pre-committed and also has the features I promised earlier.
There are still many things I wanted to add.
But I wasn't sure if this PR is still acceptable.
Please review and let me know if I need to make changes or something else.

@jeetrohan jeetrohan requested a review from tore-espressif May 30, 2025 09:47
@jeetrohan
Copy link
Author

jeetrohan commented Jun 3, 2025

@tore-espressif I think I'll need to update the idf version to >=5.3 in idf_component.yml to avoid test failures (it says esp_driver_.
or
I can use i2c_bus component from component registry for backward compatibility.

Which one of the above do you suggest?

edit:
I have to apologize.
I realized that it maybe because I had revoked write permissions..
please wait for a day or two..
I needed to change a few things in this submission.

@jeetrohan jeetrohan force-pushed the jeetrohan-mpu60xx-1 branch from 5ece0f2 to 0c5f93c Compare June 4, 2025 18:01
jeetrohan added 2 commits June 5, 2025 00:12
	- Split single header/source files into multiple units for better maintainability and scalability
	- Introduced custom data types to clearly represent sensor data
	- Added Kconfig option to configure driver behavior

	The mpu60xx functions as a self-contained subsystem with untapped capabilities.
	This refactor lays the groundwork for future expansion by adopting a modular, extensible design.

 Changes to be committed:
	modified:   components/mpu60xx/CMakeLists.txt
	new file:   components/mpu60xx/Kconfig
	renamed:    components/mpu60xx/examples/mpu_motion_detect/CmakeLists.txt -> components/mpu60xx/examples/mpu_motion_detect/CMakeLists.txt
	modified:   components/mpu60xx/examples/mpu_motion_detect/main/CMakeLists.txt
	modified:   components/mpu60xx/examples/mpu_motion_detect/main/idf_component.yml
	modified:   components/mpu60xx/examples/mpu_motion_detect/main/mpu_motion_detect.c
	modified:   components/mpu60xx/idf_component.yml
	modified:   components/mpu60xx/include/mpu60xx.h
	new file:   components/mpu60xx/include/mpu60xx_interrupts.h
	new file:   components/mpu60xx/include/mpu60xx_regs_bits.h
	new file:   components/mpu60xx/include/mpu60xx_types.h
	deleted:    components/mpu60xx/mpu60xx.c
	new file:   components/mpu60xx/private/include/mpu60xx_pvt.h
	new file:   components/mpu60xx/private/mpu60xx_pvt.c
	new file:   components/mpu60xx/srcs/mpu60xx.c
	new file:   components/mpu60xx/srcs/mpu60xx_interrupts.c
	new file:   components/mpu60xx/srcs/mpu60xx_regs_bits.c
@jeetrohan
Copy link
Author

@tore-espressif, @espzav

I have fixed the issues.
Please do a re-run.

@jeetrohan
Copy link
Author

@tore-espressif , @espzav
from idf_component.yml in the most recent update:

dependencies:
  idf: ">=5.2"

from the error log :

.Using component placed at /__w/esp-bsp/esp-bsp/components/mpu60xx for dependency mpu60xx(*), specified in /__w/esp-bsp/esp-bsp/components/mpu60xx/examples/mpu_motion_detect/main/idf_component.yml
.HINT: Please check manifest file of the following component(s): main
CMake Error at /opt/esp/idf/tools/cmake/build.cmake:548 (message):
  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  ERROR: Because project depends on idf (>=5.4.0) which doesn't match any
  versions, version solving failed.

And also the the above log is from build (release-v5.1, 2, 1)
I am not sure if the run should be performed on idf<5.2.

If I'm wrong let me know.
thanks.

@tore-espressif
Copy link
Collaborator

@jeetrohan I'm sorry for the late responses, I'll do my best to have a look by the end of this week

@jeetrohan
Copy link
Author

@jeetrohan I'm sorry for the late responses, I'll do my best to have a look by the end of this week

@tore-espressif
No worries at all, thank you for the update! I appreciate you taking the time to look into it, and I’m happy to wait until the end of the week. Let me know if you need anything from me in the meantime.

@tore-espressif
Copy link
Collaborator

@jeetrohan thanks for your patience and for all the hard work you’ve put into these updates

Your implementation of the advanced MPU60xx features is very valuable for projects that need that extra functionality. At the same time, the goal of esp-bsp is to stay focused on a core set of drivers and examples that we can reliably maintain over time. Because the MPU60xx enhancements extend beyond what we normally cover in esp-bsp, we worry that adding them here could make it harder to keep everything tested and up to date.

To make sure your work gets the visibility it deserves—and so that you can continue to iterate on those advanced features without constraints—it would be great to publish this as its own component in the ESP Registry under your GitHub namespace. That way:

  1. You stay in full control of the code.
    You’ll be free to add new features, squash bugs, or make breaking changes as needed, without impacting the esp-bsp maintainers’ stability guarantees.

  2. Users can still pull it in very easily.
    Anyone using IDF Component Manager can add your repo to their prject and get those MPU60xx enhancements right away.

  3. esp-bsp remains lean and maintainable.
    We can continue focusing on the drivers and examples that serve as a stable, well-tested foundation, while your component lives and evolves alongside it.

The process to register a component in the ESP Registry is covered in the IDF Component Manager docs. You can sign in with your GitHub account, and within a few minutes have it listed. Once it’s published, folks who rely on esp-bsp can still pull in your MPU60xx component as an additional dependency.

I really appreciate your contribution here—this is exactly the kind of work we want to encourage—and I think publishing it as a standalone, registry-managed component is the best path forward so both projects can thrive. Let me know if you need any help with the IDF Component Manager setup!

@jeetrohan
Copy link
Author

@tore-espressif
Thankyou for your kind words. I'll be closing this PR with this final comment because I believe if there was a way to merge you would have suggested that, not the reasons you have given because
This PR was refactored specifically to make maintenance of this driver possible.
And if I wanted to stay in control I would not have submitted a PR to a official project.

Assuming

MPU60xx enhancements extend beyond what we normally cover in esp-bsp

I'd request you or someone on your team to review :
refactor(bh1750): migrate to esp_i2c_driver, add example and update test app (BSP-681)

It is a simple refactor as it says and has been pending for over a week. Maybe I can remove the example I added, based off the test app.

And the Component Registry
Please do not take the following personally, it is not directed at you but a simple observation:
The components registered in there are used only if they are from Espressif namespace.
I've made a submission once and probably never will again.

PS:
I would have rather preferred an honest response, older boards are now obsolete and we have moved towards supporting the new ones which do not require these sensors (MPU6050, BH1750, etc..), anymore.
These are here just for backward compatibility now.
Probably you didn't say this because you are not allowed to divulge the future policies, and I can understand that too.

@tore-espressif
Copy link
Collaborator

I am allowed to say whatever apart from insulting people :D

The more straightforward answer is: We cannot justify spending time reviewing >1500 line of code from external contributors.

@jeetrohan
Copy link
Author

jeetrohan commented Jun 6, 2025

I am allowed to say whatever apart from insulting people :D

The more straightforward answer is: We cannot justify spending time reviewing >1500 line of code from external contributors.
@tore-espressif
And you could have said this, from the start, particularly when I made the first PR.
I rather appreciate honesty than spending time on something meaningless.

@jeetrohan jeetrohan deleted the jeetrohan-mpu60xx-1 branch June 8, 2025 17:05
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.

3 participants