-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chibios] Add support for a full ChibiOS arch #1699
Conversation
This is replacing the previous mix chibios/libopencm3: - all drivers are ported to the new arch - it was hard to go forward and take advantages of the RTOS, now it is much easier - switch to v3 of ChibiOS - for now, it is functionaly the same than before - the previous variable length array mechanism used internaly by the sdlog is replaced by a more efficient library called TLSF (allow constant time malloc/free)
Cool, that is exciting! From looking at it the commit, it doesn't add the arch/chibios dir - is that something that you don't need for the sdlogger? |
@podhrmic Thanks, I didn't even realized that all the new files were missing from the commit |
@gautierhattenberger looking at the driver implementation - you have threads for IO, and then running the whole autopilot in one thread (which is the different approach). But this would mean locking us to using ChibiOS this hybrid way, instead of using the full potential of multithreading (or haivng a choice):-/ I still think there is a better solution - are you willing to wait with this? |
As mentioned, it mostly provides the same functionality than the current code, but allow to move forward, whatever the direction. |
I definitely agree with removing the chibios-libopecm3 stuff. |
Yes, but since they apply a AUTHORS file to change the "svn" name to a full name+email git format, this tree is not compatible anymore with the one we are currently using in master (https://github.com/mabl/ChibiOS). So the command |
I see. Well I guess since this is in the development branch, it shouldn't be a problem for users to just do a fresh |
added the git submodule sync to semaphore, shouldn't be needed for travis as it does a fresh git clone... |
The ID's are fixed in the master - |
Currently no idea what's up with the semaphore build, investigating that... |
@@ -95,6 +105,16 @@ ifeq ($(USE_LINK_GC),) | |||
USE_LINK_GC = yes | |||
endif | |||
|
|||
# Linker extra options here. | |||
ifeq ($(USE_LDOPT),) | |||
USE_LDOPT = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, but I think that writing USE_LDOPT ?=
is easier to understand than using ifeq...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because it is based on original ChibiOS examples, makes it easier to upgrade afterwards. Should I still change it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to make it consistent with the original ChibiOS examples, at least for now
I ll look through it in detail over the weekend. |
CHIBIOS = $(PAPARAZZI_SRC)/sw/ext/chibios | ||
|
||
# directory with board defines for chibios platforms (board specific) | ||
BOARD_DIR ?= $(BOARD)/chibios |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you set BOARD_DIR to $(BOARD)/chibios, but for apogee you use BOARD_DIR=$(BOARD)/v$(BOARD_VERSION)
...
Maybe we should stick to one schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I choose not to use BOARD_VERSION since it may not be provided or wanted to separate config files by default.
Haven't looked at the drivers in detail, but I would be very happy if we can merge this as it is a lot cleaner than the chibios-locm3 mix... :-) Then when we have this in master we can continue and pull in the separate main threads that @podhrmic already uses in his chibios branch. Or maybe even better: we should try to abstract threads and mutexes and build a main that we can use for both Linux OS and ChibiOS (and ...?) |
CHIBIOS_BOARD_DIR = $(PAPARAZZI_SRC)/sw/airborne/boards/$(BOARD_DIR) | ||
|
||
# directory with board and OS configuration (project specific) | ||
PROJECT_DIR ?= demo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about the project directory - it is demo
by default, but in the board makefile we set it to
(empty string), right?
Maybe we can get rid of it / streamline it?
# MODEM_PORT | ||
# MODEM_BAUD | ||
# | ||
PERIODIC_FREQUENCY ?= 500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add RTOS_DEBUG = 1
so the tests always compile with full debug suite.
OK, so I finally have time to look over it in more detail - looks good, just few minor things I would recommend changing (see my comments).
Sounds like a good idea. Although I am not very familiar with Linux threads so hard to say how much different it would be. But I definitely support multithreaded solution:) |
I think this should cover most of the comments. Thanks. |
Looks good to me! |
This is replacing the previous mix chibios/libopencm3:
sdlog is replaced by a more efficient library called TLSF (allow
constant time malloc/free)
It also comes as a replacement of the rt_chibios branch (https://github.com/paparazzi/paparazzi/tree/rt_chibios) and the pull request #1504 (although the approach is different)