kriswiner / EM7180_SENtral_sensor_hub

(Affordable) Ultimate Sensor Fusion Solution
https://www.tindie.com/products/onehorse/ultimate-sensor-fusion-solution/
96 stars 37 forks source link

USFS EEPROM CRC incorrect #28

Closed bmegli closed 6 years ago

bmegli commented 6 years ago

Hi @kriswiner,

I have recently received USFS (SENtral, MPU9250, BMP280) from Tindie. I am using Teensy 3.5.

I am running EM7180_MPU9250_BMP280.ino modified for my connections (I2C on pins 18/19).

This is the result I get:

Scanning...
I2C device found at address 0x28  !
done

EM7180 ROM Version: 0xE69
Should be: 0xE609
EM7180 RAM Version: 0x00
EM7180 ProductID: 0x80 Should be: 0x80
EM7180 RevisionID: 0x2 Should be: 0x02
A barometer is installed
A humidity sensor is installed
A temperature sensor is installed
A custom sensor is installed
A second custom sensor is installed
A third custom sensor is installed
EEPROM detected on the sensor bus!
EEPROM uploaded config file!
EEPROM CRC incorrect!
EM7180 in initialized state!
No EEPROM detected!
Beginning Parameter Adjustments

Two things are suspicious:

Could you provide me the firmware that USFS should come with?

Kind regards

bmegli commented 6 years ago

Hmm, inspecting the output it looks to me as communication problem, not CRC failure.

It hangs in loop and I verified that param_xfer is 255 (0xFF) constantly

while(!(param_xfer==0x4A)) {
    param_xfer = readByte(EM7180_ADDRESS, EM7180_ParamAcknowledge);
  }

Maybe I messed pullups or something. Investigating.

Any ideas welcome.

kriswiner commented 6 years ago

Look like you have no firmware installed at all:

EM7180 RAM Version: 0x00, this should not be zero.

On Sat, Jun 30, 2018 at 1:01 PM, Bartosz Meglicki notifications@github.com wrote:

Hi @kriswiner https://github.com/kriswiner,

I have recently received USFS (SENtral, MPU9250, BMP280) from Tindie. I am using Teensy 3.5.

I am running EM7180_MPU9250_BMP280.ino https://github.com/kriswiner/EM7180_SENtral_sensor_hub/blob/master/EM7180_MPU9250_BMP280.ino modified for my connections (I2C on pins 18/19).

This is the result I get:

Scanning... I2C device found at address 0x28 ! done

EM7180 ROM Version: 0xE69 Should be: 0xE609 EM7180 RAM Version: 0x00 EM7180 ProductID: 0x80 Should be: 0x80 EM7180 RevisionID: 0x2 Should be: 0x02 A barometer is installed A humidity sensor is installed A temperature sensor is installed A custom sensor is installed A second custom sensor is installed A third custom sensor is installed EEPROM detected on the sensor bus! EEPROM uploaded config file! EEPROM CRC incorrect! EM7180 in initialized state! No EEPROM detected! Beginning Parameter Adjustments

Two things are suspicious:

  • all the sensors installed (baro, temp, humid + 3 custom)
  • EEPROM CRC incorrect (probably the cause for problem?)

Could you provide me the firmware that USFS should come with?

Kind regards

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtU36xvdZCy4jy4R6VXckE0bsTY-ks5uB9kQgaJpZM4U-FgM .

kriswiner commented 6 years ago

Are you sure the EEPROM is not damaged?

You can check, run an I2C scan using the SDA_M/SCL_M (master bus) and see if you can detect the EEPROM (0x50 & 0x58) as well as the MPU9250 (0x68) and BMP280 (0x77). Let me know what the result is.

On Sat, Jun 30, 2018 at 1:30 PM, Tlera Corporation tleracorp@gmail.com wrote:

Look like you have no firmware installed at all:

EM7180 RAM Version: 0x00, this should not be zero.

On Sat, Jun 30, 2018 at 1:01 PM, Bartosz Meglicki < notifications@github.com> wrote:

Hi @kriswiner https://github.com/kriswiner,

I have recently received USFS (SENtral, MPU9250, BMP280) from Tindie. I am using Teensy 3.5.

I am running EM7180_MPU9250_BMP280.ino https://github.com/kriswiner/EM7180_SENtral_sensor_hub/blob/master/EM7180_MPU9250_BMP280.ino modified for my connections (I2C on pins 18/19).

This is the result I get:

Scanning... I2C device found at address 0x28 ! done

EM7180 ROM Version: 0xE69 Should be: 0xE609 EM7180 RAM Version: 0x00 EM7180 ProductID: 0x80 Should be: 0x80 EM7180 RevisionID: 0x2 Should be: 0x02 A barometer is installed A humidity sensor is installed A temperature sensor is installed A custom sensor is installed A second custom sensor is installed A third custom sensor is installed EEPROM detected on the sensor bus! EEPROM uploaded config file! EEPROM CRC incorrect! EM7180 in initialized state! No EEPROM detected! Beginning Parameter Adjustments

