Skip to main content
Topic: Low cost STM32VLDISCOVERY evaluation board - a first impression (Read 46709 times) previous topic - next topic

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #15
I am not all Windows but you are right, I have it all working perfectly well on a Windows system ... but then there are the debug limitations in all Windows toolchains you won't have using gdb on Linux/Mac OSX.

So I couldn't help it and let my itching finger click the mouse button ... upgrading the ST-Link firmware to the same/latest/identical release works :)

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #16
I'm waiting for discover for few weeks now (maybe even over a month) as none of the suppliers had them on stock and yesterday I got call from my supplier that it is on the way to here :D .. so will have few of them here soon :) ... on the other hand I'm using for a while now this board: http://www.futurlec.com/STM32_Development_Board.shtml ... it is STM32F103RBT6 with usb, 2 usarts, sd card, few leds, few buttons and potio (for testing adc). There's no built in debugger so you must have jtag if you want to debug it (I still have not managed to get openocd+bp to work with it but spent only 30min trying) but you can use on chip bootloader to up the firmware ...

Anyhow I spent last few weeks playing with it so here's some of the stuff I found (this was my first encounter with ARM, I used PIC/MSP430 mostly up till now, and I use Linux (f13, 64bit) so might be helpful):

- ARM core is identical for all mcu's with arm core, so code (thumb 2 for cortex m3 core) is same for all of them, they all have core and debug part same, then they have peripherals that are different, but this is only
"different libraries". I found that STM10x is "best of the best" just because there's bunch of libraries and examples.

- there is GCC for ARM, it is what most of free & cheap ide's use, it is pain to compile but works. Usable links to compile GCC yourself:
http://fun-tech.se/stm32/gcc/index.php 
http://www.eluaproject.net/en_tc_cortex.html
http://github.com/jsnyder/arm-eabi-toolchain (I compiled this one, but I was unable to make it work with eclipse)
http://www.gnuarm.com/files.html#binaries

- there's RealView compiler that is not cheap but is "the best compiler for ARM" and it is made for CPU's not mcu's but then KEIL added realview as compiler to their MDK and that is "the ultimate ARM dev env." but it is expensive. I received some expired trial on cd so I "stole" a version, used it for 5 days, decided that I do like it but that I will never purchase it so I removed it from my computer. I can say that KEIL MDK 4.0 works on linux (under wine) perfectly

- there's IAR embedded workbench arm - again, expensive, again very good (i find keil better and easier to work with + online "experts" say keil makes better code), I plaid with demo version (limited code size), removed from my system

- there's CooCox: http://www.coocox.org/CooCox_CoIDE.htm free tool (not open source) that have GCC+ECLIPSE+LIBRARIES .. very nicely packed .. interesting concept, (I'm using this for development for the moment). CooCox works perfectly under wine

- there's Atolic true studio: http://www.atollic.com/ - they have free and non free versions .. I was unable to make it work under linux/wine so no idea how it works

- the best document about ARM ST32 I found is this (and I REEEEEEALY think everyone should at least skim it): http://www.st.com/mcu/files/mcu/1221142709.pdf

Atolic true studio seems to be the free choice discovery is advertising, anyhow, I can say that with this board I received source of ST peripherals (that should be compatible with any compiler) ... list of include files:
Code: [Select]
cortexm3_macro.h
stm32f10x_adc.h
stm32f10x_bkp.h
stm32f10x_can.h
stm32f10x_crc.h
stm32f10x_dac.h
stm32f10x_dbgmcu.h
stm32f10x_dma.h
stm32f10x_exti.h
stm32f10x_flash.h
stm32f10x_fsmc.h
stm32f10x_gpio.h
stm32f10x_i2c.h
stm32f10x_iwdg.h
stm32f10x_lib.h
stm32f10x_map.h
stm32f10x_nvic.h
stm32f10x_pwr.h
stm32f10x_rcc.h
stm32f10x_rtc.h
stm32f10x_sdio.h
stm32f10x_spi.h
stm32f10x_systick.h
stm32f10x_tim.h
stm32f10x_type.h
stm32f10x_usart.h
stm32f10x_wwdg.h

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #17
one more thing for linux users, if you want to use the ST bootloader from linux there's bot python and c application that work just like "ST Flash Loader":

python script from git://github.com/jsnyder/stm32loader.git
native (c) version: http://stm32flash.googlecode.com/svn/trunk/

both work perfectly but I suggest you go with c one (works bit faster, python version know to fail from time to time)

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #18
[quote author="arhi"]
one more thing for linux users, if you want to use the ST bootloader from linux there's bot python and c application that work just like "ST Flash Loader":

python script from git://github.com/jsnyder/stm32loader.git
native (c) version: http://stm32flash.googlecode.com/svn/trunk/

both work perfectly but I suggest you go with c one (works bit faster, python version know to fail from time to time)
[/quote]

