{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4097","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4097/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4097/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4097/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/4097","id":111630598,"number":4097,"title":"at86rf2xx: potential unaligned access","user":{"login":"daniel-k","id":224128,"avatar_url":"https://avatars.githubusercontent.com/u/224128?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-k","html_url":"https://github.com/daniel-k","followers_url":"https://api.github.com/users/daniel-k/followers","following_url":"https://api.github.com/users/daniel-k/following{/other_user}","gists_url":"https://api.github.com/users/daniel-k/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-k/subscriptions","organizations_url":"https://api.github.com/users/daniel-k/orgs","repos_url":"https://api.github.com/users/daniel-k/repos","events_url":"https://api.github.com/users/daniel-k/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-k/received_events","type":"User","site_admin":false},"labels":[{"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"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/documentation","name":"documentation","color":"f7c6c7"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Request%20for%20Comments","name":"Request for Comments","color":"23F823"}],"state":"open","locked":false,"assignee":{"login":"thomaseichinger","id":56618,"avatar_url":"https://avatars.githubusercontent.com/u/56618?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaseichinger","html_url":"https://github.com/thomaseichinger","followers_url":"https://api.github.com/users/thomaseichinger/followers","following_url":"https://api.github.com/users/thomaseichinger/following{/other_user}","gists_url":"https://api.github.com/users/thomaseichinger/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaseichinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaseichinger/subscriptions","organizations_url":"https://api.github.com/users/thomaseichinger/orgs","repos_url":"https://api.github.com/users/thomaseichinger/repos","events_url":"https://api.github.com/users/thomaseichinger/events{/privacy}","received_events_url":"https://api.github.com/users/thomaseichinger/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-10-15T14:36:18Z","updated_at":"2015-10-15T20:23:46Z","closed_at":null,"body":"The NETDEV interface has lots of memory accesses like this:\r\n```\r\n*((uint16_t *)val) = at86rf2xx_get_txpower(dev);\r\n```\r\n\r\nI see that this is convenient, but can easily cause hardfaults because of unaligned access. Do we assume that the user only passes aligned memory if his platform doesn't support unaligned access? Either way this should be documented."},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/148510065","html_url":"https://github.com/RIOT-OS/RIOT/issues/4097#issuecomment-148510065","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4097","id":148510065,"user":{"login":"thomaseichinger","id":56618,"avatar_url":"https://avatars.githubusercontent.com/u/56618?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaseichinger","html_url":"https://github.com/thomaseichinger","followers_url":"https://api.github.com/users/thomaseichinger/followers","following_url":"https://api.github.com/users/thomaseichinger/following{/other_user}","gists_url":"https://api.github.com/users/thomaseichinger/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaseichinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaseichinger/subscriptions","organizations_url":"https://api.github.com/users/thomaseichinger/orgs","repos_url":"https://api.github.com/users/thomaseichinger/repos","events_url":"https://api.github.com/users/thomaseichinger/events{/privacy}","received_events_url":"https://api.github.com/users/thomaseichinger/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T20:23:46Z","updated_at":"2015-10-15T20:23:46Z","body":"Yep, these are exactly the two cases described above. I think we should mention this in the documentation that these functions don't check for alignment and the MAC protocol implementation is responsible to assure alignment of passed memory to access. Because there is no reasonable way to check for this in `get` and `set`. Do you agree?"}}