BMA421 driver - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PineTime (https://forum.pine64.org/forumdisplay.php?fid=134) +--- Forum: Development Discussion on PineTime (https://forum.pine64.org/forumdisplay.php?fid=136) +--- Thread: BMA421 driver (/showthread.php?tid=9617) Pages:
1
2
|
BMA421 driver - matthez - 04-07-2020 Hi there, I tried out some of the fimewares out there for the Pinetime, great work. Currently I stucked in trying to get the BMA421 running with Interrupt on any motion. The chip denies the driver which is been loading into the internal ASIC. Does anyone have a glue where to get it from?? In the Manual for the similar BMA423 its been called config file, should have the size of around 6kB. Maybe a binary blob of the original software? I used the repo: https://github.com/sethitow/mbed-pinetime This works fine for trying out the basic functions of the BMA. Thanks. Hopefully anyone does have a hint? RE: BMA421 driver - soracle - 05-14-2020 I think the best solution would be to convince pine64 (or whoever did the component selection) to switch to BMI423 in future batches. It is pin compatible and everything is available to write a working driver, including reference code https://github.com/BoschSensortec/BMA423-Sensor-API RE: BMA421 driver - danielt - 05-15-2020 I did a line by line comparison of the not-open-source BMA421 driver and the open-source BMA423 driver a little while back. As far as I could tell the driver code is exactly the same. I think that means that for PineTime we can use the driver you linked to without any changes! I'm afraid I haven't had time to double check this. It is on the list but I have been really busy on other parts of wasp-os. Specifically I have used up all my hacking time over the last two weeks working really hard to give wasp-os has the best documentation I can manage. RE: BMA421 driver - soracle - 05-17-2020 I doubt that the drivers are the same, even at flyer level the devices are different: https://www.bosch-sensortec.com/media/boschsensortec/downloads/product_flyer/bst-bma421-fl000.pdf https://www.bosch-sensortec.com/media/boschsensortec/downloads/product_flyer/bst-bma423-fl000.pdf Did you get a proper device initialization on BMA421 (i.e. INTERNAL_STATUS.message=0b1, which is Register 2A, bits 4..0)? RE: BMA421 driver - danielt - 05-18-2020 (05-17-2020, 04:17 PM)soracle Wrote: I doubt that the drivers are the same, even at flyer level the devices are different: You are welcome to check for yourself. The BMA421 driver in https://github.com/sethitow/mbed-pinetime is, line-for-line, identical to the oldest version of the BMA423 driver at https://github.com/BoschSensortec/BMA423-Sensor-API (although I have seen other BMA421 drivers floating around that are identical to BMA423-Sensor-API C code but come with a different firmware). RE: BMA421 driver - soracle - 05-18-2020 Thanks for your quick reply, but I have no PineTime yet, but am close to get one. Did you find any evidence that the BMI423 works with the BMI421? In particular features which are only mentioned in the BMI423 datasheet like tilt on wrist detection, which would be cool on a watch :-) RE: BMA421 driver - danielt - 05-19-2020 (05-18-2020, 10:22 AM)soracle Wrote: Thanks for your quick reply, but I have no PineTime yet, but am close to get one. Bit early to say to be honest. I'm still finalizing the wasp-os M2 release. M2 is essentially a pre-release for application developers to use to explore the system (so writing documentation took priority over enabling the step counter). RE: BMA421 driver - soracle - 05-20-2020 Yes, makes sense. I cross the fingers that it works out at the end. Still puzzled about the situation: There is a choice between an open-source friendly device with everything on github and a device for which you need to sign an NDA to get any documentation. The devices seem to be pin compatible....and pine64 chooses the complicated path RE: BMA421 driver - danielt - 06-10-2020 A quick update on PineTime accelometer. The BMA423 driver does work and the only changes needed are adopting a suitable config file (and with many thanks to Aaron for that) and changing the device ID. The resulting driver only supports BMA421 embedded intelligence features meaning things like hardware assisted wrist tilt doesn't work (which doesn't mean we can't implement tilt detection in software). I assembled this into a ready-to-go micropython driver for wasp-os which I think should also be enough of an example to help other PineTime OS projects get the sensor running: https://github.com/daniel-thompson/bma42x-upy I have tested it by porting the accelerometer, step-counter, motion/no-motion detect and temperature examples to Python (see examples/ for what is working). RE: BMA421 driver - soracle - 06-15-2020 Wow...many thanks for the good news. Much better than I expected. The downside of software wrist tilt is the extra power consumption. Having motion/no-motion and step counter is already pretty cool *Thumbs up* Also many thanks to Aaron for the config file :-) |