Thanks arhi! I'm trying to do most of my development work on Linux and your links will really help me when I get my board. :) Somehow python scripts fail from time to time (had to use one in a project, never used since then), so I try to avoid them.

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #19
[quote author="tayken"]
I'm trying to do most of my development work on Linux and your links will really help me when I get my board.
[/quote]

:) well, on linux KEIL MDK (IIRC you can get trial version that is limited in code size, should be ok for start, or you can cheat and steel the full version - it all depends on what you allow on your computer. I personally like to try before I purchase and if I decide I will not purchase I remove it from my computer but .. ) works like a charm trough wine. Make sure only to put projects on C: so inside .wine/drive_c and not in for e.g. ~/Dev/Keil_projects and then map ~/Dev as D: - this for some reason don't work properly...

Compiling GCC and using it is pain in the butt and I spent hours trying different versions to be able to get it to compile a blank file with cortex m3 support (they mostly have old arm cores supported but not all have cortex m3) ... so I finally gave up.. I have one gcc toolchain working (and 4 that does not work) and I have no idea how I get it to work - so I don't use it ... (its one of those links I put under GCC)

CooCox is very nice, works under wine but they are actually rewriting ST libs (trying to do something similar to arduino ide with point and click "add peripherals") .. so you cannot use directly all of examples you get with your dev kit's but you can create some from scratch

Atolic is eclipse but I don't know why it was unable to start trough wine... many dev kit suppliers mention atolic and it is supposed to be like CooCox eclipse+gcc but without "fancy addons" (it should go with default st libs) but jre was complaining and it would not start ... I have not tested it under virtualbox as I already got other ones running with wine but you might try it out .. if you manage to make it run under wine, please share how you did it :)

[quote author="tayken"]
:) Somehow python scripts fail from time to time (had to use one in a project, never used since then), so I try to avoid them.
[/quote]
I talk many languages .. over 60 .. and python is the *only* one I can't stand .. there's something about it that I really hate .. can't pinpoint what .. anyhow the stm32flash from svn compiles and works like a charm :)
anyhow, take into account, st flash loader (stm32flash) and alike are used when you want to put the firmware to stm32 using st flash loader (integrated bootloader on chip - you set boot0 pin to high (or low I forgot) and restart mcu) .. now this discovery eval board comes with SWD (single wire debugger) that is in circuit programmer/debugger on usb so you will need to push hex trough it (as I don't see serial port nor boot0 pin exposed on this eval board)... I have no idea if any of this tools will know how to use ST_LINK embedded on this board nor if any of them will be able to work with it trough wine (I never tried any direct usb access from wine)... and I can't pass any exp with discovery board as I'm still waiting for it ... anyhow the jtag port is exposed and you can disable SWD and use bus pirate + openocd (I was unable to make this work, but I did not spend too much time, and my jtag knowledge is close to none)

now, wrt ST_LINK on board, yes, the firmware on the ST_LINK mcu is "closed" .. I will never understand why they are so protective about these "cables" ... all of them .. xilinix included .. like I'm going to use xilinx usb cable to work with competitor's devices ... same here, it's not like I'm going to use ST_LINK cable with ATMEL .. I was tempted to contact http://break-ic.com/ to check if they can extract the hex .. I know few ppl that used their services and all were very happy... and it is quite possible they already have the hex in question :)

anyhow, anyone with some more linux + stm32 experience, please, share :)

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #20
I know of two free stable GCC toolchains with support for ARM Cortex-M3:

- Sourcery G++ Lite (extensive and useful documentation available) - EABI version for stand alone development!
- GNU C/C++ Compiler for ARM Cortex V4.4.0.2 by Hitex (take a look at their other free packages as well)

... and don't forget to download and read their "The Insider's Guide To The STM32 ARM Based Microcontroller" and their other extensive documentation (insider guides for other ARM based families, app notes etc.). Actually you can download The Insiders's Guide To The STM32 from the STM site without registering.

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #21
[quote author="IPenguin"]
I know of two free stable GCC toolchains with support for ARM Cortex-M3:

- Sourcery G++ Lite (extensive and useful documentation available) - EABI version for stand alone development!
[/quote]

I had problems making this work. - the problem was mainly because I forgot to add -mthumb

Code: [Select]
[arhimed@luckey arm-2010q1]$ bin/arm-uclinuxeabi-gcc -mcpu=cortex-m3 a.c
a.c:1: error: target CPU does not support ARM mode
[arhimed@luckey arm-2010q1]$ bin/arm-uclinuxeabi-gcc -mcpu=cortex-m3 -mthumb a.c

and I was then unable to make it work with eclipse CDT (some weird error about some parsing constantly pops out)

Quote
- GNU C/C++ Compiler for ARM Cortex V4.4.0.2 by Hitex (take a look at their other free packages as well)
[s:]looking[/s:] checked it out, nice but windoze only ..

Quote
... and don't forget to download and read their "The Insider's Guide To The STM32 ARM Based Microcontroller" and their other extensive documentation (insider guides for other ARM based families, app notes etc.). Actually you can download The Insiders's Guide To The STM32 from the STM site without registering.