Two things are suspicious:

  • all the sensors installed (baro, temp, humid + 3 custom)
  • EEPROM CRC incorrect (probably the cause for problem?)

Could you provide me the firmware that USFS should come with?

Kind regards

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtU36xvdZCy4jy4R6VXckE0bsTY-ks5uB9kQgaJpZM4U-FgM .

bmegli commented 6 years ago

I am not entirely sure. After removing the two first 1000 ms delays I get:

Scanning...
I2C device found at address 0x28  !
done

EM7180 ROM Version: 0xE69
Should be: 0xE609
EM7180 RAM Version: 0x00
EM7180 ProductID: 0x80 Should be: 0x80
EM7180 RevisionID: 0x2 Should be: 0x02
0 //this is featureFlag
1 //this is status
EEPROM detected on the sensor bus!
EEPROM upload successful!
Beginning Parameter Adjustments
// this is after delay
//getting 255 forever

So it seems as any delay I do messes the communication. Probably my fault somewhere.

bmegli commented 6 years ago

Should the 4.7 k pullup resistors be installed on SCL and SDA lines? (this is what I did)

kriswiner commented 6 years ago

There are already 4K7 pullups on the board

On Sat, Jun 30, 2018 at 1:35 PM, Bartosz Meglicki notifications@github.com wrote:

Should the 4.7 k pullup resistors be installed on SCL and SDA lines? (this is what I did)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/28#issuecomment-401564793, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qnRjPO-tLo7Mkz8IL-NFPpqNv4pVks5uB-D-gaJpZM4U-FgM .

bmegli commented 6 years ago

You can check, run an I2C scan using the SDA_M/SCL_M (master bus) and see if you can detect the EEPROM (0x50 & 0x58) as well as the MPU9250 (0x68) and BMP280 (0x77). Let me know what the result is.

This is what I got but results are not consistent (suggesting communication problem) In other words, I get different results on different runs.

Scanning...
I2C device found at address 0x50  !
I2C device found at address 0x58  !
I2C device found at address 0x76  !
done

I will investigate with communication layer.

kriswiner commented 6 years ago

Then you have a connection problem, and/or an I2C problem with your MCU (which is?) and you are not seeing the MPU9250 0x68, another problem.

On Sat, Jun 30, 2018 at 2:00 PM, Bartosz Meglicki notifications@github.com wrote:

You can check, run an I2C scan using the SDA_M/SCL_M (master bus) and see if you can detect the EEPROM (0x50 & 0x58) as well as the MPU9250 (0x68) and BMP280 (0x77). Let me know what the result is.

This is what I got but results are not consistent (suggesting communication problem) In other words, I get different results on different runs.

Scanning... I2C device found at address 0x50 ! I2C device found at address 0x58 ! I2C device found at address 0x76 ! done

I will investigate with communication layer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/28#issuecomment-401566034, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgIwZix85ncGFcbfpsj8nsMY6rXgks5uB-bkgaJpZM4U-FgM .

bmegli commented 6 years ago

MCU Teensy 3.5 (mentioned in first post)

Yes, I am investigating.

kriswiner commented 6 years ago

Are you using i2c_t3?

On Sat, Jun 30, 2018 at 2:12 PM, Bartosz Meglicki notifications@github.com wrote:

MCU Teensy 3.5 (mentioned in first post)

Yes, I am investigating.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/28#issuecomment-401566563, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qo3su6ck6VPemfAz8Cc-XsnRAHxDks5uB-m6gaJpZM4U-FgM .

bmegli commented 6 years ago

Are you using i2c_t3?

Yes

Now I also tried with plain Wire with the same result.

Commenting out some more delays it gets further until I2C communication breaks and I keep getting 0xFF for every byte.

Anyway, thanks for any help, I will investigate the communication layer.

kriswiner commented 6 years ago

Can you use I2C with the Teensy 3.5 with any I2C sensor? I don;t think the Teensy is working properly...

On Sat, Jun 30, 2018 at 2:32 PM, Bartosz Meglicki notifications@github.com wrote:

Are you using i2c_t3?

Yes

Now I also tried with plain Wire with the same result.

Commenting out some more delays it gets further until I2C communication breaks and I keep getting 0xFF for every byte.

Anyway, thanks for any help, I will investigate the communication layer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/28#issuecomment-401567558, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtN_XMh7WXlFysws_36BMNPp2Wwrks5uB-6KgaJpZM4U-FgM .

bmegli commented 6 years ago

Can you use I2C with the Teensy 3.5 with any I2C sensor?

No idea ;-)

I am new to Teensy. I have some I2C devices that I use with Linux.

Preparing connectors would take some time so I will resort to trying simpler methods first.

Anyway, thanks for good suggestion.

bmegli commented 6 years ago

Ok!

After re-soldering and rewiring everything I got it working.

One thing to note:

I was getting error recv addr NACK which led the example astray.

Apart from working the device now also returns RAM version correctly (non 0).

bmegli commented 6 years ago

Works like a charm!

Thanks for help ;-)