gregtomasch / USFSMAX

Example host MCU sketch to demonstrate use of the USFSMAX coprocessor
12 stars 2 forks source link

2d DHI corrector causes program to get stuck in start up #5

Open SethEArnold opened 3 years ago

SethEArnold commented 3 years ago

I'm using the Dragonfly board and everything works fine with the 3d DHI correction or no DHI correction but when I enable 2d DHI correction it gets stuck during the initialization steps.

The serial debug output looks like this:

Scanning...
I2C device found at address 0x57!
I2C scan complete

Initializing USFSMAX_0...
USFSMAX_0:

Configuring the coprocessor...

Fusion status: 0

USFSMAX sensor fusion running!

USFSMAX Sensor Status: 0 (Should be 0)

Coprocessor configured! Reading sensor calibrations...

And then it hangs forever.

gregtomasch commented 3 years ago

Hi Seth,

I have never seen this before... A few questions:

1) Do you have more than one unit? If so, do both units do this? 2) How are you connecting to the USFSMAX board? Soldered connections or with mechanical push-in machine header pins? 3) Approximately when did you purchase this unit?

Best Regards, Greg

SethEArnold commented 3 years ago
  1. My group got a few boards. After some testing I was able to confirm that this works correctly on at least 2 other boards and only the one I was using for testing isn't working.
  2. Soldered connection.
  3. About 3 weeks ago.

Thanks for the help, seems this isn't a software issue so I'll close the issue.

SethEArnold commented 3 years ago

This afternoon when I went to do some tests with these boards I found that when I reset the DHI correction the previously working boards stopped working with 2D DHI correction. So I guess this issue actually still exists I just hadn't noticed it earlier when I did my brief tests with the other boards.

gregtomasch commented 3 years ago

Hi Seth, is this problem still on0going?

Architeuthis-Flux commented 1 year ago

I'm also have the same issue with both of the modules I bought recently (~2 months ago.) They worked at first but it seems after a few 2D DHI resets, it hangs as soon as I write 0x50 to the Calibration Request register. I2C stops and doesn't work again until a power cycle. But, it works fine if I write 0x10 for 3D DHI.

Oddly, I tried settling the MSB that's marked in the register map as N/A and writing 0xD0 and that worked a few times but then stopped working after roughly the same number of times that the original 0x50 worked.

It's going in a car so 3D DHI probably won't work. Let me know if you can think of a workaround or if you'd like me to test things and tell you the results.

Thanks!

Architeuthis-Flux commented 1 year ago

After some throwing some code against the wall and seeing what sticks, I think I may have found the issue.

It seems like enabling the 2D DHI at startup without a current valid HI offset in memory is what's causing it to hang. Not sure why the 2D DHI checks for this while the 3D DHI doesn't.

The workaround I just found is to upload the code with the 3D DHI enabled, reset the DHI and get a valid offset, then upload the code again with 2D DHI enabled and then reset DHI again to get a valid 2D offset.