Page 3 of 4
Re: Starting from scratch again... On SW4STM32 now
Posted: Fri Sep 30, 2016 2:09 am
by Chudik
One more change to the settings in addition to my
previous post with settings- in OpenOCD on ST-Link V2-1 (prompts for .cfg target configuration) and others in this external tools configuration need to change arguments
from
-c "telnet_port 4444" -s "E:\ChibiStudio\tools\openocd\scripts" -f "interface/stlink-v2-1.cfg" -f "${file_prompt}"
to
-c "telnet_port 4444" -s "<Drive>:\ChibiStudio\tools\openocd\scripts" -f "interface/stlink-v2-1.cfg" -f "${file_prompt}"
stevedThanks a lot!!!
I've created a file predebug.bat
Code: Select all
SET OPENOCD=E:\ChibiStudio\tools\openocd
%OPENOCD%\bin\openocd.exe -s %OPENOCD%\scripts -f %OPENOCD%\scripts\board\st_nucleo_l1.cfg -f rtos.cfg
and put it to the my project directory.
rtos.cfg is the same
After these changes I was able to run debugger.
Now I'm half happy

Even if I can't make SW4STM32 working as I would like to, in the office I can create a new drive "E:" with subst command and have the same ChibiStudio environment in both my places. Need to clean it, though, because I don't need so many evaluation boards configurations. Besides, need to learn, how to make a custom configuration.
Giovanni May be you could use all this information to be able ChibiStudio to work on any disk?
I believe there are many people who have SSD for C: and/or also prefer not to have their working environment on system drive/partition...
In batch file you can get the current directory by using %~dp0 variable.
In this case your start_gccxxx.bat could have the following set of command
Code: Select all
@echo off
set PATH=%~dp0\tools\gnutools\bin;%PATH%
set PATH=%~dp0\tools\openocd\bin;%PATH%
set PATH=%~dp0\tools\GNU Tools ARM Embedded\4.9 2015q3\arm-none-eabi\bin;%PATH%
set PATH=%~dp0\tools\GNU Tools ARM Embedded\4.9 2015q3\bin;%PATH%
cd eclipse
start eclipse.exe
I just changed it on my computer - works fine
Re: Starting from scratch again... On SW4STM32 now
Posted: Fri Sep 30, 2016 2:32 am
by Chudik
steved
Did you try to transfer your project to another directory that it would not be located inside ChibiStudio structure?
Re: Starting from scratch again... On SW4STM32 now
Posted: Fri Sep 30, 2016 8:46 am
by steved
Chudik wrote:steved
Did you try to transfer your project to another directory that it would not be located inside ChibiStudio structure?
No, not yet. That's on the agenda for when I have some time to play. (I'd rather have projects on a network drive; they're automatically backed up).
I did try having the Chibi libraries on another drive (adjust path in makefile), and that worked fine.
Re: Starting from scratch again... On SW4STM32 now
Posted: Sat Oct 01, 2016 1:44 am
by Chudik
I was able to put my demos project from ChibiStudio to separate directory to another drive, compile and debug it.

All steps described in the attached file
The interesting thing, I have a problem with starting debug from original location C:\ChibiStudio. Don't know why.
GiovanniI have a question for you. I've noticed it before when was working with EM:Blocks and discovered again now. With Nucleo board I can start ChibiOS based project only if I load it from the IDE and press start. It can't start if I just connect it to PC with USB cable. Do you know why?
I don't have a problem like that with a regular projects without the ChibiOS. One of my design works on Nucleo board along with my additional shield board without such behavior.
Re: Starting from scratch again... On SW4STM32 now
Posted: Sat Oct 01, 2016 8:00 am
by Chudik
steved
Sorry, did not mention your nickname in this procedure. Will fix it next Tuesday.
Re: Starting from scratch again... On SW4STM32 now
Posted: Tue Oct 04, 2016 12:42 am
by Chudik
The next step after transferring a project to another directory - rename the project the way, how it is more convenient. I could not find any available tool for that such as Save Project As...
So, I edited files
.project
.cproject
Renamed debug\RT-STM32L152RE-NUCLEO (OpenOCD, Flash and Run).launch
to
debug\CH-STM32L1-Nucleo (OpenOCD, Flash and Run).launch
end edited it too.
in every of these files I changed old names RT-STM32L152RE-NUCLEO to the new one CH-STM32L1-Nucleo. Just Find and Replace.
Seems like it's working fine.
If anybody knows a better way, please share your knowledge