I already put that link in my first post as "best stm32 manual I found out there" :) .. .it is superb document :)

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #22
Thanks for the posts guys!

I am trying to avoid wine as I had some problems with that before. So I would prefer the gcc toolchains. I usually write my code with gedit or some other text editor under Linux, so eclipse problem is not a big deal for me (I guess).

I have no knowledge of JTAG but I will check BP + OpenOCD option.

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #23
I have documented the instalation of gnu gcc complier + newlib + openocd in my blog :) Might be outdated in some parts, but ... it works for me even now :)
http://michaldemin.wordpress.com/

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #24
tayken, sourcery is then imho best option. that is the gcc that works properly out of the box .. I like IDE's especially when there's 900 include files including one another so locating "where the function is defined" can get ugly (sh*t load of grep's or some fancy emacs scripts)... small stuff (PIC .. 16F, 18F) I also do in gedit and compile manually but larger stuff (msp430, pic32mx and now arm) I prefer to have as easy as I can so I can concentrate on "what" and not on "how". wrt wine, it improved A LOT! ... pre fedora13 last time I tested wine was on fedora10 and it was pain in the ... but now, really, it works out of the box, click, click, click and CooCox works, click, click click and KEIL MDK works .. so very very very cool ... wrt ST_LINK I will try to find some linux app that know how to talk to it, for now I'm still waiting for my discovery and this EE dev board I use with serial bootloader (using stm32flash)

robots, seen that, was unable to reproduce it :(
openocd -f buspirate.cfg -f stm32.cfg
returns that buspirate is initialised and that's about it .. no device is detected, maybe the connections were wrong or it was a bad day or whatever else but after good hour of trying to solve it I gave up, will try it again during weekend, most probably the connection was the problem

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #25
[quote author="arhi"]
[...] but larger stuff (msp430, pic32mx and now arm) [...]
[/quote]

Arhi, as you are also using PIC32MX, what are in your opinion the advantages of STM32 compared to PIC32?  I am currently quite happy with PIC32 and would be interested in the motivation to use STM32.

Markus

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #26
[quote author="Markus Gritsch"]
Arhi, as you are also using PIC32MX, what are in your opinion the advantages of STM32 compared to PIC32?  I am currently quite happy with PIC32 and would be interested in the motivation to use STM32.
[/quote]

Well, I don't know what the "real" advantages are because I have ARM for few weeks and spent only tens of hours with it so I'm far from knowing what it can do compared to 32mx. Why I wanted to try it out is
 - very cheap eval boards available (10$ for discovery!, 40$ for the one I got (EE STM32F103) that include USB, SD card, 2xRS232, backup batery ..) compared to pic32mx where for 40$ you can't get squat
 - many different manufacturers sharing same core, your code is 100% portable, the difference between cortex m3 from ST and from NXP is just in peripherals, everything else is identical, same (thumb2) code, same debugging, same tools ..
 - interesting peripherals (I seen ARM with SD driver embedded in mcu!!)
 - pretty big community (ARM actually has greater community then PIC32MX IMHO, 99% PIC users are still on darn ancient 16F84 and they think dspic or 32mx cost arm and a leg and are afraid to move forward, I myself spent a year using 10F, 12F and 16F before I figured out (asked) that 18F and dsPic are actually cheaper the 16F's)
 - GCC (I seen some 32mx gcc but I was unable to make it work)
 - wanted to try something new

So far, I'm uber confused ... I managed to write a blink led, I managed to talk to usart, I managed to read SD, I even managed to make USB work - but I still don't know how exactly it works .. the concept of "turn the bus on, use the bus, turn the bus off" has not yet settled with me... I plan to play with "General" stuff for a few more weeks and they to go and test some rtos and try to make a cnc controller with it (something rudimentary for start) .. it's good test of precise gpio control in background while in foreground SD card is being read and serial/usb is being served ... we'll see, so far I'm too far from understanding how arm works to be able to properly compare it to pic32mx

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #27
I see,  thank you.  "wanted to try something new" is a good reason :)

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #28
yup, it is a most common reason I do anything when hobby is in question :) ... that is also why I don't understand why every single mcu manufacturer don't have "darn good toolchain for free" .. I know they live from "I want to order 5000000 pcs of this mcu to run my toster" but I c lot of choices being affected by how good the tools are and how big the community is ... so yes, a serious company can pay "whatever price" for the toolchain, but they need to hire ppl with experience, if you try to hire someone who know how to use free tool, and someone who knows how to use 5000E tool... and from quantity there's much easier to get to quality ..

Re: Low cost STM32VLDISCOVERY evaluation board - a first impression

Reply #29
I won an starter kit for 32 bit PICs (ethernet one) from element14 and wrote about it. With that board, you are somewhat limited to the stuff that is on board, there is no cheap solution for expansion that I saw, Microchip's expansion board costs 72$ which is exactly the same price as the starter kit itself!

@arhi: You are right about big projects, I run small these days, so a makefile or something similar is enough for me. But as I'm getting the "big boy" stuff, I think I have to move to some kind of IDE.