Starting from scratch again... On SW4STM32 now Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: Starting from scratch again... On SW4STM32 now

Post by Chudik »

steved wrote:It's necessary to change some of the linked variable definitions (in particular CHIBIOS - the root of the Chibi directories, and possibly others) and re-import demo projects (if you want them available).
Also necessary to change paths in the startup batch files.
I found it useful being able to compare properties/setup with an installation on C:\ to make sure I hadn't missed anything.

Well, I can put it to root of the other drive/partition in my system or use subst command and spend another day (hopefully only one) to replace all related paths. Besides, for any new version I'll probably need to do it again. I don't like the idea of having a monster size directory for the Studio with all its insides together with bunch of demo projects and my future projects that must to be located inside Chibios directory.

While I understand that for Giovanni it is easy way to handle his project :)
Last edited by Chudik on Fri Sep 23, 2016 1:45 pm, edited 1 time in total.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Starting from scratch again... On SW4STM32 now

Post by Giovanni »

You don't need to replace paths, just remove the projects from workspace and re-import then.

You also need:
1) Change paths in the launch batch file.
2) Change the workspace variable CHIBIOS (in eclipse) to point to the new ChibiOS path.

Giovanni
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: Starting from scratch again... On SW4STM32 now

Post by Chudik »

steved wrote:It's necessary to change some of the linked variable definitions (in particular CHIBIOS - the root of the Chibi directories, and possibly others) and re-import demo projects (if you want them available).
Also necessary to change paths in the startup batch files.

Tried all this with moving to E: drive (where I have all my non system programs installed)
Demo compiled showing no problems, but when I open the main - it shows a lot of errors: can't find types, functions definitions etc, etc...
And it does not provide any choice of debug interfaces... :roll:

May be you could share your Chibistudio version with all your changes for drive D? I have SSD as my drive C: and would not like to write extra stuff on it.
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: Starting from scratch again... On SW4STM32 now

Post by Chudik »

One more day of trying switching to SW4STM32.
Exported one demo project from ChibiStudio and imported to SW4STM32.
Finally, after some manipulations I was able to compile the demo project without errors and warnings.

Here I have a big question: Where are OpenOCD driver defined? I guess, they should be described in some file that need to be copied to some directory.
Where?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Starting from scratch again... On SW4STM32 now

Post by Giovanni »

It is that .launch file in the project, I am not sure if it requires changes for that toolchain. I recommend following their guides for flashing devices.

Giovanni
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: Starting from scratch again... On SW4STM32 now

Post by Chudik »

Both IDEs based on Eclipse. That means, the toolchain should be very similar.

I don't know which way might be easy for the project imported from ChibiStudio - implement the same technique or try to combine with their technique.
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: Starting from scratch again... On SW4STM32 now

Post by Chudik »

I have now two sets:
1. In the office where I'm trying to transfer a project to SW4...
2. At home, where I do the opposite way - trying to run the ChibiStudio on drive different than C:

In both cases I was able to configure the projects properties that can compile without errors and warnings.
Later I will put here a list of things that need to be done for my office case. It is a tad tricky, requires changes in the Makefile and copy some files from ChibiStudio tools directories to the SW4 tools.

Here, what should be done for moving ChibiStudio to another drive (useful if drive C is SSD)
  1. Change paths in <Drive>:\ChibiStuio\*.bat files
  2. Links to the bats in ChibiStudio directory. Change in their parameters C: to <Drive>: as well. You might want to change their icons as well, get them from <Drive>:\ChibiStudio\eclipse
  3. In file <Drive>:\ChibiStudio\eclipse\configuration\.settings\org.eclipse.ui.ide.prefs change paths in the following string RECENT_WORKSPACES=C\:\\ChibiStudio\\workspace161\nC\:\\ChibiStudio\\workspace26\nC\:\\ChibiStudio\\workspace_trunk\nC\:\\ChibiStudio\\workspace30
    to
    RECENT_WORKSPACES=<Drive>\:\\ChibiStudio\\workspace161\n<Drive>\:\\ChibiStudio\\workspace26\n<Drive>\:\\ChibiStudio\\workspace_trunk\n<Drive>\:\\ChibiStudio\\workspace30
After that the whole ChibiStudio located in correct place and when you start it shows all available projects. However, to open any particular one you have to delete it from the list and import again.
The problem after compiling - it again won't debug the project. You choose the correct debug interface (ST LinkV2-1 for the Nucleo board), choose correct .launch file from the debug directory and get the following messages (may be it will ring a bell)

Code: Select all

symbol-file E:\\ChibiStudio\\chibios161\\demos\\STM32\\RT-STM32L152RE-NUCLEO\\build\\ch.elf
Reading symbols from E:\ChibiStudio\chibios161\demos\STM32\RT-STM32L152RE-NUCLEO\build\ch.elf...done.
set remotetimeout 20
monitor reset init
"monitor" command not supported by this target.
monitor sleep 50
"monitor" command not supported by this target.
load E:\\ChibiStudio\\chibios161\\demos\\STM32\\RT-STM32L152RE-NUCLEO\\build\\ch.elf
You can't do that when your target is `None'
tbreak main
Cannot access memory at address 0x8000836
continue
The program is not being run.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Starting from scratch again... On SW4STM32 now

Post by steved »

Probably not the way it was intended, but I create a project-specific batch file which I use to start the debugger, prior to launching a debug configuration:

Code: Select all

D:
cd \ChibiStudio\workspace161\DDF1014_Graphics_Cont
D:\ChibiStudio\tools\openocd\bin\openocd.exe -s "D:\ChibiStudio\tools\openocd\scripts" -f stm32f4discovery.cfg -f add_rtos.cfg


(add_rtos.cfg is a small file which enables the Chibi-specific features of openocd:

Code: Select all

$_TARGETNAME configure -rtos ChibiOS
)
User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Has thanked: 7 times
Been thanked: 1 time

Re: Starting from scratch again... On SW4STM32 now

Post by Chudik »

steved
Do you run this .bat file once or each time before pressing debugging button?
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Starting from scratch again... On SW4STM32 now

Post by steved »

Chudik wrote:steved
Do you run this .bat file once or each time before pressing debugging button?

Just the once. It leaves a command line window open (and you can actually see some of the debugging activity).
Then close the window once finished for the day.
Occasionally things get confused (starting with my brain, usually) and I have to close the window (ctrl-C) and restart.
Post Reply