Re: Starting from scratch again... On SW4STM32 now
Posted: Tue Oct 04, 2016 10:16 pm
by Chudik
Updated instruction file with addiions.
Re: Starting from scratch again... On SW4STM32 now
Posted: Wed Oct 12, 2016 12:46 am
by Chudik
There is a very good old
Russian funny movie with one segment about not too experienced burglars. And there are many phrases from this movie still used for many occasions.
So, "Everything stolen before us!"

Document published on
http://wiki.chibios.org/dokuwiki/doku.p ... s:eclipse2 teaches exactly what need to be done for transferring a demo based project to Eclipse based IDE.
With some small changes related to SW4STM32 it works great. At least, for a demo project with keeping OS and Board config in ChibiStudio location.
Re: Starting from scratch again... On SW4STM32 now
Posted: Wed Oct 12, 2016 1:28 am
by Chudik
So, here are the differences.
- Section Preparing your Workspace
Item 2. I did not disable everything like it suggests. As a matter of fact, I left Code Analysis as is.
Item 7. There is no "Standard GDB Hardware Debugging Launcher” in this IDE. I choose GDB(DSF) Hardware Debugging Launcher
However, looks like it does not really matter. Will be explained later. - Next Section to do (remember, I/we want to have the project in different location)
Creating a new Makefile project - that is third in that list.
Practically no difference. Just create your own directory, change in makefile path to ChibiOS and the project name. - Section Importing Makefile projects into Eclipse
Instead of ”– Other Toolchain –” choose "Ac6 STM32 MCU GCC". And this choice helps to create Debug interface by very simple way - automatically how any other AC6 project do!!!
Before first compilation don't forget to add all required by ChibiOS include directories. Eclipse is opensource project and looks like not all features like “Automatic discovery of paths and symbols” or "Import Settings" for includes work in this version. However, you can Export settings from the original demo and copy&paste lines from the created XML file. - Sections Build and Clean project are fine.
- Section Debugging
I went through all of it, but in the end the IDE created it's own GDB Debug Configuration
Need to confirm that.
I still want to have os and board directories to be local in the project directory. It should be more maintainable variant than having them somewhere. Especially when you need to get back to your project in one-two years after release to make some absolutely necessary changes requested by a very important customer
And I hope with this step I will confirm my statement about debugging configuration.
Re: Starting from scratch again... On SW4STM32 now
Posted: Sat Oct 15, 2016 12:27 am
by Chudik
There is a note about using SW4STM32. I don't understand how it indexing file, but it seems like it has a bug in it. As a result, when you compile the project it takes wrong CPU .h file like first file where it finds a name defined. Particularly for GPIOA, for example, it got file stm32l486xx.h instead of required for me stm32l152xe.h. I don't know how to prohibit that indexing and for my projects I just keep files that describe my MCU.
For the current project I use
...chibios161\os\ext\CMSIS\ST only STM32L1xx folder, where I have only three files
stm32l1xx.h
stm32l152xe.h
system_stm32l1xx.h
If anybody knows how to fix it without archiving not needed for the current project files I'll be glad to learn how to do that. I do the same things for all my projects whether they have OS or not. It's quite annoying, but this is the only way I found and understand for now.
Note 2: Don't forget to copy directory ChibiStudio\tools\gnutools\bin to the ... \tools\make directory of the used GCC compiler because SW4STM32 has there only make.exe and rm.exe utilities with their .dlls
-----------------------------
Tried different ways of creating a project with using separate chibios directory, with copying os and boards directory into the project folder - could not get the project compiled without errors. The only way that I've found working:
1. Copy the project prepared the way I described early to a new directory.
2. Change the name in the Makefile and rename the project in the workspace inside the IDE.
3. Keep ChibiStudio in the place where it was originally installed. However, I deleted from there previous versions of chibios and support for the MCUs and compilers I'm not going to use.
If anybody find a way to fix it that would allow to use just chibios without ChibiStudio, it will be great. For now I'm staying with having Chibistudio as a base and SW4STM32 as working environment.