{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7335","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7335/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7335/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7335/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/7335","id":241474924,"number":7335,"title":"cpu, cc26x0: fixing periph timer","user":{"login":"smlng","id":10532675,"avatar_url":"https://avatars1.githubusercontent.com/u/10532675?v=4","gravatar_id":"","url":"https://api.github.com/users/smlng","html_url":"https://github.com/smlng","followers_url":"https://api.github.com/users/smlng/followers","following_url":"https://api.github.com/users/smlng/following{/other_user}","gists_url":"https://api.github.com/users/smlng/gists{/gist_id}","starred_url":"https://api.github.com/users/smlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smlng/subscriptions","organizations_url":"https://api.github.com/users/smlng/orgs","repos_url":"https://api.github.com/users/smlng/repos","events_url":"https://api.github.com/users/smlng/events{/privacy}","received_events_url":"https://api.github.com/users/smlng/received_events","type":"User","site_admin":false},"labels":[{"id":135467271,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Device%20driver","name":"Device driver","color":"aaffff","default":false},{"id":23399100,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/enhancement","name":"enhancement","color":"f17070","default":true},{"id":104178887,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/major","name":"major","color":"ff0000","default":false},{"id":214816571,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Ready%20for%20CI%20build","name":"Ready for CI build","color":"bfdadc","default":false}],"state":"closed","locked":false,"assignee":{"login":"smlng","id":10532675,"avatar_url":"https://avatars1.githubusercontent.com/u/10532675?v=4","gravatar_id":"","url":"https://api.github.com/users/smlng","html_url":"https://github.com/smlng","followers_url":"https://api.github.com/users/smlng/followers","following_url":"https://api.github.com/users/smlng/following{/other_user}","gists_url":"https://api.github.com/users/smlng/gists{/gist_id}","starred_url":"https://api.github.com/users/smlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smlng/subscriptions","organizations_url":"https://api.github.com/users/smlng/orgs","repos_url":"https://api.github.com/users/smlng/repos","events_url":"https://api.github.com/users/smlng/events{/privacy}","received_events_url":"https://api.github.com/users/smlng/received_events","type":"User","site_admin":false},"assignees":[{"login":"smlng","id":10532675,"avatar_url":"https://avatars1.githubusercontent.com/u/10532675?v=4","gravatar_id":"","url":"https://api.github.com/users/smlng","html_url":"https://github.com/smlng","followers_url":"https://api.github.com/users/smlng/followers","following_url":"https://api.github.com/users/smlng/following{/other_user}","gists_url":"https://api.github.com/users/smlng/gists{/gist_id}","starred_url":"https://api.github.com/users/smlng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smlng/subscriptions","organizations_url":"https://api.github.com/users/smlng/orgs","repos_url":"https://api.github.com/users/smlng/repos","events_url":"https://api.github.com/users/smlng/events{/privacy}","received_events_url":"https://api.github.com/users/smlng/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/20","html_url":"https://github.com/RIOT-OS/RIOT/milestone/20","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/20/labels","id":2596648,"number":20,"title":"Release 2017.10","description":"","creator":{"login":"aabadie","id":1375137,"avatar_url":"https://avatars3.githubusercontent.com/u/1375137?v=4","gravatar_id":"","url":"https://api.github.com/users/aabadie","html_url":"https://github.com/aabadie","followers_url":"https://api.github.com/users/aabadie/followers","following_url":"https://api.github.com/users/aabadie/following{/other_user}","gists_url":"https://api.github.com/users/aabadie/gists{/gist_id}","starred_url":"https://api.github.com/users/aabadie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aabadie/subscriptions","organizations_url":"https://api.github.com/users/aabadie/orgs","repos_url":"https://api.github.com/users/aabadie/repos","events_url":"https://api.github.com/users/aabadie/events{/privacy}","received_events_url":"https://api.github.com/users/aabadie/received_events","type":"User","site_admin":false},"open_issues":263,"closed_issues":72,"state":"open","created_at":"2017-06-21T16:50:03Z","updated_at":"2017-08-18T12:08:09Z","due_on":"2017-10-31T07:00:00Z","closed_at":null},"comments":20,"created_at":"2017-07-08T19:32:09Z","updated_at":"2017-08-21T07:45:48Z","closed_at":"2017-08-17T11:26:38Z","pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7335","html_url":"https://github.com/RIOT-OS/RIOT/pull/7335","diff_url":"https://github.com/RIOT-OS/RIOT/pull/7335.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/7335.patch"},"body":"This PR does:\r\n- complete rework of periph/timer.c, based on TI CC2538\r\n- adapt timer config of board cc2650stk (aka TI SensorTag)\r\n\r\nWith current master `tests/periph_timer` does not work correctly, see output:\r\n\r\n```\r\n2017-07-08 21:24:47,864 - INFO # Test for peripheral TIMERs\r\n2017-07-08 21:24:47,864 - INFO # \r\n2017-07-08 21:24:47,869 - INFO # This test will test all configured peripheral timers of the\r\n2017-07-08 21:24:47,875 - INFO # targeted platform. For each timer, it will set each channel with\r\n2017-07-08 21:24:47,881 - INFO # an incrementing timeout. CH0 set to 5ms, CH1 to 10ms, CH2 to 15ms\r\n2017-07-08 21:24:47,881 - INFO # and so on.\r\n2017-07-08 21:24:47,887 - INFO # In the output you should see that every channel fired, after an\r\n2017-07-08 21:24:47,892 - INFO # evenly distributed amount of time -> the shown diff values should\r\n2017-07-08 21:24:47,896 - INFO # be pretty much equal (to some jitter...)\r\n2017-07-08 21:24:47,901 - INFO # This test does however NOT show, if the timeouts were correct in\r\n2017-07-08 21:24:47,907 - INFO # relation to the expected real-time ~ use e.g. tests/xtimer_msg for\r\n2017-07-08 21:24:47,908 - INFO # this.\r\n2017-07-08 21:24:47,908 - INFO # \r\n2017-07-08 21:24:47,908 - INFO # \r\n2017-07-08 21:24:47,910 - INFO # Available timers: 2\r\n2017-07-08 21:24:47,910 - INFO # \r\n2017-07-08 21:24:47,912 - INFO # Testing TIMER_0:\r\n2017-07-08 21:24:47,914 - INFO # TIMER_0: initialization successful\r\n2017-07-08 21:24:47,916 - INFO # TIMER_0: stopped\r\n2017-07-08 21:24:47,918 - INFO # TIMER_0: set channel 0 to 5000\r\n2017-07-08 21:24:47,920 - INFO # TIMER_0: starting\r\n2017-07-08 21:24:47,925 - INFO # TIMER_0: channel 0 fired at SW count        0 - init:        0\r\n2017-07-08 21:24:47,926 - INFO # \r\n2017-07-08 21:24:47,927 - INFO # Testing TIMER_1:\r\n2017-07-08 21:24:47,930 - INFO # TIMER_1: initialization successful\r\n2017-07-08 21:24:47,932 - INFO # TIMER_1: stopped\r\n2017-07-08 21:24:47,934 - INFO # TIMER_1: set channel 0 to 5000\r\n2017-07-08 21:24:47,936 - INFO # TIMER_1: starting\r\n2017-07-08 21:24:47,941 - INFO # TIMER_1: channel 0 fired at SW count        0 - init:        0\r\n2017-07-08 21:24:47,941 - INFO # \r\n```\r\n\r\nThough the tests compiles and runs on the board, please note that both timers fire at sw count 0.\r\n\r\nWith the fix of this PR the output looks like this: [edit] update output\r\n```\r\n2017-07-08 21:34:41,736 - INFO # Test for peripheral TIMERs\r\n2017-07-08 21:34:41,736 - INFO # \r\n2017-07-08 21:34:41,741 - INFO # This test will test all configured peripheral timers of the\r\n2017-07-08 21:34:41,746 - INFO # targeted platform. For each timer, it will set each channel with\r\n2017-07-08 21:34:41,752 - INFO # an incrementing timeout. CH0 set to 5ms, CH1 to 10ms, CH2 to 15ms\r\n2017-07-08 21:34:41,753 - INFO # and so on.\r\n2017-07-08 21:34:41,759 - INFO # In the output you should see that every channel fired, after an\r\n2017-07-08 21:34:41,764 - INFO # evenly distributed amount of time -> the shown diff values should\r\n2017-07-08 21:34:41,768 - INFO # be pretty much equal (to some jitter...)\r\n2017-07-08 21:34:41,773 - INFO # This test does however NOT show, if the timeouts were correct in\r\n2017-07-08 21:34:41,779 - INFO # relation to the expected real-time ~ use e.g. tests/xtimer_msg for\r\n2017-07-08 21:34:41,780 - INFO # this.\r\n2017-07-08 21:34:41,780 - INFO # \r\n2017-07-08 21:34:41,780 - INFO # \r\n2017-07-08 21:34:41,781 - INFO # Available timers: 4\r\n2017-07-08 21:34:41,782 - INFO # \r\n2017-07-08 21:34:41,783 - INFO # Testing TIMER_0:\r\n2017-07-08 21:34:41,786 - INFO # TIMER_0: initialization successful\r\n2017-07-08 21:34:41,787 - INFO # TIMER_0: stopped\r\n2017-07-08 21:34:41,790 - INFO # TIMER_0: set channel 0 to 5000\r\n2017-07-08 21:34:41,793 - INFO # TIMER_0: set channel 1 to 10000\r\n2017-07-08 21:34:41,795 - INFO # TIMER_0: starting\r\n2017-07-08 21:34:41,810 - INFO # TIMER_0: channel 0 fired at SW count    18463 - init:    18463\r\n2017-07-08 21:34:41,815 - INFO # TIMER_0: channel 1 fired at SW count    36918 - diff:    18455\r\n2017-07-08 21:34:41,815 - INFO # \r\n2017-07-08 21:34:41,816 - INFO # Testing TIMER_1:\r\n2017-07-08 21:34:41,820 - INFO # TIMER_1: ERROR on initialization - skipping\r\n2017-07-08 21:34:41,821 - INFO # \r\n2017-07-08 21:34:41,821 - INFO # \r\n2017-07-08 21:34:41,822 - INFO # Testing TIMER_2:\r\n2017-07-08 21:34:41,825 - INFO # TIMER_2: initialization successful\r\n2017-07-08 21:34:41,827 - INFO # TIMER_2: stopped\r\n2017-07-08 21:34:41,829 - INFO # TIMER_2: set channel 0 to 5000\r\n2017-07-08 21:34:41,833 - INFO # TIMER_2: set channel 1 to 10000\r\n2017-07-08 21:34:41,834 - INFO # TIMER_2: starting\r\n2017-07-08 21:34:41,849 - INFO # TIMER_2: channel 0 fired at SW count    18465 - init:    18465\r\n2017-07-08 21:34:41,854 - INFO # TIMER_2: channel 1 fired at SW count    36920 - diff:    18455\r\n2017-07-08 21:34:41,854 - INFO # \r\n2017-07-08 21:34:41,856 - INFO # Testing TIMER_3:\r\n2017-07-08 21:34:41,860 - INFO # TIMER_3: ERROR on initialization - skipping\r\n2017-07-08 21:34:41,860 - INFO # \r\n2017-07-08 21:34:41,860 - INFO # \r\n```\r\n\r\nPlease note, I changed the board config of cc2650stk to enable all 4 available timers, timer 0 and 2 are in 16Bit mode with 2 channels and timers 1 and 3 are in 32Bit mode with 1 channel. Further note, in 32Bit there is no prescaler and the timer has to run with cpu clock frequency (48MHz) which is why init with 1MHz fails here. "},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/323670867","html_url":"https://github.com/RIOT-OS/RIOT/pull/7335#issuecomment-323670867","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7335","id":323670867,"user":{"login":"haukepetersen","id":620834,"avatar_url":"https://avatars3.githubusercontent.com/u/620834?v=4","gravatar_id":"","url":"https://api.github.com/users/haukepetersen","html_url":"https://github.com/haukepetersen","followers_url":"https://api.github.com/users/haukepetersen/followers","following_url":"https://api.github.com/users/haukepetersen/following{/other_user}","gists_url":"https://api.github.com/users/haukepetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/haukepetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haukepetersen/subscriptions","organizations_url":"https://api.github.com/users/haukepetersen/orgs","repos_url":"https://api.github.com/users/haukepetersen/repos","events_url":"https://api.github.com/users/haukepetersen/events{/privacy}","received_events_url":"https://api.github.com/users/haukepetersen/received_events","type":"User","site_admin":false},"created_at":"2017-08-21T07:45:48Z","updated_at":"2017-08-21T07:45:48Z","body":"Oh wait, never mind, just saw that this doc is already there in the `periph_cpu.h`... But I think it would make sense to move it to the board's periph_conf headers, as this is the place where people actually alter the configuration."}}
{"actor":{"display_login":"haukepetersen"}}