Iicmb will keep busy when slave do not give a ack.And I have to give a stop cmd to make iicmb module not busy.Is this a bug?
I think this is not a bug. When you receive 'No Ack' response you don't have to free the bus immediately (in contrast to 'Arbitration Lost' response). You might decide to continue working with the bus and, for example, try other slave addresses after repeated start. So, in this situation this is the upper layer's decision to free the bus or not.
In the software example file (software/iicmb.c) you can find the code which gives explicit 'Stop' command when the slave is not responding. It looks like:
<p class="cmd"> /* Start condition */ ret = iicmb_cmd_start(); if (ret != rsp_done) return ret; // Arb Lostdo { / Write slave address and write bit / ret = iicmb_cmd_write((sa << 1) | 0x00u); if (ret != rsp_done) break; // No Ack ... } while (0);
/ Stop condition / (void)iicmb_cmd_stop();
return ret;
</p>Sorry, bad formatting. Another attempt :)
<p class="cmd"> /* Start condition */<br /> ret = iicmb_cmd_start();<br /> if (ret != rsp_done) return ret; // Arb Lost<br /> <br /> do {<br /> /* Write slave address and write bit */<br /> ret = iicmb_cmd_write((sa << 1) | 0x00u);<br /> if (ret != rsp_done) break; // No Ack<br /> ...<br /> } while (0);<br /> <br /> /* Stop condition */<br /> (void)iicmb_cmd_stop();<br /> <br /> return ret;<br /> </p>And now formatting should be OK :)
<p class="cmd"> /* Start condition */<br /> ret = iicmb_cmd_start();<br /> if (ret != rsp_done) return ret; // Arb Lost<br /> <br /> do {<br /> /* Write slave address and write bit */<br /> ret = iicmb_cmd_write((sa << 1) | 0x00u);<br /> if (ret != rsp_done) break; // No Ack<br /> ...<br /> } while (0);<br /> <br /> /* Stop condition */<br /> (void)iicmb_cmd_stop();<br /> <br /> return ret;<br /> </p>Yes,you are right I thingk.Thx.:-)
Yes,you are right I thingk.Thx.:-)