Omi2 updates
- Adds Accelerometer support for Omi2. Test on hardware.
- Adds motor support for Omi2. Tested on hardware.
- Minor refactoring
- Changes model & versions in
omi.confand CMake preset
Apologies for all the whitespace changes that are showing up. I am editing in VSCode with default settings (as far as I know), and it is applying all these minor changes for end-of-line.
This will likely take some discussion. Topics below.
IMU Driver
See the note in accel.c . The only way to actually make it work it to edit the zephyr source tree itself.
Possible TOD here is to see if newer Zephyr distros have a driver for LSM6TR3-C merged.
If so, we might be able to add it into this project, until Nordic SDK moves to a newer Zephyr version with the driver.
Shell commands code
The Omi2 EVT firmware has a number of useful shell commands, which are optionally added here.
But we could/should decide if we want to merge these into the main firmware (optional, behind CONFIG_SHELL), or leave them only in factory FW.
Testing code
In accel.c, there's a function there to test reading from the IMU. Actually, we probably want to delete stuff like this.
TODO: revise.
The big one: DK2 support and source overlap
This update is tested on Omi2 EVT, but it is not tested on DK2.
As of now, we are overlapping with DK2 source.
Project-level, we'll need to decide:
- Do we have separate impls for DK2 and Omi2 EVT?
- Common interface but separate impls?
- Single imp, with everything carefully guarded with macros?
@apullin is attempting to deploy a commit to the kodjima33's projects Team on Vercel.
A member of the Team first needs to authorize it.
Cool man @apullin
1/ Could you reset this code to match the main branch, sir?
2/ did you test on the omi kits ? or any specific board.
--
Regarding your questions:
Do we have separate impls for DK2 and Omi2 EVT?
-> The devkit/devkit2 implementation will be located at: https://github.com/BasedHardware/omi/tree/main/omi/firmware/devkit
-> DK2 and Omi2 EVT in the omi/src/lib are just references to make the porting process easier. They will be removed later.
Common interface but separate impls? Single imp, with everything carefully guarded with macros?
-> We could also mix these two approaches - building some libs as core so that devkit and omi can use them as shared libs. -> But let's decide that later. My top priority is to finish the firmware code for the new version first ;)
@beastoin
1/ Could you reset this code to match the main branch, sir?
Rebased.
2/ did you test on the omi kits ? or any specific board.
Tested on Omi2 EVT. Motor worked during startup. IMU works when reading, either by including the shell cmd or using the test thread.
Not tested on DK2. But if the entirety of the DK2 project lives in firmware/devkit, the DK2 code would be unaffected by this commit.
@beastoin Actually, on the "reset this code" request:
Don't we want differentiation here, as this is an entirely separate hardware revision, separate product, separate firmware?
1/ man, i still see your PR made change to the configs which i mentioned. please reset it.
2/ ok ✅
3/ could you resolve the conflict ?
4/ imu is unused for now, any good idea on applying it to our prod ?
@apullin
@beastoin Conflicts resolved, conf changes reverted.
WRT to use of the IMU - sure, there's plenty of ways to use it. Track motion intensity, read by BLE, add to prompts. Or shake-to-wake, sleep on no motion, etc.
It looks like reading is already in place in the app. This is all in DK2, so there should be some support for it already? We should coordinate to verify that part still works, so people can build with it.
1/ ✅ ok
2/ ✅ ok
3/ ✅ ok
4/ ✅ ok, dk2 hasn’t applied imu features yet haha — that’s why i asked. please just set the config to n.
5/ could you please discard the haptic changes? it’s already supported.
6/ why do we need the reset reason in the new firmware version?
https://github.com/BasedHardware/omi/pull/2270/files
7/ also, why do we need this config?
https://github.com/BasedHardware/omi/pull/2270/files#diff-380fa6d740cb65a1fae35ae54bb70caa8f831d2cc6697c26d2391a0ab1b256d1R352
8/ could you please clean the code again? keep the main function clean — just add accel. battery is already supported.
9/ do you plan to support the sdcard in this PR? if not, please discard the sdcard changes.
wip: https://github.com/BasedHardware/omi/tree/main/omi/firmware/omi#wip
overall, appreciate your help man. btw, my suggestion: just keep the accel code with config set to n — and discard all the rest.
@apullin ~
@apullin will you update PR?
@apullin will you update PR?
Yes - been busy. Will do within a few days. Also will delete the whitespace changes, now that I've figured out how to do that by rewriting the git commits.
yah, feel free to re-popen it when you're ready.
thank man.