Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvenSense ICM-20948 DMP Flash error #30

Open
zq649 opened this issue Mar 16, 2018 · 11 comments
Open

InvenSense ICM-20948 DMP Flash error #30

zq649 opened this issue Mar 16, 2018 · 11 comments

Comments

@zq649
Copy link

zq649 commented Mar 16, 2018

Hi,
I am using ICM-20948 by TDK InvenSense, which has on board digital motion processing unit. My host processor is MediaTek MT-2523G.
InvenSense provides DMP firmware, that has to be programed on DMP to access it features. I am using I2C to communicate with ICM-20948. I am able to get the RAW accel data. But when I try to write the firmware bytes on DMP, somehow my writes are not getting to its memory.
I've seen on InvenSense developers form, most of the people are facing this issue. When I write the bytes to DMP memory, I get ACK from the device, but when I try to verify the DMP memory, I recieve garbage values.
I would be very thankful, if I get solution of this problem.

Furthermore, is there any activity recognition library, which take axis data as input and tells us user's activity.

@kriswiner
Copy link
Owner

kriswiner commented Mar 16, 2018 via email

@tatulea
Copy link

tatulea commented Sep 5, 2018

@QasimZ can you send me an email, please? I am interested in finding more about ICM-20948 ([email protected])

Thanks

@dtquang89
Copy link

Hi, do you have any solutions for this issue? Thank you.

@kriswiner
Copy link
Owner

kriswiner commented Apr 9, 2019 via email

@zq649
Copy link
Author

zq649 commented Apr 10, 2019

Hi, do you have any solutions for this issue? Thank you.

which communication protocol are you using?

@dtquang89
Copy link

I’m using SPI.

@zq649
Copy link
Author

zq649 commented Apr 10, 2019

In ICM20649Transport.h what values have you set for INV_MAX_SERIAL_READ and INV_MAX_SERIAL_WRITE?

I have set them to 1.

I am also posting my spi send and recv routine.

`static int spi_master_transfer_tx(void * context, uint8_t register_addr, const uint8_t * value, uint32_t len)
{

data[0] = register_addr & WRITE_BIT_MASK;
for ( int i = 0 ; i < len ; i++)
{
	data[i + 1] = *value;
	value++;
}

spi_send_and_receive_config.send_length = 1;
spi_send_and_receive_config.receive_length = len + spi_send_and_receive_config.send_length;
spi_send_and_receive_config.send_data = data;
spi_send_and_receive_config.receive_buffer = status_receive;
if(HAL_SPI_MASTER_STATUS_OK != hal_spi_master_send_and_receive_dma_blocking(ICM_SPI_CHANNEL,&spi_send_and_receive_config))
	return -1;
return 0;

}`

`static int spi_master_transfer_rx(void * context, uint8_t register_addr, uint8_t * value, uint32_t len)
{
//hal_gpt_delay_ms(200);
spi_send_and_receive_config.send_length = 1;
spi_send_and_receive_config.receive_length = len + spi_send_and_receive_config.send_length;
data[0] = register_addr | READ_BIT_MASK;
spi_send_and_receive_config.send_data = data;
spi_send_and_receive_config.receive_buffer = status_receive;
if(HAL_SPI_MASTER_STATUS_OK != hal_spi_master_send_and_receive_dma_blocking(ICM_SPI_CHANNEL,&spi_send_and_receive_config))
return -1;
//printf("\r\n %x \r\n",status_receive[1]);
for (int i = 0 ; i < len ; i++)
{
*value = status_receive[i+1];
value++;
//printf("\r\n status = 0x%02x \r\n",status_receive[i+1]);
}
return 0;

}`

@dtquang89
Copy link

Thank you for helping me. Actually changing the values doesn't solve the problem. I am using ICM with nRF52. I'm now sure why.

@zq649
Copy link
Author

zq649 commented Apr 16, 2019 via email

@dtquang89
Copy link

I haven't found a solution yet. I'm still looking for it.

@mpcrowe
Copy link

mpcrowe commented Aug 28, 2019

Just a note. I had a similar problem. The problem was solved by copying the firmware from const memory into RAM. The SAM3U4 we are using does not properly DMA to/from FLASH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants