October 9, 2008 - 6:04pm
Guest |
Hallo!
I am new with MCU programming and I have some problems setting up libraries with RIDE7 using REva and STM32F103 daughterboard.
First, I tried to use the project template (there´s also a readme and I followed the procedure described) but it doesn´t work. Linking always fails (it can´t find some .h and .c files).
Then I tried some simple LED examples and they worked (I just copied main.c and _conf.h in a trial-directory), but when I try examples with ISRs nothing happens.
Can anyone tell me how to start-up programming step-by-step? How can I make a standard project template to use as a basis for all the other projects?
|
Do you have any experience in any other sort of programming, or are you a complete novice to any kind of programming?
That's strange - .c and .h files have nothing to do with the Linker!
Problems finding .c and .h files would be reported by the Compiler
The location of .c files is specified explicitly when you add the file to the project, and is shown in the build output window when RIDE tries to compile it.
The location of .h files is specified via the include directories in the project properties;
again, the Include paths being used are shown in the build output window when RIDE tries to compile a .c file.
This is all pretty standard stuff - hence the question if you have any prior programming experience at all.
Hello and thanks for the answer!
You´re right I talked about Compiler, as you can see I have no experience at all :)
So this is the procedure I used and it worked with simple examples:
1) Create my own work directory with main.c and stm32f10x_config.h
2) Create a project and add the main.c (all the needed peripherals .h files will be written as dependancies)
3) Setting up the project properties (I select RAM boot, default include directories ---> $(RkitLib)\ARM\include , library directories ---> $(RkitLib)\ARM\ , ST library ---> YES )
In this way everything works but... I would like to use also the ISRs and in the project template i see a stm32f10x_vector.c file that calls the main, maybe can be used in some way?
I would like also to understand how to use the include directories, library directories and ST library options, because when I try to use other directories than default ones (for example I downloaded the new FW_lib, and i setted this directory path as include dir and library dir), I have a lot of errors.
Hi
Here are some tips about the use of library with Ride7 IDE.
If you download the FWlib and you want to use it you have two options:
1. You can compile the files from this library to get a library file that will replace the STM32F10x_thumb.lib (you keep the option use ST library)
2. You can add the files in your project and they will be compiled with the other files of your project. (you do not keep the option use ST library)
I would suggest the second option because this way when you change configuration value the value is immedialtely updated.
In this case you can start from your own project,with:
+ Your source files (main.c, stm32f10x_it.c,....)
+ Place your stm32f10x_conf.h stm32f10x_it.h in the folder where your .rprj is(if you have an error of undeclared things you need to uncomment peripherals there)
Then add all the source files files from folder : ......\Ride\lib\ARM\STM32F10x_LIB\library\src in your project node.
Add the path ......\Ride\lib\ARM\STM32F10x_LIB\library\src to the include files directories instead of $(RkitLib)\ARM\include but keep the "." which represent the place your .rprj is.
Unselect the option use ST library and try to compile.
If you have errors they should be enough detailed for you to try to solve them.
Matloub
Thanks for the help, now many things are clear.
but all the troubles were due to a bug in RIDE software. I mean, when I change the project configuration (such as include directories and so on), I have to exit RIDE and open the project again - so everything works fine.
Greetings.
Yes, that bug has caused me a great deal of grief! :mad:
But you don't actually need to exit RIDE - Saving the Project is sufficient. :rolleyes:
Saving isn't enough, I have to exit and load project again.
Are you sure you are saving the Project ?
That was sufficient for me - but maybe you have found a worse strain of the bug...? :O