BMA421 driver
#1
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?
#2
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
#3
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.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#4
I doubt that the drivers are the same, even at flyer level the devices are different:

https://www.bosch-sensortec.com/media/bo...-fl000.pdf
https://www.bosch-sensortec.com/media/bo...-fl000.pdf

Did you get a proper device initialization on BMA421 (i.e. INTERNAL_STATUS.message=0b1, which is Register 2A, bits 4..0)?
#5
(05-17-2020, 04:17 PM)soracle Wrote: I doubt that the drivers are the same, even at flyer level the devices are different:

https://www.bosch-sensortec.com/media/bo...-fl000.pdf
https://www.bosch-sensortec.com/media/bo...-fl000.pdf

Did you get a proper device initialization on BMA421 (i.e. INTERNAL_STATUS.message=0b1, which is Register 2A, bits 4..0)?

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).
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#6
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 :-)
#7
(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.

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 :-)

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).
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#8
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 Undecided
#9
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).
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#10
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 :-)


Forum Jump:


Users browsing this thread: 2 Guest(s)