Board file generation paths Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
steved
Posts: 825
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Board file generation paths  Topic is solved

Postby steved » Wed Jun 07, 2017 4:13 pm

Not sure whether this is a bug or a 'feature'.
Using Chibistudio V17
With the configuration files for the (single) current hardware in a directory off the project directory, edit the .chcfg file and generate the board files.
The board files are put in the correct place (i.e. one directory level up from the .chcfg file)
However the paths in the make file assume a directory off os/hal/boards/. They should pick up the current directory of the board files.


Even better would be for the board make file to calculate the paths at make-time, so that the board files could be moved around without changes.
There's a possible solution for this at the end of the first post here

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Board file generation paths

Postby Giovanni » Wed Jun 07, 2017 5:49 pm

Hi,

The path is one of the options in the .chcfg file, by default it is .. but it can be changed.

Giovanni

steved
Posts: 825
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Board file generation paths

Postby steved » Wed Jun 07, 2017 10:42 pm

Slight misunderstanding here, possibly.

There's no problem with the path where the board files are actually stored - '..' is fine.

The problem is with the content of the make file. It appears that the paths for the include and source directories are hard-coded assuming the board file is stored within the os/hal/boards tree. So they're wrong if the board files are stored somewhere else (e.g. within the project directory).

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Board file generation paths

Postby Giovanni » Thu Jun 08, 2017 8:11 am

Ah, you meant the paths in the board.mk file. That would require another attribute in the XML which is not so immediate because we would have to update all board files or do tricks intemplates if the new attribute is not present.

Giovanni

steved
Posts: 825
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Board file generation paths

Postby steved » Thu Jun 08, 2017 8:34 am

I think it would be possible to cover a number of likely use cases with just some fairly simple coding in the generation script. I'm thinking along the lines of looking at the full path for storing the generated board files:

1. If it includes the string 'os/hal/boards' it's the standard Chibi path.
2. If it includes the string for the environment variable PROJECT_LOC give the files a project-based path
3. If it includes the string for the environment variable WORKSPACE_LOC give the files a workspace-based path
4. Otherwise, two possible options:
a) Default to the standard Chibi path
b) Insert an absolute path

This would certainly be easier than modifying all the templates! And in most cases the board files would probably be portable.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Board file generation paths

Postby Giovanni » Sun Jun 25, 2017 7:23 pm

Hi,

I added the new option in the latest ChibiStudio (plugins 2.5.0). You can add a new element under the "configuration" element and override the default path written in board.h.

Giovanni

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Re: Board file generation paths

Postby faisal » Tue Mar 20, 2018 5:41 pm

Can you modify the templates in gencfg/xml which show all the possible tags - so that they are *true* templates which we can use for new projects. For example, I am using <board_files_path> and had to manually figure out that the .ftl files support that tag.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 22 guests