cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner - May this thread help others like me.

matt239955
Associate II
Posted on January 04, 2015 at 06:57

Hello all.  I have designed an electronics board from scratch with an engineer and we have made our first prototype board.  We have chosen the STM32F407VGT6 processor.

I have downloaded the STMCubeMX software and I have bought an ST-Link/V2 kit for loading(?) and debugging(?).

For my product I will be using GPIO for buttons and LEDs, I2C, RS232 (ascii commands for my system bi-directional), USB (Loading firmware updates?), and Ethernet (TCP control instead of the RS232, loading firmware updates, web-based user configuration, and IOS/IPAD/IPHONE app control).

I have done C++, Visual Basic, and some HTML/XML programming but it was a long while back, and currently I am using a visual studio for control-systems programming that is manufacturer specific - so while I am not a beginner to programming.....I am not familiar with ARM processor programming and the best IDE (Integrated Development Environment) that I should use.

I prefer a mac....but I am running windows via parallels.

What I hope to answer from posting this thread is:

-What software besides the STM32CubeMX software do I need to get?

-Will I be using the ST-Link/V2 to upload the compiled project?

-Will I be able to use the ST-Link/V2 to easily test GPIO (''see'' button presses and light leds) or run instructions for debugging?

-Will I be using C++ for my customized programming within the IDE?

-Once I get some basic features programmed/installed/debugged, how should I develop my web-based user interface and IOS app?  Is this capable within the IDE or will I be looking at another software package for that.

-Where can I find some ''straight forward'' instructions or videos that will help me get up to speed with these things.

Thank you.

#stm32-youtube
12 REPLIES 12
matt239955
Associate II
Posted on January 04, 2015 at 16:58

Also after doing more searching and youtube watching it seems that many prefer to use Keil (with STMCubeMX? or instead of STMCubeMX?)  what part does this software play in the big picture?

Tamas Novak
Associate III
Posted on January 07, 2015 at 16:20

Lot of players: 

1) ARM core comes from ARM. As you shouldn't use assembler (nor C++: better use C for microcontrollers), C compiler deals with assembler and CPU registers, there is no too much things to do with core.

2) IDE (Intergrated Developing Environment software). There are more of it, but Keil is fine choice. (I actually use Raisonance Ride7 with RLink debugger). You need support sometimes when using the IDE (compiler options: search directories, stack sizing, variable placement, modifying linker scripts, optimization for debug or release etc.)

3) C compiler and linker: when you choose IDE, you got the compiler+linker with it, but it is from another source, so you need to look at e.g. GCC for support.

4) debugger/flash programmer software: it's the same: you got it together with IDE.

5) debugging/flash programming hardware: it depends on IDE. STLink V2 is okay to use with Keil uVision

6) periheral library: as silicon is designed by ST, peripheral support also comes from ST.

It is the most time-consuming part of working with MCU programming: peripheral modules are very complex, have hundreds of registers with thousands of bits. You may use the peripherals ''manually'' through registers, but they are so complex, you better use library functions dealing with them.

ST is jsut making a big change at peripheral library: you still may use StdPeripheralLib v1.3.0, but the preferred new Hardware Abstraction Layer approach is ''Cube F4 HAL library''. There is a configuration-generator tool called ''CubeMX''. THat helps you choose a MCU model, assign pins to peripherals, and generate C source for module initialization. This tool and HAL library seems to be very fair.. maybe they are a bit rough today. There is no help system for Cube F4 library (yet): you can use Example projects and comments in their source to learn.

Tamas Novak
Associate III
Posted on January 07, 2015 at 16:41

''with MX'':  CubeMX generates C source, headers and Keil project file. *.uvproj file may also be opened/imported with other IDE (my Raisonance Ride7 can import/convert Keil project file to its own *.rprj file.)

You may choose any IDE, accessing peripheral module functions you will use ''Cube F4''.

Best order of creating a new project from scratch:

1) start CubeMX, define modules needed, setup their parameters

2) generate s/w sources and project file. Also generate pinout list.

3) design schematic and PCB based on pinout list from CubeMX

4) customize CubeMX generated s/w project: add the ''real thing''

mikemike9145
Associate
Posted on January 07, 2015 at 16:54

Dear all,

please point some youtube videos for beginner like me, where to start from. i have read some motor control application from st. i think its easy to understand. i have make VFD with microchip dsPIC30F2010. please help me to take a chance.

Regard's

Masud

matt239955
Associate II
Posted on January 07, 2015 at 18:20

Thank you for replying.

So I think you are suggesting that CubeMX is the way to go first....layout my processor and connection to peripherals then open up in another IDE to finish it.

I am a small time guy right now - is there another IDE option that is out there for free?   I just got Keil pricing and it might be too much if my product doesn't take off right away.

matt239955
Associate II
Posted on January 07, 2015 at 18:42

More info for beginners - I just got off the phone with Keil tech support and it was helpful.

Step 1 - Use CubeMX to begin with peripherals and processor layout

Step 2 - Save project and load into Keil (or another IDE I'm guessing)

Step 3 - Use the Editor of the IDE to make programming changes and use the Project Manager of the IDE to organize your modules

Step 4 - Compile your project using the IDE

Step 5 - setup your IDE to communicate with your DEBUGGER (in my case ST-Link/V2), then LOAD your project to the processor and use the DEBUGGER to troubleshoot.

Am I missing anything here?  Can the CubeMX software be used as a complete IDE (editing, compiling, loading, debugging)?  If not - what software is recommended to do this?

matt239955
Associate II
Posted on January 07, 2015 at 21:11

I found this guy to be very helpful to beginners as well:

http://stm32projectconsulting.blogspot.com/

Good explanation of CMSIS, HAL, IDE, what to download first and a startup program.
Posted on January 08, 2015 at 01:12

Can the CubeMX software be used as a complete IDE (editing, compiling, loading, debugging)?

Unless I'm mistaken it's none of those things, it's a code generator. It creates a shell and you fill in the blanks.

For an IDE, Keil, Rowley, and IAR are all quite serviceable, the choice of often one of personal taste. The integration of debugging on the free solution might be a bit crude.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
AvaTar
Lead
Posted on January 08, 2015 at 08:51

The integration of debugging on the free solution might be a bit crude.

 

And the list of supported debug pods is usually rather short.

When evaluating 4 MCUs from different vendors, you might easily end up with 4 different free IDEs/toolchains.