Go Down

Topic: STM32, Maple and Maple mini port to IDE 1.5.x (Read 624983 times) previous topic - next topic


Apr 01, 2015, 05:22 pm Last Edit: Apr 01, 2015, 05:33 pm by mrburnette


This online JPG contains the orig_port, the non-DMA, and the DMA numbers. Or, download the JPG attachment.



Very interesting.

Looks like    Lines and Rounded rect are faster in non DMA can can do with more optimisation in the DMA version

Its not surprising as lines and rounded rects are lots of individual pixel writes, which are slow because of the overheads of setting the window ( position)
Freelance developer and IT consultant


Hi Roger and Forum

I have designed a new pcb around the 64 pin STM32Fxxx, which includes an on board ESP8266, a HM-11 Bluetooth 4.0 module and an RFM69CW 433MHz module.

There is a lithium battery charger, a boost regulator that will run off a single alkaline cell, a RTC and super capacitor for RTC & RAM retention.

It has Arduino compatible shield socket strips - and the rest of the I/O is broken out onto "breadboard friendly" 0.1" spaced headers.

The pcbs arrived on Monday and the first sample is built and running code.

I realise that Arduino 1.62 has put a spanner temporarily into the works but if anyone is interested, I'm hoping to make this design available to the community.



Nice board.

I presume its a F103 but it was impossible to read the markings in the image, is it a F103CB ?


1.6.2 is turning in more and more of a mess. It looks like they've now broken the download for the package data so its impossible to install the Due , which includes the ARM compiler :-(

I've posted a issue, but in general I'd advise everyone to not use 1.6.2 untill this mess is sorted out

PS. Its not just stm32 its effecting, I think Teensy is effected as are other boards, and its also causing hold ups of esp8266-arduino (the Arduino IDE compilor straight onto the ESP8266 chip)

Freelance developer and IT consultant


Hi Roger

It will take a F103, but also '373 (which has 3 x 16 bit SD ADCs) or a '405 if you want 168MHz, IMB of flash and 192K (+4K) of RAM.

It was inspired by the Nucleo series of boards - but I added 3 of the most popular wireless options, plus full support for LiPo or alkaline battery power.

There's a mini B USB on the underside and a uSD card socket. It has a FTDI header (on PA9 and PA10) and a header for a ST-Link.

It has 3 user LEDS, an electromagnetic sounder on the DAC pin, PA5 and the GPIO is broken out to Arduino style headers  - and a couple of 17 pin SIL headers (hidden in the current photo view)  - 16 analogue inputs on one side, 16 digital pins on the other.

It's designed to be the same footprint as a Raspberry PI Pi-HAT  (65 x 56mm)  and can plug into a Pi - and pick up the uSART and ID eeprom lines

I have 20 prototypes, but I am hoping to explore a volume build of this or something similar in Shenzhen.

The name "PianoForte"  - well obviously the Pi community think that its an analogue/GPIO slave co-processor for the Rasp-Pi (which it can be) - but Piano means soft, and forte means loud or with strength. So I like to think that it's a balance mix of software and hardware.

Once I iron out the bugs - I'll release the eagleCAD files and have a cheap batch made at Seedstudio.

Feedback and comments welcomed






OK about processor options

F103 is the only series that is reasonably well supported

There are files for F3 and F4 but they are quite old variants of libmaple and really need to be tested and updated. I have a 407 discovery board but I"ve only managed to get Blink to work so far ;-(

So for the moment, the F103CB is probably the best chip to put on the board.



Freelance developer and IT consultant


Would the STM32F103RGT6 work in that board?
It seems like it is available for cheap for prototypes, loaded with flash, and hopefully compatible with most of the others F103 peripherals.


Would the STM32F103RGT6 work in that board?
It seems like it is available for cheap for prototypes, loaded with flash, and hopefully compatible with most of the others F103 peripherals.
LOL (OMG), I didnt even realise there was an RGT, I thought it was just RB RC and RE !

Just shows how little I know.

Either way.... I was going to suggest the RET as thats whats in the Maple RET6 board (from leaflabs), but the R series chip is physically bigger, and looking at the PCB layout, although it may be possible to fit it on the board, it would be a tight squeeze and probably a bit of a nightmare to route the tracks, as some other components would probably need to be moved.

Freelance developer and IT consultant


Victor, Roger


The STM32F103RGT6 will fit on the board, but with a minor change to port PA3, and some change in order to the port lines on Port B.

This is a key advantage of the STM32F range, in that you can move between families, and keep pin and peripheral commonality.

The various families offer certain distinctive features - whilst the STM32F1xx family is a good all round M3 microcontroller.

The STM32F37x has three separate differential input 16 bit ADCs - ideal if you are making analogue instrumentation or 3 phase power meters. This and the M4 core make it attractive at a keen price.

The STM32F40x has the advantage of a 168MHz clock and a lot of RAM, again with a M4 core (and floating point unit).

As I say - I was inspired by the range of ST Nucleo devboards - that use the exact same pcb, right across their range of processors, with the minor customations to suit a particular family being selected by zero ohm jumper resistors.

Whilst I can compete with a mass produced (and subsidised board) like the Nucleo - I did want a stable, battery powered platform for my wireless modules - and so I designed my own.

I'll make up a couple of samples with the STM32F103RGT6 - and try it out.

All we need now is an easy toolchain that can be used on these and future core variants, and one that is more resilient to the latest legal rows of Arduino vs Arduino.

Happy Easter



