<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22087/use-dmp-of-mpu9250</link><description>my code is below.
 git_mpu9250_dmp.zip 
 Hello. 
 I use nRF52 &amp;amp; MPU9250.
I want to use DMP,
but I can&amp;#39;t read data with DMP.
Because it have failed that writting firmware. 
 I want to check connect sensor between nRF,
I made a code for reading</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 May 2017 05:30:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22087/use-dmp-of-mpu9250" /><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86786?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 05:30:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95d549c9-3b51-477d-bd99-775ed1980ec5</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;hmm. I have not try DMP and BLE.
Now, my problem is millis() don&amp;#39;t move.
And I want to look your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86785?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 05:26:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:532586cf-8c4f-4ce1-8b04-cd010498116a</guid><dc:creator>satish</dc:creator><description>&lt;p&gt;when i try to receive the  DMP output via the Bluetooth Application its not working, i thought Nordic Bluetooth (ble) Services are conflicting with DMP code,i can&amp;#39;t able to update the device name also.Have you faced it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86784?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 04:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b61b4fb5-dc58-48b5-bd21-d255ecf9d300</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;Hi,satish.
It&amp;#39;s good news:).
And I have not added another output.
please tell me why conflicting dmp.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86783?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 04:50:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2439b493-5525-4f37-ac31-0e7aaf97c7fe</guid><dc:creator>satish</dc:creator><description>&lt;p&gt;Hi Sagisawa Yukichi ,I can able to load the Firmware Successfully Now thanks for your cooperation and did you added the ble services to your project ? is it working fine with ble services ? because in my code ble is conflicting with the DMP ,i can&amp;#39;t able to find the issue .Please help me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86782?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 09:21:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e0eead6-c6d4-4578-a886-f39a4c0135c3</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;I hope to get your good reply!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86781?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 04:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1b1172b-ea1a-48a6-aca1-f4c0fa530129</guid><dc:creator>satish</dc:creator><description>&lt;p&gt;Thanks a lot Sagisawa Yukichi,i will check with my code.once again thanks for your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86780?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 00:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a98d206-003c-4494-8ac1-9becbb252b08</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;Hi satish,
I added my code that I changed.
I missed writing register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86779?ContentTypeID=1</link><pubDate>Sun, 21 May 2017 08:16:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5931b215-30c6-485e-80cc-c96e9f24aa7d</guid><dc:creator>satish</dc:creator><description>&lt;p&gt;Hi Sagisawa Yukichi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also getting same error i&amp;#39;m glad to here that you solved that error if you don&amp;#39;t mind please help me where did you done the modification to load DMP firmware successfully so it really helpful to me.&lt;/p&gt;
&lt;p&gt;Thanks .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86778?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 02:09:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf47af15-46fd-4190-97fc-d799fbde55f2</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;I thought again, I solved this problem.
This problem was mistake resister to be written.&lt;/p&gt;
&lt;p&gt;Thank you for the advice,it was very helpful!!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if ((errCode = mpu_write_mem(ii, this_write, progBuffer))) {
					free(progBuffer);
        return -3;
    }
    
    if (mpu_read_mem(ii, this_write, cur)){
					free(progBuffer);
        return -4;
			}
        
    if (memcmp(progBuffer, cur, this_write)) {
				printf(&amp;quot;this_write = %d \r\n&amp;quot;,this_write);
				for (int i = 0; i &amp;lt; this_write ; i++){
				  printf(&amp;quot;progBuffer = %x , cur = %x\r\n&amp;quot;,progBuffer[i],cur[i]);
				}
				free(progBuffer);
      return -5;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Additional note @2017/05/22&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know  necessary 2 i2c_write.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define i2c_write_one call_mpu9250_write_m
#define i2c_write call_mpu9250_write

static uint32_t mpu9250_write(uint8_t address, uint8_t reg, uint32_t length, uint8_t const * p_data)
{
    uint32_t err_code;
	
		for(uint8_t i = 0; i &amp;lt; length ; i++){
			
			uint8_t packet[2] = {(reg+i), p_data[i]};
#ifdef PTEST
			printf(&amp;quot;calledw #2\r\n&amp;quot;);

				nrf_delay_ms(10);
			printf(&amp;quot;%d,%d,%d\r\n&amp;quot;,address,packet[0],packet[1]);
	
#endif
			err_code = nrf_drv_twi_tx(&amp;amp;m_twi_instance, address, packet, 2, false);
			if(err_code != NRF_SUCCESS) {
				printf(&amp;quot;mpu9250_write error %d\r\n&amp;quot;,err_code);
				nrf_delay_ms(50);
				
			  return err_code;
			}
			 #ifdef PTEST
			printf(&amp;quot; timer &amp;quot;);
			//	nrf_delay_ms(10);
			#endif
			
			if(!waitInt(MPU9250_TWI_TIMEOUT)){
					printf(&amp;quot; timeout...w &amp;quot;);
					nrf_delay_ms(10);
					return NRF_ERROR_TIMEOUT;
			}
			twi_done = false;
	
		}
			
			#ifdef PTEST
		printf(&amp;quot;write_end! %d\r\n&amp;quot;,err_code);
				nrf_delay_ms(10);
			#endif
    return err_code;
}


uint32_t call_mpu9250_write(uint8_t address, uint8_t reg, uint32_t length, uint8_t const * p_data){
		return mpu9250_write(address, reg, length , p_data);
}

static uint32_t mpu9250_write_m(uint8_t address, uint8_t reg, uint32_t length, uint8_t const * p_data)
{
    uint32_t err_code;
	for(uint8_t i = 0; i &amp;lt; length ; i++){
		uint8_t packet[2] = {(reg), p_data[i]}; //write to same regster

#ifdef PTEST
		printf(&amp;quot;calledwm #2\r\n&amp;quot;);
		nrf_delay_ms(10);
		printf(&amp;quot;%d,%d,%d\r\n&amp;quot;,address,packet[0],packet[1]);
	    nrf_delay_ms(10);
#endif
			
		err_code = nrf_drv_twi_tx(&amp;amp;m_twi_instance, address, packet, 2, false);

#ifdef PTEST
		printf(&amp;quot;end nrf_drv_twi_tx\r\n&amp;quot;);
		nrf_delay_ms(10);
#endif			
			
		if(err_code != NRF_SUCCESS) {
			printf(&amp;quot;mpu9250_write error %d\r\n&amp;quot;,err_code);
			nrf_delay_ms(50);
			return err_code;
		}
			
#ifdef PTEST
		printf(&amp;quot; timer &amp;quot;);
		nrf_delay_ms(10);
#endif
			
		if(!waitInt(MPU9250_TWI_TIMEOUT)){ //if waitInt() return true,then twi is done.
			printf(&amp;quot; timeout...wm &amp;quot;);
			nrf_delay_ms(10);
			return NRF_ERROR_TIMEOUT;
		}
			
		twi_done = false;
	}
		
#ifdef PTEST
	printf(&amp;quot;write_m_end! %d\r\n&amp;quot;,err_code);
	nrf_delay_ms(10);
	#endif
   return err_code;
}

uint32_t call_mpu9250_write_m(uint8_t address, uint8_t reg, uint32_t length, uint8_t const * p_data){
		return mpu9250_write_m(address, reg, length , p_data);
}

int mpu_write_mem(unsigned short mem_addr, unsigned short length,
        unsigned char *data)
{
    unsigned char tmp[2];

    if (!data)
        return -1;
    if (!st-&amp;gt;chip_cfg.sensors)
        return -2;

//		printf(&amp;quot;sensors = %d\r\n&amp;quot;,st-&amp;gt;chip_cfg.sensors);
		
    tmp[0] = (unsigned char)(mem_addr &amp;gt;&amp;gt; 8);
    tmp[1] = (unsigned char)(mem_addr &amp;amp; 0xFF);

    /* Check bank boundaries. */
    if (tmp[0] + length &amp;gt; st-&amp;gt;hw-&amp;gt;bank_size)
        return -3;

    if (i2c_write(st-&amp;gt;hw-&amp;gt;addr, st-&amp;gt;reg-&amp;gt;bank_sel, 2, tmp))
        return -4;
    if (i2c_write_one(st-&amp;gt;hw-&amp;gt;addr, st-&amp;gt;reg-&amp;gt;mem_r_w, length, data))
        return -5;
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86776?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 14:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:710ee492-b3d2-4cf1-9f65-9d0c362645d8</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;Thanks your comment.
and sorry, I mistyped.
Error happened  at in mpu_load_firmware(), and it returns -5.
Because this function failed memcmp.
I want to write 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00,
but it was not written.
I think there is problems mpu9250_write.
However, I can&amp;#39;t understand what this solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86775?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 13:49:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83767be9-574e-4630-856b-4e20face51a9</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;So you get -5 returned from mpu_write_mem(). That occurs when an error is propagated down the path from mpu_write_mem()-&amp;gt;i2c_write()-&amp;gt;call_mpu9250_write()-&amp;gt;mpu9250_write(). In other words,
501 characters leftadd commentcancelsomething appears to go wrong in mpu9250_write(). You should try to debug your code to figure out exactly what goes on inside this function, which function returns the error, and what the error is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86777?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 12:47:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90f3ca43-13e7-4fad-94ef-86342421f324</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;Sorry. and upload in zip.
Please read my code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86774?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 11:18:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5090d892-58bc-4831-87fb-bb1adc13703e</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;That was a very confusing web site and I don&amp;#39;t read Japanese. Can you edit your original question and attach the relevant files there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86773?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 11:07:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07764187-b2ed-4017-8a0d-3dca45600a64</guid><dc:creator>Sagisawa Yukichi</dc:creator><description>&lt;p&gt;I can&amp;#39;t use dmp, but I could get the data from MPU9250 without dmp in another code.
At int mpu_write_mem, return -5.&lt;/p&gt;
&lt;p&gt;it&amp;#39;s my code.
&lt;a href="http://30.gigafile.nu/0525-c9e344792e26c6753817daea4df43a97d"&gt;30.gigafile.nu/0525-c9e344792e26c6753817daea4df43a97d&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Use DMP of MPU9250</title><link>https://devzone.nordicsemi.com/thread/86772?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 10:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f69d2bc-d405-48a6-8c87-9d41dc8b0c8c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Are you able to use the MPU9250 successfully without the DMP?&lt;/p&gt;
&lt;p&gt;Do you mind sharing your code showing how you do your read operations?&lt;/p&gt;
&lt;p&gt;Do you get any errors returned from the TWO read/write functions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>