{"action":"created","issue":{"url":"https://api.github.com/repos/contiki-os/contiki/issues/1550","repository_url":"https://api.github.com/repos/contiki-os/contiki","labels_url":"https://api.github.com/repos/contiki-os/contiki/issues/1550/labels{/name}","comments_url":"https://api.github.com/repos/contiki-os/contiki/issues/1550/comments","events_url":"https://api.github.com/repos/contiki-os/contiki/issues/1550/events","html_url":"https://github.com/contiki-os/contiki/pull/1550","id":140156642,"number":1550,"title":"Port of TSCH for CC2538","user":{"login":"thomas-ha","id":12033742,"avatar_url":"https://avatars.githubusercontent.com/u/12033742?v=3","gravatar_id":"","url":"https://api.github.com/users/thomas-ha","html_url":"https://github.com/thomas-ha","followers_url":"https://api.github.com/users/thomas-ha/followers","following_url":"https://api.github.com/users/thomas-ha/following{/other_user}","gists_url":"https://api.github.com/users/thomas-ha/gists{/gist_id}","starred_url":"https://api.github.com/users/thomas-ha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomas-ha/subscriptions","organizations_url":"https://api.github.com/users/thomas-ha/orgs","repos_url":"https://api.github.com/users/thomas-ha/repos","events_url":"https://api.github.com/users/thomas-ha/events{/privacy}","received_events_url":"https://api.github.com/users/thomas-ha/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/contiki-os/contiki/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/contiki-os/contiki/labels/Platform%20/%20CPU%20/%20ARM","name":"Platform / CPU / ARM","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":35,"created_at":"2016-03-11T11:08:15Z","updated_at":"2016-04-18T09:08:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/contiki-os/contiki/pulls/1550","html_url":"https://github.com/contiki-os/contiki/pull/1550","diff_url":"https://github.com/contiki-os/contiki/pull/1550.diff","patch_url":"https://github.com/contiki-os/contiki/pull/1550.patch"},"body":"This pull request is a port of TSCH for the CC2538 cpu.\r\nThe cc2538-rf.c driver was extended with the poll mode. Incoming packets are timestamped with RTIMER_NOW() when a sfd interrupt is raised. In the off() function the FIFO is flushed only when there is no complete packet in it otherwise the FIFO is flushed before TSCH reads out the packet. The FIFO is flushed at the end of the read() function.\r\n\r\nThe delay constants RADIO_DELAY_BEFORE_[TX|RX] still need to be measured.\r\n\r\nWe tested it with 6TiSCH Minimal Schedule and Orchestra with two and up to nine nodes.\r\n\r\nEdit: Now the MAC timer is used instead of the SFD interrupt."},"comment":{"url":"https://api.github.com/repos/contiki-os/contiki/issues/comments/211286967","html_url":"https://github.com/contiki-os/contiki/pull/1550#issuecomment-211286967","issue_url":"https://api.github.com/repos/contiki-os/contiki/issues/1550","id":211286967,"user":{"login":"thomas-ha","id":12033742,"avatar_url":"https://avatars.githubusercontent.com/u/12033742?v=3","gravatar_id":"","url":"https://api.github.com/users/thomas-ha","html_url":"https://github.com/thomas-ha","followers_url":"https://api.github.com/users/thomas-ha/followers","following_url":"https://api.github.com/users/thomas-ha/following{/other_user}","gists_url":"https://api.github.com/users/thomas-ha/gists{/gist_id}","starred_url":"https://api.github.com/users/thomas-ha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomas-ha/subscriptions","organizations_url":"https://api.github.com/users/thomas-ha/orgs","repos_url":"https://api.github.com/users/thomas-ha/repos","events_url":"https://api.github.com/users/thomas-ha/events{/privacy}","received_events_url":"https://api.github.com/users/thomas-ha/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T09:08:20Z","updated_at":"2016-04-18T09:08:20Z","body":"> If the radio is off, the LPM module will drop to some low power mode. This will normally gate the clock to the UART and for that reason the callback won't get called (basically bytes won't get received, the UART RX interrupt won't get raised). I am not familiar with how TSCH behaves on BRs, but the logic with ContikiMAC is to keep the radio always on. As a side-effect of that, the chip will never drop to deep sleep and the UART stays active and clocked at all times.\r\n\r\nOk, thank you very much @g-oikonomou , I didn't know that. I checked the CC2538 manual and have seen the registers for gating the UART clock. Disabling LPM completely also helps of course.\r\n\r\nThen there is still the problem that @simonduq mentioned. Sometimes there are missing bytes in the packet received over the slip interface of the packet isn't received at all. I guess because the UART interrupt is raised too late because of TSCH busy waiting from an rtimer interrupt."}}