{"action":"opened","issue":{"url":"https://api.github.com/repos/rogerclarkmelbourne/Arduino_STM32/issues/473","repository_url":"https://api.github.com/repos/rogerclarkmelbourne/Arduino_STM32","labels_url":"https://api.github.com/repos/rogerclarkmelbourne/Arduino_STM32/issues/473/labels{/name}","comments_url":"https://api.github.com/repos/rogerclarkmelbourne/Arduino_STM32/issues/473/comments","events_url":"https://api.github.com/repos/rogerclarkmelbourne/Arduino_STM32/issues/473/events","html_url":"https://github.com/rogerclarkmelbourne/Arduino_STM32/issues/473","id":309295229,"number":473,"title":"SPI DMA transfer issue","user":{"login":"me21","id":807120,"avatar_url":"https://avatars1.githubusercontent.com/u/807120?v=4","gravatar_id":"","url":"https://api.github.com/users/me21","html_url":"https://github.com/me21","followers_url":"https://api.github.com/users/me21/followers","following_url":"https://api.github.com/users/me21/following{/other_user}","gists_url":"https://api.github.com/users/me21/gists{/gist_id}","starred_url":"https://api.github.com/users/me21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/me21/subscriptions","organizations_url":"https://api.github.com/users/me21/orgs","repos_url":"https://api.github.com/users/me21/repos","events_url":"https://api.github.com/users/me21/events{/privacy}","received_events_url":"https://api.github.com/users/me21/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-28T09:49:34Z","updated_at":"2018-03-28T09:49:34Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI keep trying to make SPI work in DMA mode in my program, in slave mode.\r\nHere's how I initialize it:\r\n```\r\n    spi.beginSlave(); // MSB FIRST, SPI MODE 0\r\n    SPI1->regs->CR1 &= ~SPI_CR1_RXONLY;\r\n    spi.onReceive(onTxRxComplete);\r\n    spi.onTransmit(onSendDuringFlashComplete);\r\n    spi.dmaTransfer(rxData, rxData, sizeof(FlashHeader));\r\n```\r\n\r\nBut `onTxRxComplete` never gets called.\r\n\r\nI've tracked down the problem to `SPIClass::EventCallback()` by turning LED on or off.\r\nThe `_currentSetting->state` is `SPI_STATE_IDLE` inside `SPIClass::EventCallback()`, that's why my receive callback is not called. But I cannot find anywhere how can it be set to that value. It is set to that value only in constructor or in `SPIClass::end()` function, but it is not called in my program.\r\n\r\nDoes anyone have a working example of SPI with DMA? Preferably in slave mode."}}
{"actor":{"display_login":"me21"}}