MXCHIP-EMW / WICED-for-EMW

Broadcom WICED patches for MXCHIP EMW wireless ARM platform. Not affiliated with MXCHIP or Broadcom
Other
55 stars 25 forks source link

Add SPI4 and SPI5 support for STM32F4/EMW3165 platform #13

Closed paulreimer closed 8 years ago

paulreimer commented 8 years ago

These additions patch the existing STM32F4 stdperiph libraries to add support for new SPI devices present on STM32F411 series MCUs as used on the EMW3165 module. A new EMW3165/platform.c file is also included to add support for using these with the wiced / platform APIs.

Non-working unfortunately, although I have double checked the memory addresses and IRQs from the STM32F411xE datasheet. Requesting review.

paulreimer commented 8 years ago

Solved (I believe). SPI4 and SPI5 require AF6 (not AF5). I tested using SPI5 (SPI4 is untested for now): without DMA (using platform_spi_transfer) and with DMA (using direct STM32F4 stdperiph code). Both are working, although SPI_NO_DMA has quite erratic clock timings.

paulreimer commented 8 years ago

Now tested with SPI4 TX (with and without DMA). I noticed that neither SPI4 nor SPI5 are working with RX DMA.

emilf commented 8 years ago

Do you want me to merge this as-is or do you want to work on it some more? If you want me to merge this as it is, then it's perhaps prudent to have it as an optional patch, since it's not perfectly functional and it would be good if you could provide some test apps, to make it easier to test for the muggles :p , me included... Then I mean more like acceptance testing, rather than unit testing... Also, I added you to the organization, so you can also merge this yourself, but I'd appreciate if you'd not do that until we've talked this out.

emilf commented 8 years ago

Hmm... I guess I should merge this to give people the option to use this. I'll also check out the RX DMA

paulreimer commented 8 years ago

Just FYI, I was unable to keep testing this due to some weirdness when I updated my OS X laptop to El Capitan. I hope to resume testing to get it 100% functional in the future.

emilf commented 8 years ago

Thanks :+1: I'll just add a notice to the platform.c file, so anyone planning to use this will be aware of the missing RX DMA functionality. After looking through this, I can't see how this could make anything work worse than it already does :)