Hello,
I use MPU6050EVB with i2c connection to separate AVR32UC3 controller.
When I call the function umplStartMPU(), the product revision "prod_rev" in the function inv_get_silicon_rev_mpu6050() cannot be read correctly. It reads always 0. This gives us an error "INV_ERROR_INVALID_MODULE". So I tried to give a value directly to "prod_rev"(from 1 to 15 and 27). And I got another problem, in the function inv_mpu_set_firmware(), I cannot successfully write and read the memory, it means that the elements of "data" are different from those of "read", which gives us an error "INV_ERROR_SERIAL_WRITE".
Any idea?
thanks
- Log in to post comments
phpbb Topic ID
13515
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Additionally, in the function inv_mpu_set_firmware(), the problem exists only when the variable "bank"=0. We can write and read without any problem for the values of "bank" from 1 to 7.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Resetting the device and waiting 15ms should resolve this issue.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
@app1engineer wrote:
I have tried it and I have also added several ms of delay between the read/write. But the issue cannot be resolved.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Was there another answer to this? I'm having the same problem. I have two eval boards and they both exhibit the same behavior. Can't read product rev. or load what I assume is the dmp code. I'm attempting to port to the UC3C architecture but not getting past this block.
Thanks
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
It appears that you may be having a problem accessing the DMP memory, which is where the product rev is located.
Can you provide the following information so that we can further look into the issue -
1. We are asusming you are using the MPU-6050 boards to port to the UC3 platform. Is that correct ?
2. Which version of the library are you using. Is it A2 or B1 ?
3. Did you call the umplInit function ? umplInit is the entry point to uMPL and must be called before all other functions.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
1) Yes, I am using the MPU-6050 EVB. I have tried both building my own code up using the embedded apps and approached it by using the uc3_a3_xplained code with the necessary modifications for the UC3C and my board.
2) I am building it as a 6-DOF board using rev B1. (The EVB board itself is 9 DOF capable so I assumed that was the correct rev to chose.)
3) Yes, in both cases umplInit is called. I can confirm that TWI is working for
the other registers, but it appears that the writes to mem (i.e. anything using inv_serial_write_mem) isn't taking. The read_mem returns non-zero data but it clearly doesn't match what was written. Unlike the above case, it still doesn't work even if I skip bank 0. The request for rev often returns something like 49.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
@punk wrote:
I have run into the same problem. I discovered that the mem bank reads appear to be reading sequential registers instead of repeated bytes from the same MEM_R_W register. The data read did not match what I wrote, but it did match what I expected to see in the next register addresses, all the way up until I ran out of registers to read.
It is likely that the I2C read/write code implementation you are using is behaving differently from that built into MotionApps (this is my current hunch, but I haven't verified and solved it yet). I2C supports a repeated-start condition, but some implementations don't make use of it. I believe that repeated starts are necessary to use the MEM_R_W register as intended. I could be wrong, but maybe now you have another place to look that will lead to a helpful discovery.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Repeated start condition is supported by the library. You can use it with the MEM_R_W register. Please let us know if it helps solve the issue.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Same problem here I think!
Has anyone figured it out? Is the problem in the AVR Software Framework, that TWI functions are behaving in different way?
I thought that the TWI functionality came from the ASF that is included in the project downloaded from Invensense? Can it be that AVR Studio 5.1 automatically uses a newer version of the files if they are installed on the computer?
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
@app2engineer wrote:
Hello,
I am using a Luminary LM3S811 to implement the MotionApps, and I have the same problem : In the function inv_get_silicon_rev_mpu6050, when I am trying to read prod_rev, I read 0.
I am using a MPU6050 revision D. (I read "1202 D" on the chip).
Thanks for your help.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Have you downloaded the software recently?
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Yes I have the EMBEDDED_MOTIONAPPS-V2_0_2Rel-MPU6050-6axis-2012-05-02-1255 downloaded last week.
I use the IDE : Code Composer Studio v4 because I use a µC from Texas Intruments.
I have compiled with all DEBUG settings set to NONE, as it is said here : https://invensense.tdk.com/developers/forum/viewtopic.php?f=3&t=155. In CCS4 it seems to be in basic option of the compiler and it is called suppres all symbolic debug generation
But I still have :
prod_ver = 8
prod_rev = 0
index = 65535
Unsupported product key 800 in MPL
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
800 is an invalid key. The prod_rev value comes from OTP memory, and prod_rev = 0 usually means that either the DMP read/write function was ported incorrectly, or the startup delay isn’t fast enough.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
@sectionsbest wrote:
What is the startup delay, as it relates to DMP usage and/or memory bank read/write operations? I have had mixed success with my own experiments here, and while the code I have right now appears to be working, I am not sure why based on the changes I made (none of which seem like they were significant enough to fix everything all at once). Is there a required minimum or maximum delay after power-on or reset before you can read memory banks, or write them?
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Specified delay is 30 milliseconds, but can be up to 100 milliseconds after power up before any registers on the MPU device are read. Put a delay in before starting the eMPL engine.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Hello,
I manage to make the initialization works, with your recommendation (not read MPU register before 30ms). I had some problems after that because my stack memory was to small ... I fixed it.
Now I can go inside the Loop and read Quaternions, but there is a problem in the values of the quaternions, they are always as follow :
[64, 0, 0, 0, 0, 0, 0, 0] (I don't display buttons and packetCount++)
I used this code to format the output values :
Do you know why it seems to be frozen like that ?
Thanks
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
I can read temperature and it corresponds to the room temperature (Temp = 1834026, Temp= 1838024, Temp = 1843113 , ...), is it normal if it take times to reach a stabilized value ?
But any use of inv_get_accel, inv_get_gyro, inv_get_quaternion has 0 for the value (only one paramameter is 64 or 2^30 if not trunkated.
Any ideas why it seems the fifo not work properly ?
Thanks.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
You can always attempt gyro/accel raw data reads to verify it is not a hardware issue. However, your value 741619291 appears to be a 32-bit number, so it seems your casting does not work as you intend.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
I have try to read directly the accel and gyro registers and their values are updated. so the device is not into sleep mode.
Actually it seems that I can't read the FIFO because I get a length of 0 when calling inv_get_fifo_length.
Are you sure that what is said here https://invensense.tdk.com/developers/forum/viewtopic.php?f=3&t=131&hilit=enable+fifo is right ?
If I read the register 0x23 (FIFO_EN) I see 0. so I should be why nothing is put into the FIFO ...
Thanks
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
If your serial layer wasn’t ported correctly, then the DMP image pushed to the hardware might be wrong, or, like the referenced thread, you might have an endian problem.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
I'm attempting to port motionapps to the UC3C architecture.
I'm using MPU6000 rev C with a custom board using I2C serial comunication (AD0 and CS pin connect to ground).
I'm building the project as a 6-DOF board using rev A2.
When I call the function umplStartMPU(), the product revision "prod_rev" in the function inv_get_silicon_rev_mpu6050() cannot be read correctly. It reads always 0.
I tried whitout succes to put in a 100ms delay before starting the eMPL engine ( umplStartMpu() ).
Any ideas to fix the problem?
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
Maybe the issue is related to twim driver.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
After a sufficient start-up delay, there should be no issues communicating with the device registers. The operation of MPU-6000 with the eMPL 2.0 is not officially supported, however, and the product key will not match the product devices included within the project. Developers have reported that they have modified the project successfully to default the device to a "MPU-6050" operation mode after the product ID is read. Please review the prod_rev_map() function in the mldl_cfg.c file, which is released as part of the project.
Re: Re: [urgent] Cannot read product revision on MPU6050 eval bo
I've found and fixed the problem.
As I supposed, there was a problem with I2C comunication.
I deleted twim.h and twim.c files provided with the MotionApps 2.0.2 and I loaded the TWI - Two-Wire Interface module from ASF (3.4.1 version).
Then in mlsl_at32.c I renamed all the functions twim_write and twim_read in twi_write and twi_read respectively.
Then I added these lines of code at the begining of mlsl_at32.c:
That's it... Now it works.