Openimu300ZI SPI communication using TX2 spidev

Hi, I followed the process below, but still don't get what I want.

  1. flash the IMU to the newest VG_AHRS/INS program.

  2. inside program:
    initialize SPI
    sleep 500ms
    sleep 500ms

  3. CS(using GPIO)->LOW
    transfer 0x04, 0x00
    transfer 0x00, 0x00
    CS(using GPIO)->HIGH


  1. I choose to use GPIO as CS control, because the spidev automatically pull high the CS between data blocks. So I use GPIO to always keep it low during transmit and receive.
  2. According to the time printed out in my program, the time span between transmit and receive is about 500 usec, which is greater than 20 usec, so I expect it to be working.
  3. Reading most of the registers give back 0x00s, only some give back weird results, like 0x37, 0x56, 0x57.
    transmit 0x37 gives back 0x00 0xc0
    transmit 0x56 gives back 0x60 0x00
    transmit 0x57 gives back 0x00 0x06
    I guess this is because the data shift for 1 bit or something, so this would be a minor problem.
    But except these, the other registers don't give any information.

I'd like to know what else I can do to receive some information about the accelerations, rates, and angles.

  1. Remove "nRST->LOW" and "nRST->HIGH" ,at the same, dont connect the nRst.
  2. Add "delay(20us)" after "CS(using GPIO)->LOW" and add "delay(20us)" befor "CS(using GPIO)->HIGH
  3. Retry it, Pls.

@chengyong Thanks for your reply.
But I have a clearer picture now, so I gotta ask another question.
I really need a quick reply now. Hope someone could answer me as soon as possible~

As in the photos below, I am able to read data by sending 0x56, but nothing from 0x04.
The third photo shows the output of every single read.
Also I am able to burst read from 0x3E but not 0x3D.


I am now using arduino to transfer SPI signals.
I used STlink to flash the software to INS app by the method shown here:
(I downloaded the bin file from here

I don't know if it is the hardware problem or the software problem.
Please help me investigate.

looking forward for your help.

Sincerely looking forward for your help.

My SN number is 2008400344

@cek @Li-YiFan
Sincerely looking forward for your help.
My SN number is 2008400344

I have now recovered the whole EEPROM bin which I backed up.
Everything works fine, including all single reads and 0x3E burst read.
So maybe it confirms that the INS app from is having some problem(?
Or maybe the way I uploaded the firmware is incorrect.

Following the ST-link method instruction.
I did the folowing:

  1. download the bin file of firmwares
  2. start uploading from the address 0x08010000

Do I have to set the ending address or something?
If this is not the problem, then perhaps I 'll need to ask for a customized bin file with my SN number 2008400344.
And I'd like to have the VG_AHRS firmware.
I couldn't get data from VG_AHRS at first, so I turned to the INS app.
After all , I just want to get the angle data + rate data.

Truly appreciate!
Looking forward to any reply!

I noticed that there is an initialization issue in AHRS and INS app.
Is it necessary if I want to get data from burst read 0x3D?

@drib861204 Hi, I didn't have a 300zi available to do a tset as you said these days, but now I do and I will do a tset and reply you as soon as possible.

@Liang-Zhang Many thanks!
May I update what I've tried these days.
I used the upload function from vscode aceinna extension to upload VG_AHRS to my imu.(photo 1)
The imu output is the same as I downloaded the bin file from
They both can only answer to 0x56, 0x3E, etc, but not 0x3D and others.(photo 2)
So I feel like I skipped the initialization step of this app.
But still I have no idea how to initialize.

I solved the problem adding volatile to "data" in the function: void FillSPIBurstDataBuffer() inside UserMessagingSPI.c on VSCode open source VG-AHRS application.
Now I can finally get roll and pitch angles by sending 0x3D SPI command.
If this error happens to other openimu300zi's, then it is a freaking HUGE bug that should've been solved already.
Anyone suffers from the same problem? Or anyone uses SPI on openimu300zi and finds it works just fine? Let me know if you are in either of the situation. Thanks!

Hi folks
Here is the arduino codes I use, please use them if you need some quick setup.
openimu300zi.ino serial monitor:
openimu300zi_roll_pitch.ino serial plotter:

Log in to reply