Used stm32f401ccu6 BlackPill board from WeAct..
I also reduced the pull-up resistors from 10 kΩ to 4.7 kΩ.
Looking ahead, I will say that this did not change anything in the work.
About I2C connection here.
Core for Arduino IDE here.
Bought two bread-boards MPU9250 and began to look for libraries to work with accelerometers, gyroscopes and magnetometers.
I tried the bolderflight library, but it constantly gave an error connecting to the serial port.
PS C:\Users\Admin> arduino-cli monitor -p COM6 -c baudrate=115200
Monitor port settings:
baudrate=115200
Connected to COM6! Press CTRL-C to exit.
Error initializing communication with IMU
Also tried the asukiaaa library, but there is also a problem with the connection.
In order to deal with the problem, I connected using the I2C bus analyzer and saw that the sensor gives a response of 0x70 to the "who-I-am" request.
From this, I realized that my boards are fake, and there is no magnetometer on them.
I was very frustrated that I could not try and use the MPU9250 boards for my navigation tasks - I wrote an angry letter to the seller from Aliexpress, but he did not even answer me ...
What was my surprise when, having loaded the sketch of the SparkFan library, I saw the treasured readings of the accelerometer and gyroscope.
Accel: -0.01, 0.09, 1.01 g
Gyro: -4.57, 4.51, 1.65 dps
Mag: 0.00, 0.00, 0.00 uT
Time: 118769 ms
Accel: -0.02, 0.12, 1.01 g
Gyro: -4.70, 2.99, 2.01 dps
Mag: 0.00, 0.00, 0.00 uT
Time: 120776 ms
Accel: -0.02, 0.14, 1.01 g
Gyro: -4.45, 3.54, 2.01 dps
Mag: 0.00, 0.00, 0.00 uT
Time: 122785 ms
Accel: -0.04, 0.17, 1.00 g
Gyro: -4.76, 2.99, 2.01 dps
Mag: 0.00, 0.00, 0.00 uT
Time: 124796 ms
The magnetometer of course showed zeros.
I also tried uploading a sketch with a quaternion calculation, and it also worked, although I thought that to calculate the quaternion - you need data from a magnetometer.
I fiddled with countless firmware and library downloads for about three days.
The next day, I demanded to upload the SparkFan sketch again to my stm32f401ccu6 board, and to my extravagance, the serial port did not give out any data.
I decided to check the communication on the I2C bus - also silence.
I thought maybe something happened to his PC overnight and rebooted.
After the reboot, I got a BSOD and spent another three days trying to restore the work of a personal computer - the SSD broke (and I think this happened because of its 4-year work).
While I was restoring the PC, I tried to download the SparkFan sketch on my second computer (laptop), but it still did not work.
I have already begun to think that perhaps it seemed to me that the MPU9250 board worked and gave out data, but the screenshots do not let me forget this.
Now I'm working on a restored PC, but none of the libraries for the MPU9250 work.
I don’t know what it was .... a miracle or what happened to the hardware (my STM32 microcontroller, MPU9250 board, STmicroelectronics core for Arduino or some other mysticism.)
Can anyone give some advice/information on what happened?
Commands are sent via the I2C bus from the microcontroller to the MPU9250, but there is no output to the serial port, as if the controller freezes.
But I have already changed three microcontrollers, I also tried to run the code on the ESP32 ... the same thing.
I remembered what I did before the SSD crashed, and it seems like I updated the core, but the branch itself does not consider that the problem is with the core and I2C.
Used
stm32f401ccu6
BlackPill board from WeAct.. I also reduced the pull-up resistors from10 kΩ
to4.7 kΩ
. Looking ahead, I will say that this did not change anything in the work. AboutI2C
connection here. Core for Arduino IDE here. Bought two bread-boardsMPU9250
and began to look for libraries to work with accelerometers, gyroscopes and magnetometers. I tried the bolderflight library, but it constantly gave an error connecting to the serial port.Also tried the asukiaaa library, but there is also a problem with the connection. In order to deal with the problem, I connected using the I2C bus analyzer and saw that the sensor gives a response of
0x70
to the "who-I-am" request.From this, I realized that my boards are fake, and there is no magnetometer on them. I was very frustrated that I could not try and use the
MPU9250
boards for my navigation tasks - I wrote an angry letter to the seller from Aliexpress, but he did not even answer me ... What was my surprise when, having loaded the sketch of the SparkFan library, I saw the treasured readings of the accelerometer and gyroscope.The magnetometer of course showed zeros. I also tried uploading a sketch with a quaternion calculation, and it also worked, although I thought that to calculate the quaternion - you need data from a magnetometer.
I fiddled with countless firmware and library downloads for about three days. The next day, I demanded to upload the SparkFan sketch again to my
stm32f401ccu6
board, and to my extravagance, the serial port did not give out any data. I decided to check the communication on the I2C bus - also silence. I thought maybe something happened to his PC overnight and rebooted. After the reboot, I got a BSOD and spent another three days trying to restore the work of a personal computer - the SSD broke (and I think this happened because of its 4-year work).While I was restoring the PC, I tried to download the SparkFan sketch on my second computer (laptop), but it still did not work. I have already begun to think that perhaps it seemed to me that the
MPU9250
board worked and gave out data, but the screenshots do not let me forget this. Now I'm working on a restored PC, but none of the libraries for theMPU9250
work. I don’t know what it was .... a miracle or what happened to the hardware (mySTM32
microcontroller,MPU9250
board,STmicroelectronics core
for Arduino or some other mysticism.) Can anyone give some advice/information on what happened? Commands are sent via theI2C
bus from the microcontroller to theMPU9250
, but there is no output to the serial port, as if the controller freezes. But I have already changed three microcontrollers, I also tried to run the code on theESP32
... the same thing. I remembered what I did before theSSD
crashed, and it seems like I updated the core, but the branch itself does not consider that the problem is with the core and I2C.