Porting px4 to the evl4 kernel of aarch64 architecture#2
Porting px4 to the evl4 kernel of aarch64 architecture#2yexuanyang wants to merge 2 commits intoEOS-team:sitl_devfrom
Conversation
dfb113f to
ea5c7b9
Compare
ruiqurm
left a comment
There was a problem hiding this comment.
Awesome job on this PR! I’ve left a few comments with some questions.
One thing I noticed is about naming — currently, nullptr is passed to all named elements like mutex, thread, etc. Would it be possible to assign meaningful names to these elements? That would make debugging easier.
No rush though — this can definitely be addressed in a future update.
src/include/visibility.h
Outdated
There was a problem hiding this comment.
Note that evl_usleep cannot sleep for durations longer than one second. You may want to try evl_sleep_until instead.(I am not sure the evl_sleep_until if the API can be used to sleep for more than one second either)
There was a problem hiding this comment.
OK, I will change it to a loop using system_usleep.
There was a problem hiding this comment.
Could you please check the purpose of this macro? Should we use a real-time sleep function here, or is it acceptable to use a standard sleep instead?
There was a problem hiding this comment.
px4_sleep use the system_sleep when lockstepscheduler doesn't set absolute time, it is the only place calling system_sleep, but px4_sleep is commonly used. I think it is only use when lockstepscheduler is not start. But it will use in drivers while loop, like gps driver. GPS driver use px4_sleep in GPS::run().
I use a real-time sleep here, just in case.
There was a problem hiding this comment.
So the most use case is in debuging? I think just use usleep is ok.
Well, when the mutex has a name, it must be an unique name. Obviously, it is easy to think about using |
545a810 to
b95d256
Compare
Currently, you can run px4 using the libevl api instead of the posix interface by setting the environment variable PX4_SIM_MODEL=shell. Use Makefile to build px4_sitl_evl4: ```bash make px4_sitl_evl4 ``` The following are the operations that can be run on my machine: - Create a cmake build directory: ```bash /usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCONFIG:STRING=px4_sitl_evl4 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/aarch64-linux-gnu-g++ --no-warn-unused-cli -S/root/PX4-Autopilot -B/root/PX4-Autopilot/build/px4_sitl_evl4 -G Ninja ``` - cmake starts building: ```bash /usr/bin/cmake --build /root/PX4-Autopilot/build/px4_sitl_evl4 --config RelWithDebInfo --target all -- ``` - Run px4: ```bash cd /root/PX4-Autopilot/build/px4_sitl_evl4/rootfs export PX4_SIM_MODEL=shell ../bin/px4 ``` Signed-off-by: yexuanyang <myemailyyxg@gmail.com>
Hello everyone! I am trying to port px4 to evl4 kernel. Now it can run with PX4_SIM_MODEL=shell environment variable set, I will add some benchmarks to measure the jitter in
TasksandWorkItemsin the future.The following are the operations that can be run on my machine:
Create a cmake build directory:
cmake starts building:
Run px4: