{"action":"created","issue":{"url":"https://api.github.com/repos/roboterclubaachen/xpcc/issues/351","repository_url":"https://api.github.com/repos/roboterclubaachen/xpcc","labels_url":"https://api.github.com/repos/roboterclubaachen/xpcc/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/roboterclubaachen/xpcc/issues/351/comments","events_url":"https://api.github.com/repos/roboterclubaachen/xpcc/issues/351/events","html_url":"https://github.com/roboterclubaachen/xpcc/pull/351","id":314173094,"number":351,"title":"Fixed shared UARTirq for stm32f030cc","user":{"login":"lmoesch","id":16242519,"avatar_url":"https://avatars3.githubusercontent.com/u/16242519?v=4","gravatar_id":"","url":"https://api.github.com/users/lmoesch","html_url":"https://github.com/lmoesch","followers_url":"https://api.github.com/users/lmoesch/followers","following_url":"https://api.github.com/users/lmoesch/following{/other_user}","gists_url":"https://api.github.com/users/lmoesch/gists{/gist_id}","starred_url":"https://api.github.com/users/lmoesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmoesch/subscriptions","organizations_url":"https://api.github.com/users/lmoesch/orgs","repos_url":"https://api.github.com/users/lmoesch/repos","events_url":"https://api.github.com/users/lmoesch/events{/privacy}","received_events_url":"https://api.github.com/users/lmoesch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-13T16:30:47Z","updated_at":"2018-04-14T22:26:55Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/roboterclubaachen/xpcc/pulls/351","html_url":"https://github.com/roboterclubaachen/xpcc/pull/351","diff_url":"https://github.com/roboterclubaachen/xpcc/pull/351.diff","patch_url":"https://github.com/roboterclubaachen/xpcc/pull/351.patch"},"body":"Okay, this is my attempt to somehow fix the issue with shared IRQs on stm32 devices mentioned in #88 and #348 . The fix has two stages.\r\n\r\nFirst new paramters are added to the `driver.xml`. A parameter called `shared_irq` containing the name of the shared UART (As far as I have seen it, this is either USART3_6 or USART3_8) and a parameter called `shared_irq_ids` containing a whitespace seperated list of the UART ids that are shared.\r\n\r\nThan these new parameters are used to generate the appropriate code in the `uart.cpp`, `uart.hpp` and `uart_hal_impl.hpp`.\r\n\r\nIf an UART is shared, than in the `uart.cpp` there is a class member function `::irq()` defined instead of the interrupt ISR. This function is than called by the shared irq to ensure proper functionality. So where is the shared irq defined?\r\n\r\nMy first attempt was to generate a seperate file cpp/hpp pair which contains the shared irq routine. Unfortunately irqs - although **_KNOWN_** by the arm compiler - are treated as weak functions and are therefore not linked by the linker, and the common workaround is to add in another function into you .cpp and call it somewhere....great!\r\n\r\nLong story short - I put it in the uart3.cpp.\r\n\r\nFor now it only fixes the issue on the stm32f030cc but more stm32 devices can be supported by adding more variants to the `driver.xml`  - of course it would be far more sophisticated to get these parameters from the devicefile directly."},"comment":{"url":"https://api.github.com/repos/roboterclubaachen/xpcc/issues/comments/381365020","html_url":"https://github.com/roboterclubaachen/xpcc/pull/351#issuecomment-381365020","issue_url":"https://api.github.com/repos/roboterclubaachen/xpcc/issues/351","id":381365020,"user":{"login":"rleh","id":2820734,"avatar_url":"https://avatars0.githubusercontent.com/u/2820734?v=4","gravatar_id":"","url":"https://api.github.com/users/rleh","html_url":"https://github.com/rleh","followers_url":"https://api.github.com/users/rleh/followers","following_url":"https://api.github.com/users/rleh/following{/other_user}","gists_url":"https://api.github.com/users/rleh/gists{/gist_id}","starred_url":"https://api.github.com/users/rleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rleh/subscriptions","organizations_url":"https://api.github.com/users/rleh/orgs","repos_url":"https://api.github.com/users/rleh/repos","events_url":"https://api.github.com/users/rleh/events{/privacy}","received_events_url":"https://api.github.com/users/rleh/received_events","type":"User","site_admin":false},"created_at":"2018-04-14T22:26:55Z","updated_at":"2018-04-14T22:26:55Z","author_association":"MEMBER","body":"> I put it in the uart3.cpp.\r\n\r\nPlease put it in `uart4.cpp` instead, because STM32L0 devices only include [UART{1,2,4}](https://github.com/roboterclubaachen/xpcc/blob/develop/src/xpcc/architecture/platform/devices/stm32/stm32l071_072_073_081_082_083-c_k_r_v-8_b_z.xml#L113).\r\nAll shared uart interrupts include Uart4."}}
{"actor":{"display_login":"rleh"}}