<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic I2C_RTOS_Transfer does not send Stop if dataSize is 0 in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-RTOS-Transfer-does-not-send-Stop-if-dataSize-is-0/m-p/701896#M7516</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've found that &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;EM&gt;I2C_RTOS_Transfer&lt;/EM&gt;&lt;/SPAN&gt; does not send a &lt;STRONG&gt;Stop&lt;/STRONG&gt; if dataSize is 0.&lt;/P&gt;&lt;P&gt;Am I doing something wrong or is there a bug is the API?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a &lt;A href="https://www.sensirion.com/en/environmental-sensors/humidity-sensors/humidity-temperature-sensor-sht2x-digital-i2c-accurate/"&gt;Sensirion SHT 21&lt;/A&gt; (&lt;A href="https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/2_Humidity_Sensors/Sensirion_Humidity_Sensors_SHT21_Datasheet_V4.pdf"&gt;datasheet&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the command available is to send a soft reset (easily explained via screen shot from the data sheet).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14360i986FD214ACA36C2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My I2C is configured as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;status_t status;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_master_config_t i2c_master_config;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;uint32_t i2c_source_clock_hz;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;I2C_MasterGetDefaultConfig(&amp;amp;i2c_master_config);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_master_config.baudRate_Bps = 10000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_master_config.enableMaster = false;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_source_clock_hz = CLOCK_GetFreq(kCLOCK_CoreSysClk);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;CLOCK_EnableClock(kCLOCK_I2c0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;status = I2C_RTOS_Init(&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;i2c_rtos_handle, I2C0, &amp;amp;i2c_master_config,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_source_clock_hz);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;/* Disable I2C module and gate its clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sending a soft reset in the following manner:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;static void soft_reset_sht(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_master_transfer_t i2c_soft_reset;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.slaveAddress = SENSIRION_I2C_ADDRESS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.direction = kI2C_Write;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddress = SHT_SOFT_RESET;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddressSize = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.data = NULL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.dataSize = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.flags = kI2C_TransferDefaultFlag;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_RTOS_Transfer(&amp;amp;i2c_rtos_handle, &amp;amp;i2c_soft_reset, CEIL_US_TO_TICKS(MS_TO_US(100)) );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; // Disable I2C hardware&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This doesn't' send a &lt;STRONG&gt;stop&lt;/STRONG&gt; command and leaves SCL low:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14362i12FD0DD91618BB17/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I add in some dummy data and send a send it (i.e.&amp;nbsp;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;i2c_soft_reset.dataSize&lt;/SPAN&gt; is not set to zero) the an I2C &lt;STRONG&gt;stop&lt;/STRONG&gt; is correctly sent.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;static void soft_reset_sht(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_master_transfer_t i2c_soft_reset;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; uint8_t local_u8_buffer[1];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.slaveAddress = SENSIRION_I2C_ADDRESS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.direction = kI2C_Write;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddress = SHT_SOFT_RESET;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddressSize = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.data = local_u8_buffer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.dataSize = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.flags = kI2C_TransferDefaultFlag;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_RTOS_Transfer(&amp;amp;i2c_rtos_handle, &amp;amp;i2c_soft_reset, CEIL_US_TO_TICKS(MS_TO_US(100)) );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This gives&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14363i803F920FBE81EB5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Oct 2017 10:58:33 GMT</pubDate>
    <dc:creator>beng_</dc:creator>
    <dc:date>2017-10-10T10:58:33Z</dc:date>
    <item>
      <title>I2C_RTOS_Transfer does not send Stop if dataSize is 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-RTOS-Transfer-does-not-send-Stop-if-dataSize-is-0/m-p/701896#M7516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've found that &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;EM&gt;I2C_RTOS_Transfer&lt;/EM&gt;&lt;/SPAN&gt; does not send a &lt;STRONG&gt;Stop&lt;/STRONG&gt; if dataSize is 0.&lt;/P&gt;&lt;P&gt;Am I doing something wrong or is there a bug is the API?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a &lt;A href="https://www.sensirion.com/en/environmental-sensors/humidity-sensors/humidity-temperature-sensor-sht2x-digital-i2c-accurate/"&gt;Sensirion SHT 21&lt;/A&gt; (&lt;A href="https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/2_Humidity_Sensors/Sensirion_Humidity_Sensors_SHT21_Datasheet_V4.pdf"&gt;datasheet&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the command available is to send a soft reset (easily explained via screen shot from the data sheet).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14360i986FD214ACA36C2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My I2C is configured as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;status_t status;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_master_config_t i2c_master_config;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;uint32_t i2c_source_clock_hz;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;I2C_MasterGetDefaultConfig(&amp;amp;i2c_master_config);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_master_config.baudRate_Bps = 10000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_master_config.enableMaster = false;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;i2c_source_clock_hz = CLOCK_GetFreq(kCLOCK_CoreSysClk);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;CLOCK_EnableClock(kCLOCK_I2c0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;status = I2C_RTOS_Init(&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;i2c_rtos_handle, I2C0, &amp;amp;i2c_master_config,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_source_clock_hz);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #3366ff;"&gt;/* Disable I2C module and gate its clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sending a soft reset in the following manner:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;static void soft_reset_sht(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_master_transfer_t i2c_soft_reset;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.slaveAddress = SENSIRION_I2C_ADDRESS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.direction = kI2C_Write;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddress = SHT_SOFT_RESET;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddressSize = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.data = NULL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.dataSize = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.flags = kI2C_TransferDefaultFlag;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_RTOS_Transfer(&amp;amp;i2c_rtos_handle, &amp;amp;i2c_soft_reset, CEIL_US_TO_TICKS(MS_TO_US(100)) );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; // Disable I2C hardware&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This doesn't' send a &lt;STRONG&gt;stop&lt;/STRONG&gt; command and leaves SCL low:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14362i12FD0DD91618BB17/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I add in some dummy data and send a send it (i.e.&amp;nbsp;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;i2c_soft_reset.dataSize&lt;/SPAN&gt; is not set to zero) the an I2C &lt;STRONG&gt;stop&lt;/STRONG&gt; is correctly sent.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;static void soft_reset_sht(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_master_transfer_t i2c_soft_reset;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; uint8_t local_u8_buffer[1];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.slaveAddress = SENSIRION_I2C_ADDRESS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.direction = kI2C_Write;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddress = SHT_SOFT_RESET;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddressSize = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.data = local_u8_buffer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.dataSize = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; i2c_soft_reset.flags = kI2C_TransferDefaultFlag;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_RTOS_Transfer(&amp;amp;i2c_rtos_handle, &amp;amp;i2c_soft_reset, CEIL_US_TO_TICKS(MS_TO_US(100)) );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; I2C_Enable(I2C0, false);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp; return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This gives&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14363i803F920FBE81EB5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 10:58:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-RTOS-Transfer-does-not-send-Stop-if-dataSize-is-0/m-p/701896#M7516</guid>
      <dc:creator>beng_</dc:creator>
      <dc:date>2017-10-10T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: I2C_RTOS_Transfer does not send Stop if dataSize is 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-RTOS-Transfer-does-not-send-Stop-if-dataSize-is-0/m-p/701897#M7517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;For the I2C driver to work properly (ie, send stop to complete transfer), at least 1 data byte need to be there, when using a &lt;EM&gt;subaddress.&amp;nbsp;&lt;/EM&gt;So, for transmitting only 1 data byte (as in your case), use&amp;nbsp;&lt;EM&gt;d&lt;/EM&gt;&lt;EM&gt;ata&amp;nbsp;&lt;/EM&gt;to send the byte and give no&amp;nbsp;&lt;EM&gt;subaddress.&amp;nbsp;&lt;/EM&gt;Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;i2c_soft_reset.slaveAddress = SENSIRION_I2C_ADDRESS;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; i2c_soft_reset.direction = kI2C_Write;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddress = 0;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; i2c_soft_reset.subaddressSize = 0;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; i2c_soft_reset.data = SHT_SOFT_RESET;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; i2c_soft_reset.dataSize = 1;&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; i2c_soft_reset.flags = kI2C_TransferDefaultFlag;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; background-color: #ffffff; border: 0px; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; border: 0px; font-family: arial, helvetica, sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; border: 0px; font-family: arial, helvetica, sans-serif;"&gt;Visakhan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 16:58:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-RTOS-Transfer-does-not-send-Stop-if-dataSize-is-0/m-p/701897#M7517</guid>
      <dc:creator>visakhanc</dc:creator>
      <dc:date>2017-10-12T16:58:16Z</dc:date>
    </item>
  </channel>
</rss>

