{"action":"created","issue":{"url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/18","labels_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/18/comments","events_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/18/events","html_url":"https://github.com/SuperHouse/esp-open-rtos/issues/18","id":99054856,"number":18,"title":"sdk_uart_rx_one_char crashes","user":{"login":"kanflo","id":931076,"avatar_url":"https://avatars.githubusercontent.com/u/931076?v=3","gravatar_id":"","url":"https://api.github.com/users/kanflo","html_url":"https://github.com/kanflo","followers_url":"https://api.github.com/users/kanflo/followers","following_url":"https://api.github.com/users/kanflo/following{/other_user}","gists_url":"https://api.github.com/users/kanflo/gists{/gist_id}","starred_url":"https://api.github.com/users/kanflo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanflo/subscriptions","organizations_url":"https://api.github.com/users/kanflo/orgs","repos_url":"https://api.github.com/users/kanflo/repos","events_url":"https://api.github.com/users/kanflo/events{/privacy}","received_events_url":"https://api.github.com/users/kanflo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-04T20:27:20Z","updated_at":"2015-08-06T18:54:44Z","closed_at":null,"body":"Calling \r\n```\r\nint ch = sdk_uart_rx_one_char();\r\n```\r\nleads to a crash inside sdk_uart_rx_one_char (if I understand the reboot log correctly):\r\n```\r\ns8i     a6, a2, 0\r\n```\r\nSince this is an SDK provided function I guess something has not been set up correctly."},"comment":{"url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/comments/128473343","html_url":"https://github.com/SuperHouse/esp-open-rtos/issues/18#issuecomment-128473343","issue_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/18","id":128473343,"user":{"login":"kanflo","id":931076,"avatar_url":"https://avatars.githubusercontent.com/u/931076?v=3","gravatar_id":"","url":"https://api.github.com/users/kanflo","html_url":"https://github.com/kanflo","followers_url":"https://api.github.com/users/kanflo/followers","following_url":"https://api.github.com/users/kanflo/following{/other_user}","gists_url":"https://api.github.com/users/kanflo/gists{/gist_id}","starred_url":"https://api.github.com/users/kanflo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanflo/subscriptions","organizations_url":"https://api.github.com/users/kanflo/orgs","repos_url":"https://api.github.com/users/kanflo/repos","events_url":"https://api.github.com/users/kanflo/events{/privacy}","received_events_url":"https://api.github.com/users/kanflo/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T18:54:43Z","updated_at":"2015-08-06T18:54:43Z","body":"> uart_rx_one_char actually returns 0 on success, and 1 if there was nothing in the FIFO to retrieve.\r\n\r\nThanks for the clarification @foogod! I am however getting very strange behavior with this code:\r\n```\r\n    while(1) {\r\n        char ch;\r\n        while (sdk_uart_rx_one_char(&ch)) ;\r\n        printf(\"'%c'\\n\", ch);\r\n    }\r\n```\r\nThe MIPS burned in the while loop apart, there seems to be some kind of buffering going on as I eventually receive the characters I type, although the function doesn't return 1 for every character typed.\r\n\r\nI will yield on this one and lay my time on the IRQ driven UART driver :)"}}