Hi Ken

For the other boards e.g. F3 and F4 (well also the F103 as well really), you could look at what Avik has done


As he has tried to write the same thing from the ground up using the CMSIS headers and cpp files, for which there are versions for all the variants (though there may be some issue with copyright and licensing if you look at the fine print)

But at the moment, the only board I know for sure works with Aviks repo is the F373 as he has built his own boards based on the 373.

The downside is although Avik's repo has the possibility of being capable of supporting loads of different boards, from what I understand its not a full featured in terms of Arduino support as the repo I inherited from Bob Cousins, which he converted from libmaple

And for a lot of people who want to use the Maple bootloader, Avik's repo would take even more work to make compatible


Have you looked at the necessary hardware changes to make your boards work with the Maple bootloader, as they could then not need a USB to Serial adaptor or STLink etc to upload.

The Maple bootloader is not perfect, but it is fairly useful.

AFIK, you just need 1 P type FET (or PNP) transistor and 2 or 3 resistors in a small circuit connected to one of the USB data lins (I cant remember is its D+ or D-), and also one pin on the uP into the gate / base of the transistor to trigger a USB bus re-enumeration by the host machine.

Let me know if you need more details, and I can send you links to schemetics (my personal favourite if the iTead Maple, which is FET based, but I have seen others using a bipolar PNP)

Anyway, at the moment, I think all of our aims, is to get libmaple stable and porting libraries so that they will work on STM32 to the best of its ability


Freelance developer and IT consultant



Just to let you all know that I've updated the windows serial uploader exe   stm32flash.exe to a newer version that supports more processor variants

I've tested it on my F103C8 boards and it seems fine.

Its a long story, but I noticed that @sunspot has been doing some testing on a generic STM32F103C8 board.
I have the same board, so tried to upload on Windows but it didn't work, because stm32flash reported that the processor ID was 2 bytes instead of 1.

However the version of stm32flash I compiled for OSX, which @sunspot was using, works OK.

So I"ve installed MINGW and recompiled the Windows exe using the source from the OSX tools folder, so that now the Windows version supports these STM32F103C8's that it didn't used to.

Actually, the interesting thing is, that when I look on the generic board

There are no markings on the uP at all. In fact it looks like they have been deliberately removed.

STM's own Serial loader reports the ID as  06410041  but I'm not too sure what that means really

Where as my other STM32F103C8T board is reported as being ID 0410

So its actually a bit unclear what the processor on the first board is.

Both devices are simply listed as "STM32_Med-density_64K" by STM's flash loader

I guess its not a big deal, just purely a matter of interest really.

Freelance developer and IT consultant


Hi Roger

I have contacted Avik at Kodino - thanks for the link.

My board includes the pull-up transistor and 1K5 resistor for the USB D+ line, for USB re-enumeration, so it can be compatible with the Maple bootloader.




@Roger I know, I get confused on what cpu has what package. I found the RG when looking at a family graph at stm.com, and it was the one within the R series with the most flash. Then I looked in Aliexpress to see if there was a cheap board with it, and there isn't but the cpu itself is available from under $5 from several vendors, so all that's needed is a compatible board, and the Guinnesimo posted his board :)
As it is in the R series I think it should be more easily compatible with the original code in libmaple.
Regarding the SDcard DMA, I did not have success so far. I haven't been able to test for the last couple of days, but up to the point I tested, it was not working 100% it would start writting or reading and then fail, detect the card some times but not other times... I have to check what else is different between your implementation in the SPI library and my code in the sdfat library, cause that one seems stable in all the tests I do with the same card.

@Ken, if you adapt the board to the RG let me know. If you share the eagle files I may order some PCBs from china and assemble them. Seems like the cost should be just a bit more than the maple mini but still cheaper that the Arduino size maple at much smaller cost. I think your design is a winner with everything that you included on it, and on top, arduino headers for existing shields.

About the maple bootloader, the maple can reset itself when it receives a certain sequence in the USB serial, is that what your pull up transistor is for?



The board should accept the 103 RG as it is - almost without modification.

I will get some '103RGT7  - as they seem to be the cheapest in the RG line up, and give it a go.

The transistor allows the micro to pull the USB D+ line up to Vbus, through a 1K5 resistor. This signals the PC to re-enumerate the USB connection and it appears as a full speed device.

There's a FTDI app note that explains how this signalling is done.

Regarding the maple mini - Port PB8 is hardwired to the Boot0 line - so the mcu can put itself into boot mode by pulling this line low. This probably also initiates PB9 - the "Disc" signal to force a renumeration by  raising the D+ line through 1K5.

The processor sees the 1EAF message coming down the USB pipe and jumps to the reset code.  The first thing it does is see Boot0 low - so it coes into bootloader mode.

This was gleaned from the schematic here  https://github.com/leaflabs/maplemini/blob/master/maplemini.pdf

and a description from Leaf labs documentation here


I have a Baite clone of a miniMaple - I'll check that this is indeed the case




Reference the board with all the pins and JTAG
I have some notes for users here

It is made by Shenzhen and mine is marked as -

GH342 9U
CHN 402
ST as a logo__e3 in a circle__ i

And blink at least works

I have been trying to get an SD card to run and I have loaded Nokia5110_SPI_SDCard.zip
from Ray (thanks!)

That works fine on the other generic card shown here

If any other Arduino lesson 1 users (like me) see this thread may I suggest you let these developers use every minute to complete their task and join me here to play with the IDE

Go Up