{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2648","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2648/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2648/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2648/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/2648","id":62996595,"number":2648,"title":"stm32 I2C START condition issue","user":{"login":"yerpj","id":11556895,"avatar_url":"https://avatars.githubusercontent.com/u/11556895?v=3","gravatar_id":"","url":"https://api.github.com/users/yerpj","html_url":"https://github.com/yerpj","followers_url":"https://api.github.com/users/yerpj/followers","following_url":"https://api.github.com/users/yerpj/following{/other_user}","gists_url":"https://api.github.com/users/yerpj/gists{/gist_id}","starred_url":"https://api.github.com/users/yerpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yerpj/subscriptions","organizations_url":"https://api.github.com/users/yerpj/orgs","repos_url":"https://api.github.com/users/yerpj/repos","events_url":"https://api.github.com/users/yerpj/events{/privacy}","received_events_url":"https://api.github.com/users/yerpj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/arm","name":"arm","color":"dddddd"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Device%20driver","name":"Device driver","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"PeterKietzmann","id":7765855,"avatar_url":"https://avatars.githubusercontent.com/u/7765855?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterKietzmann","html_url":"https://github.com/PeterKietzmann","followers_url":"https://api.github.com/users/PeterKietzmann/followers","following_url":"https://api.github.com/users/PeterKietzmann/following{/other_user}","gists_url":"https://api.github.com/users/PeterKietzmann/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterKietzmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterKietzmann/subscriptions","organizations_url":"https://api.github.com/users/PeterKietzmann/orgs","repos_url":"https://api.github.com/users/PeterKietzmann/repos","events_url":"https://api.github.com/users/PeterKietzmann/events{/privacy}","received_events_url":"https://api.github.com/users/PeterKietzmann/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-03-19T14:08:38Z","updated_at":"2015-03-20T06:57:23Z","closed_at":null,"body":"Hi all,\r\n\r\nI am currently porting RIOT on a stm32f2 (f217) and I am experiencing issues with the i2C.\r\nI tried on both stm32f4discovery and on our own board. Result is the same.\r\n_start() is executing (periph/i2c.c) but after writing the dev->DR register, an interrupt occurs. Debug mode tells \"I2C ERROR OCCURED\", \"status: 00000400\", \"AF\", which means \"AF: Acknowledge failure\". But, having checked with the oscilloscope, the address is not transmitted, only the START condition is sent, before being interrupted by the isr. \r\nHere is the _start() function:\r\n\r\nstatic void _start(I2C_TypeDef *dev, uint8_t address, uint8_t rw_flag)\r\n{\r\n    /* wait for device to be ready */\r\n    DEBUG(\"Wait for device to be ready\\n\");\r\n\r\n    while (dev->SR2 & I2C_SR2_BUSY);\r\n\r\n    /* generate start condition */\r\n    DEBUG(\"Generate start condition\\n\");\r\n    dev->CR1 |= I2C_CR1_START;\r\n    DEBUG(\"Wait for SB flag to be set\\n\");\r\n\r\n    while (!(dev->SR1 & I2C_SR1_SB));\r\n\r\n    /* send address and read/write flag */\r\n    DEBUG(\"Send address\\n\");\r\n    dev->DR = (address << 1) | rw_flag;\r\n    /* clear ADDR flag by reading first SR1 and then SR2 */\r\n    DEBUG(\"Wait for ADDR flag to be set\\n\");\r\n\r\n    while (!(dev->SR1 & I2C_SR1_ADDR));\r\n}\r\n\r\nDid someone already encountered this issue?\r\n\r\n![i2c_start_issue](https://cloud.githubusercontent.com/assets/11556895/6732065/9a11a60a-ce49-11e4-9b04-e1d38d03bb9e.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/83940508","html_url":"https://github.com/RIOT-OS/RIOT/issues/2648#issuecomment-83940508","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2648","id":83940508,"user":{"login":"PeterKietzmann","id":7765855,"avatar_url":"https://avatars.githubusercontent.com/u/7765855?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterKietzmann","html_url":"https://github.com/PeterKietzmann","followers_url":"https://api.github.com/users/PeterKietzmann/followers","following_url":"https://api.github.com/users/PeterKietzmann/following{/other_user}","gists_url":"https://api.github.com/users/PeterKietzmann/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterKietzmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterKietzmann/subscriptions","organizations_url":"https://api.github.com/users/PeterKietzmann/orgs","repos_url":"https://api.github.com/users/PeterKietzmann/repos","events_url":"https://api.github.com/users/PeterKietzmann/events{/privacy}","received_events_url":"https://api.github.com/users/PeterKietzmann/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T06:57:23Z","updated_at":"2015-03-20T06:57:23Z","body":"@yerpj nice to hear :-) ! Regarding the PR and git stuff these wiki pages may help you: [Contributing to RIOT](https://github.com/RIOT-OS/RIOT/wiki/Contributing-to-RIOT) and [Git cheatsheet](https://github.com/RIOT-OS/RIOT/wiki/Git-cheatsheet). Otherwise feel free to ask on the mailing list or at least in you PR when it's there."}}