STM32, Maple and Maple mini port to IDE 1.5.x

@matthias

I started to look at putting DMA support in the SPI library last night.

However I came across a few issues with ISR callback not being possible to class methods in C++
So I had to code it with multiple static methods for the "DMA complete" callback and use switch statements in come places

However the code now compiles, and I will test it with the normal ILI9341 lib when it does the fill screen, as this should be a simple way to confirm it works

I'm adding SPIClass::DMATransfer(byte *buffer,int length) to the class, which takes pointer to the buffer to write and read into and size of buffer.
I will also do a version with a callback, or I may be able to just have one function which uses a default argument for the callback set to null. If no callback is specified, the code will be synchronous and Block / wait for completion in the function. But if a callback is specified, the transfer will be non-blocking and return immediately and also call the callback when the transfer is complete

I will not toggle the Chip Select pin in the function, as none of the other SPI functions do this. The main / calling code can handle CS :wink:

Ps. I'm not sure if I need a separate write and read buffer. It depends on how the DMA works. I need to double check if its necessary. It would be better if there was just one buffer I think, or perhaps I could get the function to accept 2 buffers, but they could be the same pointer.
Umm. Needs more thought and investigation :wink:

flax1k:
I have a STM32F103 based industrial working board and I want to reprogram it.

This is my board:
https://drive.google.com/open?id=0Byibq3E3WcsNSXN4SkdZRzVWbnc&authuser=0

It has:
P1 it's for a mini keyboard.
P2 - JTAG (20pins)
P3 - Prog/DBG_drive (6pins)
P4 - I2C1 socket (4 pins: GND, SDA, SCL, 3V3)
k8 - UARTS_CONN (3 PINS: RXD, TXD, GND)
P11 - Prog/DBG_HDD (6 pins)
and a final RFID_CONN (10 pins)

I understood from Home · rogerclarkmelbourne/Arduino_STM32 Wiki · GitHub link that Roger Clark managed to program some STM32F103 boards with the Arduino 1.6.x API.

Can I use the same API to reprogram my board?
Do I need some specific hardware to connect my board to my laptop? Can I connect the USART1 directly to my laptop?
Any suggestion or advice from you could help.

The resolution of the image on the google drive is not good, so its hard to read the silkscreen text.

However one USART connector appears to be labelled USART1 and next to it appears to be a switch to set the hardware boot lines.

So it may be possible to upload via serial, which is part of the repo.

However you will need to determine if our laptop has RS232 and also whether the USART connector is RS232 or 5v or possibly 3.3V serial.
Even if your laptop has a RS232 connector like the one on the board, you may need a Null Modem cable depending on how the USART connector is wired.

JTAG would probably work. But you'd need to buy a JTAG programmer module.
I have one, but have not managed to get it to work, and there is no support for JTAG in the repo - however it would be fairly easy to add something to call a third party JTAG CLI exe on windows.

If the board has STlink, Swd etc, the repo supports that, but you'd need to buy a STLInk adaptor.

Also, your board is a V series, we don't have a "variant" for that at the moment.

But for testing the "STM32 to flash" board type will work but it won't give you access to the extra SPI and UART etc etc that the high density boards have

I know that @bigjohnson was working on variants for V and Z series.

I added the R series the other day, but I think there are problems with it as some GPIO appears not to work