Go Down

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

mrburnette

#45
Oct 16, 2014, 11:34 pm Last Edit: Dec 28, 2014, 05:05 pm by mrburnette
Note: Please make reference to:
https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki
For a summarized version of pertinent information contained in this lengthly
thread.  Also, some simple Mini Maple projects with source may be found on
my blog: http://www.hackster.io/rayburne


I am having issues with the Maple clone under 8.1 Windows. I disabled driver signing and was able to install the ASP driver and the virtual com port, and the devMgr sees Maple003 but I am unable to get either the older Maple IDE or the latest Arduino1.5.x to use the device.  Seems like the COMx port is not enumerating.

I have not tried on Win7 of XP (yet.)  Been a bit lazy as this was a side-track adventure with no end game in view.  Board looks good, however and DFU mode is obtained easily 'nuff.

rogerClark

I just took another look at my USB error, and it could just be that Windows 7 can't find a driver, its hard to tell.
I'll see if I can find and install the Maple USB driver, and perhaps this board will be recognized as a Maple mini clone, however I suspect its not got the Maple firmware installed.

I tried to use Google Translate to translate the Chinese language page on vcc-gnd.taobao.com, but as a lot of the characters were in images on in HTML, Google Translate was unable to read them :-( and I couldn't see any links to any docs.

It looks like the boards I bought definitely need a compatible JTAG programmer, and fortunately I ordered a clone from eBay a couple of weeks ago, but its not arrived yet.
Hopefully it will turn up in the next week.

Freelance developer and IT consultant
www.rogerclark.net

rogerClark

#47
Oct 17, 2014, 01:24 am Last Edit: Oct 17, 2014, 03:10 am by rogerClark Reason: 1
Unfortunately it looks like these boards  

http://www.ebay.co.uk/itm/High-Quality-STM32F103C8T6-ARM-STM32-Development-Board-Module-For-Arduino-Tool-/251621420724?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item3a95ce2eb4

Don't appear to be immediately programmable via USB.
I tried all permutations of the jump links but it doesn't seem to make any difference - the USB just comes up as unrecognised device  and no hardware ID's are shown,
I suspect they are just put there for developers to use to allow configuration to be read, i.e if the board had a boot loader

I will check later to see if Linux e.g. lsusb shows anything.


I'm going to order a couple of leaf mini clones as well as waiting for my jtag programmer to turn up.

I suspect it could be possible to burn the maple bootloader onto this board, but as it only has 2 buttons, But perhaps it could be changed to use the jump links (assuming the source is available)

Or perhaps there is another more Arduino compatible that could be used e.g. something like the Due boot loader

Anyway, I guess I need to wait for my JTag / STLink programmer to arrive before I can do anything with these boards

Freelance developer and IT consultant
www.rogerclark.net

mcnobby

I havent even got round to looking at my one yet, mine is a MapleLeaf clone from eBay
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

westfw

The 103c8t6 does not include a USB bootloader in rom, though it does have a serial bootloader.   I would assume that you can put a USB capable bootloader on the chip, but it's not there by default.   I don't know whether the maple IDE assumes the st bootloader, or something custom, but a random eBay st board is probably bare.

rogerClark

Quote
though it does have a serial bootloader.


Do you mean a JTag compatible bootloader or RS232 type serial.

Looking at the connections on my board, they are labeled GND, DIO and DCLK (as well as 3.3V) so I suppose you mean a sort of JTAG serial interface ?

Freelance developer and IT consultant
www.rogerclark.net

westfw

I don't know what the board has done.  The chip supports a serial bootloader on its Usart0 interface, via fiddling wit,h the boot0 and boot1 pins.  Hopefully the Usart pins are accessible on  the board even if it means connecting to  random spots.  You only need rx and rx...

I'm away from home at the moment (Disneyland!) and can't look up the specifics.

rogerClark

#52
Oct 17, 2014, 11:04 am Last Edit: Oct 17, 2014, 01:32 pm by rogerClark Reason: 1
Thanks @westfw

Hopefully my hardware programmer may come next week, so I think I'll hold on until it arrives, rather than attempting to find those pins, as they don't seem to be broken out onto the edge of the board.

Enjoy Disneyland

Edit.

I took a look at the ST tech notes, and I see what you mean about the boot pins.

The board appears to have the boot pins connected to the jump links, so I guess I can select the appropriate boot mode and connect a USB to serial adaptor to the Rx and Tx pins.

However I've yet to work out what software communicates with the Stm  microprocessor in this mode.

So I need to do more research
Freelance developer and IT consultant
www.rogerclark.net

mrburnette

#53
Oct 17, 2014, 06:16 pm Last Edit: Dec 28, 2014, 05:06 pm by mrburnette
Note: Please make reference to:
https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki
For a summarized version of pertinent information contained in this lengthly
thread.  Also, some simple Mini Maple projects with source may be found on
my blog: http://www.hackster.io/rayburne

Success using the Maple IDE on Windows 8.1 64-bit professional via DFU mode.

- Driver signing must be disabled for the session duration (Google for several approaches)
- Update the DFU-Util https://dl.dropboxusercontent.com/u/54378433/dfu-util/dfu-util.exe
- Use libusb-win32-bin-1.2.6.0 utility installer_x utility to create an INF file (Maple must be plugged into USB)
- Point Control panel to the new INF and install

In the Maple IDE 0018, bring up the Blink Example and use File/Upload to I/O Board to upload the compiled sketch.  The mini-Maple needs to be in permanent DFU mode.

Disclaimer, some of the above may be short-circuited but hopefully this will get you into the ballpark with the mini.

Now, hopefully bobcousins will get is all working under Arduino 1.5.7.  HOwever it appears that unless someone finds a way to enumerate the COMx port of the Maple under Win8.1, the DFU-Util will still be needed unless the Arduino IDE has a hook to replace AVRDUDE.  (I thought I had it, but I'm getting a library path error: arm-none-eabi-g++: error: C:\Program Files (x86)\arduino_157\hardware\maple-asp\Maple\variants\maple/libmaple.a: No such file or directory)  Maybe tomorrow with a fresh cup of coffee?


Ray

rogerClark

#54
Oct 18, 2014, 08:39 am Last Edit: Oct 18, 2014, 12:41 pm by rogerClark Reason: 1
Taking @WestFm's advice, I've managed to communicate with my STM32 board (that looks a bit like a Maple Mini) i.e


But I can only get serial to work.

I have tried the 2 boot pin links in all positions and I although a USB device appears, regardless of Link settings, it just comes up as unknown device on Windows 7, and I tried using the DfuSe from ST's website and also the one that mrburnette posted, but neither seemed to recognize the USB device.

I have yet to try it on XP or Linux, so I guess there is a chance one of those may behave differently

Anyway. I did manage to connect to the board using a USB to serial connector which I normally use to program Arduino Pro Minis' , using the ST's "Flash Loader Demo"

However all I've done so far is to see if I could download, and unfortunately I have a driver issue with my USB to Serial which causes Windows to crash into blue screen sometimes, which us what happened using the Flash Loader.

So I guess my next step is probably to see if I can upload the Maple Mini bootloader onto my STM32 board.

So I'll post to the forum and update if I manage to do that


Edit.

Just uploaded Maple_mini_boot.bin to the board via serial, and the board is now reporting as Maple 003
Hardware ID's

USB\VID_1EAF&PID_0003&REV_0201
USB\VID_1EAF&PID_0003

The next step will be installing the Maple driver on W7. I better download and install the Maple IDE and see how things go.

Hopefully W7 will not be as much hassle as W7, but I imagine that there are similar driver signing issues :-(


Edit 2.

I have the same driver signing issues with W7.  aarrggghhh.

Looks like the only way to load the driver is to reboot and temporarily disable driver signing, but its a pain to need to do this each time I reboot.

Also. The board I have, doesn't have the LED on the same pin as the maple board and also doesnt have 2 push buttons, it only has a reset button, but looking at the Maple mini schematic, its easy to wire another led and it looks like i can use the jump links as the push button, as long as I connect PB8 to the Boot0 link.
(Maple has the LED on PB1, it looks like the LED on my board is on PC13)
I'll need to wire up the LED otherwise I can't see it flashing during startup, to work out when to use the jump link to trigger the various USB configs required for the full setup.




Freelance developer and IT consultant
www.rogerclark.net

bobcousins

@roger  You are doing well :)

I also got one of those boards, hadn't got round to programming it yet. I've been searching for schematic or other info,  I can't find one anywhere.

I managed to install the Maple drivers ok on Win7 64 bit even though they are not signed. Btw, PID=0003 should be the libusb DFU device, and PID=0004 is the USB serial device.

I think that BOOT1 jumper should normally be set to zero. BOOT0 is the equivalent of BUT button on Maple boards, ie. jumper to 1 /after/ reset (during fast LED flashing) to get into perpetual bootloader, otherwise the jumper should be set to 0 to run user sketch.  If BOOT0 is 1 at reset, the chip will enter the ROM bootloader (UART).
Please ask questions in the forum so everyone can benefit. PM me for paid work.

bobcousins

#56
Oct 18, 2014, 04:11 pm Last Edit: Oct 18, 2014, 04:14 pm by bobcousins Reason: 1
Good news :D

I have now tested Maple-ASP on Windows 7 and 8 (64-bit) and hopefully ironed out most of the bugs. It supports Maple and Maple Mini boards with Maple bootloader already installed.

I discovered exe and dlls were not in the github repo, sorry about that!

I have included drivers for Maple serial and Maple DFU which should install as unsigned drivers on Win7, you will need to disable driver signing on Win 8 to install.

You need to install drivers twice, once when the Maple board is in bootloader (DFU driver) and once again when the Maple is running a sketch (Maple serial port). Possibly the DFU driver can be installed using the libusb installer, I didn't try that. Either way you must pre-install the DFU driver before downloading a sketch.

I'll look at bundling a bootloader and UART programmer to allow native downloads. I'll also like to create a target for the non-maple boards, and maybe an installer. Any help with Linux installation would be appreciated :)

Most of the information in the Leaflabs doc still applies, http://leaflabs.com/docs/

My install process was as follows:

1. Download and install Arduino 1.5.7  http://arduino.cc/en/main/software
2. Download and install Maple-ASP zip file (NB must install into sketchbook!) https://github.com/bobc/maple-asp/archive/master.zip
3. If Windows 8, reboot with options, disable driver signing   https://learn.sparkfun.com/tutorials/disabling-driver-signature-on-windows-8/disabling-signed-driver-enforcement-on-windows-8
4. Plug in maple board. Install Maple serial driver from "Documents\Arduino\hardware\maple-asp\drivers"
5. Set board to perpetual bootloader mode. Install Maple DFU driver from "Documents\Arduino\hardware\maple-asp\drivers"
6. Run Arduino IDE
7. Select Boards->Maple and COM port as appropriate.
8. Load Blinky sketch. Edit LED pin to "BOARD_LED_PIN"
9. Upload!
Please ask questions in the forum so everyone can benefit. PM me for paid work.

PaulRB

Hi bobcousins, how much of that would you expect to work on linux? I use Ubuntu 14.04, Arduino 1.0.5 (1.5 not available on Ubuntu s/w centre yet) and have a Maple Mini clone, which I can program with Maple ide for the moment (but obviously a single app which does Arduino and Maple would be better).

Thanks,

Paul

rogerClark

#58
Oct 18, 2014, 09:55 pm Last Edit: Oct 19, 2014, 01:40 am by rogerClark Reason: 1
Hi bob,

I've taken a closer look at the schematic of the maple mini versus the hardware of my STM32 board and it looks like there are some more hardware differences that will prevent it working as a maple mini clone.

The maple mini schematic shows two transistors configured to do something with the D+ line of  the USB.
As far as I can tell the generic STM32 board doesn't have this.

Also the generic board appears to have a RTC device on it, well according to the photo on the vcc gnd website, that's what one 4 pin IC on the board is supposed to be.

If it needs 2 transistors etc in order to work with the maple driver, I will probably not bother adding all other components, and instead just use the boards with some other dev system e.g coocox.

But I will try just adding the led and connecting the other line to boot0.

I have 2 of these generic boards, so I'm also going to try to get hold of the USB bootloader that is supposed to be installed on the STM primer boards, and put that bootloader on my other board, so that I can flash using the ST USB uploader, rather than needing to use Serial.

I'm not sure if coocox works directly with the ST USB bootloader, but I also have a Chinese clone STLINK module in the post, so I will be able to get these board fully working sooner of later

Edit.

I connected a LED to PB1 and it flashes as expected, given the firmware is for the Maple mini. However I was unable to get the board to go into DFU mode.

I soldered a wire between PB8 and my Boot0 jump  link (is the jump link in the center of the board), and followed the instructions,. on the maple wiki, which basically pull boot0 and high while the led is flashing quickly.

But I couldn't get it to work.

The wiring of these generic boards has 100k in series with boot0 and the jump link, and I was unable to directly solder PB8 to Boot0 on the IC without damaging the IC. (I tried a few times but you would need a microscope to do it successfully)

I also tried pulling PB8 to 3.3V via a 1K via a push button, in case the issue was the 100k, but it didn't make any difference.

Also unfortunately i managed to snap the connections to the micro USB whiile trying to press and hold the button and move the jump links etc.

Fortunately, I managed to re-flow the solder back onto the USB pins

But I think i'll need to give up using these generic STM32 boards as a Maple Mini, because its possible that in order for the DFU mode to run, I'd need to wire in the 2 transistors that are connected to D+ and I'd probably damage the board doing that :-(

I'll have to wait for my other Maple Mini clones to arrive in the post in a few weeks
Freelance developer and IT consultant
www.rogerclark.net

rogerClark

#59
Oct 18, 2014, 10:05 pm Last Edit: Oct 18, 2014, 10:09 pm by rogerClark Reason: 1
I'm not sure if this is relevant but I've noticed this

https://www.microduino.cc/

https://www.microduino.cc/wiki/index.php?title=Microduino-CoreSTM32

Which seems also to use the maple IDE etc.

It looks like they may have just cloned the maple design,  and put it in a different form factor.

But I have not tracked down their schematics yet.

Freelance developer and IT consultant
www.rogerclark.net

Go Up