cancel
Showing results for 
Search instead for 
Did you mean: 

creating new project for stm32 vldiscovery using keil uvision

mahdiyeh_ghazi29
Associate II
Posted on April 25, 2011 at 14:17

hello everybody,

I want to run a simple program that blinks the leds of stm32 discovery board, when I use the sample example (blinky) everything is ok but when I want to create a new project there are a lot of errors when I click build target, even if I include all files of the sample example and set all the options of my project as the sample example, I don't know what the problem is.

I have some how the same problem with STM3210B-EVAL, when I use the samle examples everything is ok but when I create my own project and include the files, there isn't any error but the board don't show the result of the program.

I know that I may forget an awfull issue, could any one help me solve this problem?

thanks in advance  
6 REPLIES 6
Posted on April 25, 2011 at 21:57

Without looking at a busted project it's hard to say exactly what you missed, from the cpu, to the memory map, to the options and defines, the include and library directories, debug and flash settings. There is crate loads of metadata within the project that you are likely to miss or screw up if you are not consummately familiar with the tool chain and IDE. Short of reading the fine manual, and experimenting, you're not going to get this level of competence.

Suggest you take a working example project, copy the whole project directory tree to a new one at the same path level/depth. Open the project, prune out the unwanted stuff, rename things, and copy in or paste your new code/files into this project shell. Even better make the project empty and save it as a template.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mahdiyeh_ghazi29
Associate II
Posted on April 26, 2011 at 08:01

thanks for your reply,

I've tried to create an empty project, I use UM0986 user manual and follow the steps of  ''creating my application'' but when I build the target I get this error : 

Undefined symbol SystemInit (referred from startup_stm32f10x_md_vl.o).

I don't know what the problem is but I know it's very awfull and that's all beacause I'm new user of stmicroelectronic  , I attach my simple project, plz help me solve this problem.

thanks

Posted on April 26, 2011 at 18:01

You rar'd the project while it was open, the project file itself is literally empty as a result.

SystemInit() is part of the library code, you will need the system_stm32f10x.c file added as part of you project, and probably set up some include paths for the library too.

You'll need to review where you unpacked yours, I put it in my ST ARM tree under Keil.

C:\Keil4\ARM\Examples\ST\stm32vldiscovery_package\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c

Perhaps, looking at some of your files,

E:\stm32 discovery\stm32vldiscovery_package\an3268\stm32vldiscovery_package\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c

I'm going to reiterate my previous suggestion one more time.

Copy the directory

E:\stm32 discovery\stm32vldiscovery_package\an3268\stm32vldiscovery_package\Project\Demo

into

E:\stm32 discovery\stm32vldiscovery_package\an3268\stm32vldiscovery_package\Project\Empty

Trim out the EWARMv5 and TrueSTUDIO directories.

Open the new Empty\MDK-ARM project file, rename DISCOVER.uvopt and DISCOVER.uvproj first if you really have too.

Open main.c, cut out the bulk of the code, leaving the includes, main(), and assert_failed().

You should also be able to trim out the library files you don't want, but it might be easier to leave them there for now until you really understand what you do/don't want, and where they live.

Confirm you can build the project, then close it.

Copy ...\Project\Empty into ...\Project\JobOne and use that.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mahdiyeh_ghazi29
Associate II
Posted on April 27, 2011 at 08:38

thanks again,

I added system_stm32f10x.c to my empty project and I also follow the steps as you said and include paths which I've thought was necessary, now I could build the projects but in both of the project (empty and discover) when I start debug session I get this error :

access violation at 0x0000000C : no 'read' permission

I also set all options of my new project as the options of sample projects but still I get this error.

thanks for your concerning and sorry for my stupid questions

Posted on April 27, 2011 at 10:03

Sounds like you don't have the memory or flash profiles set up correctly.

There is a lot of metadata contained within the project, it is very hard to explain all of this, and I don't have the man-hours to spend generating a 16-20 page guide on how to do it from scratch.

The key question is, does the Demo project compile and debug properly? If yes, then use that project as a template.

It takes a couple of seconds to duplicate it, or you can just spend hours pounding your head against a rock, reading documentation, experimenting, and going over the minutia of the settings one by one.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mahdiyeh_ghazi29
Associate II
Posted on April 28, 2011 at 09:05

thanks for your suggestions, they were so usefull, I've search the error in the net and now some how I get what the problem is but I should check it.