{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8257","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8257/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8257/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8257/events","html_url":"https://github.com/ARMmbed/mbed-os/pull/8257","id":364004592,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4Mjk4MTA1","number":8257,"title":"tests-mbed_hal-sleep: finish UART transmission before sleep test","user":{"login":"mprse","id":30721012,"node_id":"MDQ6VXNlcjMwNzIxMDEy","avatar_url":"https://avatars0.githubusercontent.com/u/30721012?v=4","gravatar_id":"","url":"https://api.github.com/users/mprse","html_url":"https://github.com/mprse","followers_url":"https://api.github.com/users/mprse/followers","following_url":"https://api.github.com/users/mprse/following{/other_user}","gists_url":"https://api.github.com/users/mprse/gists{/gist_id}","starred_url":"https://api.github.com/users/mprse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprse/subscriptions","organizations_url":"https://api.github.com/users/mprse/orgs","repos_url":"https://api.github.com/users/mprse/repos","events_url":"https://api.github.com/users/mprse/events{/privacy}","received_events_url":"https://api.github.com/users/mprse/received_events","type":"User","site_admin":false},"labels":[{"id":147112891,"node_id":"MDU6TGFiZWwxNDcxMTI4OTE=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20review","name":"needs: review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-26T12:31:10Z","updated_at":"2018-09-30T17:36:43Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/8257","html_url":"https://github.com/ARMmbed/mbed-os/pull/8257","diff_url":"https://github.com/ARMmbed/mbed-os/pull/8257.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/8257.patch"},"body":"### Description\r\n\r\nThere is no problem with this test during the morph, but some issue has been noticed while testing new Jenkins CI in Oulu on NRF52_DK.\r\nI was able to reproduce the issue locally. The difference between morph and local run is that CPU statistics are enabled on morph. This makes the difference and test passes.\r\n\r\nThe sleep test case perform sleep for 100 us, 200 us, ... ,1000 us in loop (us ticker wakes the board) and verifies if sleep time matches the assumption.\r\nI got the following results in case of failure:\r\n```\r\nsleep                 wake-up after\r\n100 us                   ~100 us    ok\r\n200 us                   ~200 us    ok\r\n300 us                   ~300 us    ok\r\n400 us                   ~400 us    ok\r\n500 us                   ~14 us     (??)\r\n```\r\nWhen requested sleep time is equal to `500 us` some unexpected interrupt occurs which wake-up the board and force the test to fail.\r\nRegister state just after exit from sleep:\r\n`Control and State Register: 0x00400000 (ISRPENDING - Interrupt pending flag is set).`\r\n`NVIC Interrupt Set-pending Register[0]: 0x00000004 (UARTE0_UART0_IRQn) or 0x00000200 (TIMER1_IRQn - timer used by us ticker).`\r\n\r\nUART interrupt is generated because of green-tea transmission. We know that it is performed while test is executed since we need to wait before going into deep-sleep because otherwise the transmission will be broken. So to take care of UART interrupt we need to wait before sleep test in the same way like it is done in deep-sleep test.\r\n\r\n### Pull request type\r\n\r\n    [X] Fix\r\n    [ ] Refactor\r\n    [ ] Target update\r\n    [ ] Functionality change\r\n    [ ] Breaking change\r\n\r\n@jamesbeyond Can you confirm that this patch fixes problem with this test on the new Jenkins CI?"},"comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments/425737510","html_url":"https://github.com/ARMmbed/mbed-os/pull/8257#issuecomment-425737510","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8257","id":425737510,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTczNzUxMA==","user":{"login":"mprse","id":30721012,"node_id":"MDQ6VXNlcjMwNzIxMDEy","avatar_url":"https://avatars0.githubusercontent.com/u/30721012?v=4","gravatar_id":"","url":"https://api.github.com/users/mprse","html_url":"https://github.com/mprse","followers_url":"https://api.github.com/users/mprse/followers","following_url":"https://api.github.com/users/mprse/following{/other_user}","gists_url":"https://api.github.com/users/mprse/gists{/gist_id}","starred_url":"https://api.github.com/users/mprse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprse/subscriptions","organizations_url":"https://api.github.com/users/mprse/orgs","repos_url":"https://api.github.com/users/mprse/repos","events_url":"https://api.github.com/users/mprse/events{/privacy}","received_events_url":"https://api.github.com/users/mprse/received_events","type":"User","site_admin":false},"created_at":"2018-09-30T17:36:43Z","updated_at":"2018-09-30T17:36:43Z","author_association":"MEMBER","body":"@jamesbeyond Fixed as suggested."}}
{"actor":{"display_login":"mprse"}}