BMA421 reads all zeros
#1
Hi All, I'm trying to read the BMA421 on my P8 but all I get from it on I2C is all zeros. Reading chip id gets zero, reading acceleration gets zero. I checked the SDA and SCL lines with logic analyser and they look good. Anybody seen this before?
  Reply
#2
(10-31-2020, 09:50 AM)tbondar Wrote: Hi All, I'm trying to read the BMA421 on my P8 but all I get from it on I2C is all zeros. Reading chip id gets zero, reading acceleration gets zero. I checked the SDA and SCL lines with logic analyser and they look good. Anybody seen this before?

There was an (?undocumented?) change of specification part way through the life of the P8 and the BMA421 was replaced with a much cheaper SC7A20 device that requires the step counting to be implemented in software rather than offloaded to the motion processor found in the BMA421.

Based on the comments from the wasp-os bug tracker it looks very much like the new part reads zeros for the ID:
https://github.com/daniel-thompson/wasp-...-683431763

PS Just to be 100% clear for anyone scanning this thread, this topic is not related to PineTime and the PineTime has not had any undocumented spec changes! If you have a PineTime dev kit and the sensor is not working then double check it is fully plugged in ;-), it is relatively easy to knock it out when the back is open.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply
#3
(11-02-2020, 07:38 AM)danielt Wrote: There was an (?undocumented?) change of specification part way through the life of the P8 and the BMA421 was replaced with a much cheaper SC7A20 device that requires the step counting to be implemented in software rather than offloaded to the motion processor found in the BMA421.

Yes, you are right. The accelerometer is a SC7A20 and not BMA421 in my P8 (not PineTime). Thank you for your reply!
  Reply
#4
Hi,

After weekend of experiments with pinetime (updates with few waspos firmwares)  .
I am experiencing issues with first chip_id read on Pinetime.
"Invalid sensor" issue as in this ticket most of the time ( sometimes counts to ~200 steps after few reboots but in general ).
Now always causes steps.py __init__ fails.
Code:
       if (dev->intf_rslt == BMA4_INTF_RET_SUCCESS)
        {
            for (indx = 0; indx < len; indx++)
            {
                /* Parsing and storing the valid data */
                data[indx] = temp_buff[indx + dev->dummy_byte];
            }
        }
        else
        {
           printf("fail of register read: 0x%x",dev->intf_rslt); <---- ffffff
           rslt = BMA4_E_COM_FAIL;
        }

Forcing battery consumption to 0 doesn't fix issue. The same making 0.05 timeout longer.

My pinetime is not devkit.
'debug' flag of dev gives logs on later steps so isn't usable.

What else can I check ? Does opening device and checking internal connections last option?
  Reply
#5
(02-12-2021, 08:07 AM)slawkory Wrote: My pinetime is not devkit.
'debug' flag of dev gives logs on later steps so isn't usable.

What else can I check ? Does opening device and checking internal connections last option?

To be honest the comment about the internal connections might be me getting confused between step sensor and the heart rate sensor (someone asked me something about reading a bad id value that turned out to be a bad connection but I can't actually remember which one it was).

Reading all 1s does sound a lot like the chip isn't reacting to the ID command to you are just reading the bus pull up resistor instead.

Not much can be done from a software point of view. You could try adding some logic to retry a few times but its firmly in the long-shot category.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply
#6
Calling dev->bus_read 200 times in loop didn't help. Thank you Daniel for idea.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)