Information about chibios 20

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

User avatar
Boris_il_forte
Posts: 11
Joined: Mon Sep 17, 2012 10:40 am
Location: Darmstadt, Germany
Contact:

Information about chibios 20

Postby Boris_il_forte » Sat Jul 04, 2020 8:43 pm

Dear all,

After a long time, I came back to embedded development/Chibios.
I opened again the old code of my old project, and I wanted to port it from Chibios 2.4.3 to Chibios 20.3.

I was aware of the changes, particularly during the transition to Chibios 3 (if I'm not wrong), that changed some names in some os functions.

However, I see that in the 20.3 no demo nor test has a board.h inside (correct me if I'm wrong).
Previously, I used the board.h file to set the pin mode and function, now it seems to be only found in the os/hal/boards/ folder.
Is this a design choice? The appropriate way to setup the board is by using the PAL driver functionality? Or I should still create a board.h and use that?

Sorry if the question are a bit outdated, but my last chibios project was quite old... and I wasn't able to find a solution online.

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

Re: Information about chibios 20

Postby Giovanni » Sat Jul 04, 2020 8:48 pm

Hi,

Board files are still there pretty much unchanged, look at the inclusion in makefiles.

BTW most changes happened during the transition to RT3, you are correct. If you see differences just ask for details.

Giovanni

User avatar
Boris_il_forte
Posts: 11
Joined: Mon Sep 17, 2012 10:40 am
Location: Darmstadt, Germany
Contact:

Re: Information about chibios 20

Postby Boris_il_forte » Wed Jul 15, 2020 11:55 pm

Ok, I managed to generate my new board file using the board.chcfg file of the STM32f4_DISCOVERY.

I've also seen that there is a board.fmpp, if I understand correctly is used to generate the chcfg file... But I didn't understand how to do it.
Where can I find reference guide for chibistudio? In the site is "work in progress" and I would like to use chibios/chibistudio "as is supposed to be used" and not "as I'm able to use it".

Indeed, even if I'm able to use the board.h/.c generated, I still had some difficulties: indeed the generated makefile contains this two lines:
# List of all the board related files.
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.c

# Required include directories
BOARDINC = $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY

Given that I left the board with the same name of the original file, I had the original board.h compiled instead of the new one, causing me some troubles.
So, the idea is to put all the new boards inside the boards folder of chibios? or how is it supposed to be used? I'm missing something?

Sorry for the stupid questions, but I wasn't able to find an answer online.

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

Re: Information about chibios 20

Postby Giovanni » Thu Jul 16, 2020 5:05 am

Hi,

A good place for a custom board is inside your project, create a ./board directory in it and change the makefile to point there.

Giovanni

rew
Posts: 380
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 13 times

Re: Information about chibios 20

Postby rew » Fri Jul 31, 2020 9:23 pm

A good way to handle boards would be to have the makefile just do:

#BOARD=$(CHIBIOS).../boards/STM32Nucleo072
BOARD=./board

and that the standard 'rules" include at the end of the make file would do:

include $(BOARD)/board.mk

or not even that: All of those just add the board.c file and make the board.h find-able, so those are redundant.... So my proposal would be that a board directory simply has board.h and board.c and that after pointing the BOARD or BOARD_DIR variable at the right one, the rules.mk does the rest.

I am also a big fan of distributing chibios with "minimal" board files that just specify the CPU and then nothing for pre-configuring LEDS as outputs etc etc: All pins just inputs. That would then be a good base for building something for a custom board for.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 29 guests