Giter Site home page Giter Site logo

opencyphal-garage / libcyphal Goto Github PK

View Code? Open in Web Editor NEW
277.0 277.0 503.0 13.29 MB

Portable reference implementation of the Cyphal protocol stack in C++ for embedded systems and Linux.

Home Page: http://opencyphal.org

License: MIT License

Python 25.05% C++ 38.76% CMake 36.19%
aerospace can communication-protocol cpp cpp11 cpp14 cyphal drones embedded-systems linux misra opencyphal robotics socketcan space uav uavcan vehicle-bus

libcyphal's People

Contributors

pavel-kirienko avatar serges147 avatar thirtytwobits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libcyphal's Issues

Transition from Bootloader to Application

@pavel-kirienko more of an FYI...

We had considered passing the uptime from the BL-->App, but the TID is wrong and the uptime messages transition to critical on the uavcan_monitor

 1   |^[[32m OPERATIONAL     ^[[39m|^[[32m OK       ^[[39m| 80         | 0000  00000000'00000000  0
 120 |^[[31m OFFLINE         ^[[39m|^[[31m CRITICAL ^[[39m| 15         | 0000  00000000'00000000  0
 125 |^[[31m OFFLINE         ^[[39m|^[[31m CRITICAL ^[[39m| 6          | 0000  00000000'00000000  0
UAVCAN: TransferReceiver: Unexpected TID (current 7), prio=16 dtid=341 tt=2 snid=125 dnid=0 sot=1 eot=1 togl=0 tid=3 payload=[03 00 00 00 00 00 00] ts_m=122931.773438 ts_utc=1437004829.482837 iface=0

Device Driver and IO manager needs edge triggered and abstraction

To prevent 100% load in application using poll the device driver need to be re-worked to only raise events on poll for HW TX Empty And TX queue Not Empty for ACTIVE interfaces.

Since the UAVCAN io and multiplexing on the interfaces is handled internally by the io layer and the only interface the application has is to give UAVCAN cpu is spin_xxx there a violation of the encapsulation and abstraction needed by having the notion of interface choice and state managed by the application. There should be only one event used on the FD and it should only be set buy uavcan when the i/o layer can send or receive data.

POSIX storage backend for dynamic node ID allocation server fails to initialize if the directory doesn't exist

Discovered with Linux dynamic node ID allocation application: if the storage directory doesn't exist when the application is starting, the backend will create the directory and then fail. On the second attempt it always works fine.

Error: libuavcan/libuavcan_drivers/linux/apps/uavcan_dynamic_node_id_server.cpp:495: 0 <= storage_backend.init(persistent_storage_path.c_str())

@davids5 FYI.

Add uninstall script

The library can be installed with just one command, but removing it is not so easy. A script should be added to automate it.

@davids5

FirmwareUpdateTrigger.MultiNode TEST fail

Noncyclic error during tests. Usually appears after first build and following testing, but sometimes may not. Usually error comes up during only libuavcan_test_optim, but sometimes during others.

Last time also was combined with another Fail test - dynamic_node_id_server_NodeDiscoverer.RestartAndMaxAttempts, during libuavcan_test_cpp03.

Here are the log files after first build, where all the tests has failed - https://drive.google.com/open?id=0B9wE0Um8rdPgfmdUR1llZ2ZLMm9TVEw1ejE3eF9nRXJVZUJJQjVVWGlyWExkbUwyQUppYUU&authuser=0

Documentation out of sync with library

This commit:

2843c0a#diff-35b7a237998b2054ec6ba90c34a0490aL74

Changes the CAN ID field so that it no longer matches the documentation:

http://uavcan.org/CAN_bus_transport_layer_specification#CAN_ID_field

This image needs to be remade since it's easy to skim past text and would confuse people.

This has also made its way into the PX4 codebase:

  • Change was made on 2015-04-30 08:26:25 +0300
  • Current version in PX4/Firmware is 988e404 made on 2015-06-07 00:07:49 +0300

DSDL Actuator

The current actuator is for position control only. It might be useful to support other types (speed / torque controlled) actuators in the future. So I suggest renaming the actuator definition to indicate that they control position.

#If X==Y is true when both are not defined

We ran into an issues with some of PX4 code where the construct !If X==Y is true when both are not defined.

For example:

//#define PIGS 1
//#define DOGS 2

#if (DOGS == PIGS)
#warning("DOGS == PIGS") // it is to a compiler
#else
#warning "DOGS != PIGS"
#endif

When then built with -Wundef to ferret out any others:

warning: "UAVCAN_DEBUG" is not defined [-Wundef] UAVCAN_DEBUG
warning: "UAVCAN_MEM_POOL_BLOCK_SIZE" is not defined [-Wundef] UAVCAN_MEM_POOL_BLOCK_SIZE
warning: "UAVCAN_STM32_CHIBIOS" is not defined [-Wundef] UAVCAN_STM32_CHIBIOS
warning: "UAVCAN_STM32_TIMER_NUMBER" is not defined [-Wundef] UAVCAN_STM32_TIMER_NUMBER

@LorenzMeier asked me to 1) bring these to your attention to see if any of them are significant
and 2) see if the warnings can be remedied with an alternate construct of #if defined(XYZ) #if XYZ==PQT .... #endif #endif or such.

Thank you,

David

Can't build and install library

Hi guys,
I can't seem to succesfully build the UAVCAN library on my linuxmint vm. When following instructions

mkdir build
cd build
cmake .. # Default build type is RelWithDebInfo, which can be overriden if needed.
make
sudo make install

the cmake step failed. First I manually installed gtest like described here, which fixed the issue:
http://stackoverflow.com/questions/13513905/how-to-properly-setup-googletest-on-linux

Then, the make step fails consistently and I have no clue what to do now.

joop@yyy ~/libuavcan/build/libuavcan $ make
Running from the source directory
Traceback (most recent call last):
File "dsdl_compiler/libuavcan_dsdlc", line 59, in
from libuavcan_dsdl_compiler import run as dsdlc_run
File "/home/joop/libuavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/init.py", line 17, in module from uavcan import dsdl
ImportError: No module named uavcan
make[2]: *** [libuavcan/CMakeFiles/libuavcan_dsdlc] Error 1
make[1]: *** [libuavcan/CMakeFiles/libuavcan_dsdlc.dir/all] Error 2
make: *** [all] Error 2

I'm on kernel 3.13.0-37-generic
cmake version 2.8.12.2
python version 2.7

Because I was trying some stuff out on my new LPC11C24 board on Windows 7 x64 from LPCXpresso IDE, I cloned the uavcan into my workdir and followed these steps to get the example to compile: https://groups.google.com/forum/#!topic/uavcan/6-OG38bZDyE . The build fails with some errors:

/bin/env: python: No such file or directory

make: git: Command not found

even though I have a working version of Git installed on Windows and Python 3.4 is added to path var, plus I can verify python version from Git bash.

../../../libuavcan/include/uavcan/time.hpp:12:32: fatal error: uavcan/Timestamp.hpp: No such file or directory

Reoccurs for many other files. I understand the uavcan library is to be built and installed before Timestamp.hpp is generated. If there is any way I could program the board with uavcan on Windows that would be just as helpful.

Thanks in advance

Split the repository

This repository is going to be separated in three:

  • dsdl - for standard DSDL definition files.
  • libuavcan - the current one will be renamed into it. It will include dsdl and pyuavcan as git submodules.
  • pyuavcan - this will include dsdl as a git submodule.

Documentation at http://uavcan.org/ issue

From:
http://uavcan.org/Implementations/Libuavcan/Platforms/Linux/#uavcan_monitor
Section:
uavcan_dynamic_node_id_server
This application implements a dynamic node ID allocation server. Start without arguments to see usage info.

Usage info is crap, this is much better:

uavcan_dynamic_node_id_server 10 can0 -c1 -s .
where:
10 - node ID of the server
can0 - name of the interface
-c1 - cluster size is 1 (no replication, no redundancy)
-s . - keep the persistent state in the current directory
however it's better to make the -s argument absolute, e.g. ~ (your home dir)

Travis CI can't execute unit tests properly because the environment is not real time enough

#75 (comment)

@bendyer Nope, the build has just failed. There are actually two issues now:

  1. Unit tests are failing because of real-time issues.
  2. The build script redirects test outputs into log files, which are not accessible via Travis CI GUI.

A possible solution to 1 is to transition to the new container-based Travis CI infrastructure - they are promising this:

More available resources #
The new containers have 2 dedicated cores and 4GB of memory, vs 1.5 cores and 3GB on our legacy infrastructure. CPU resources are now guaranteed, which means less impact from ‘noisy neighbors’ on the same host machine and more consistent build times throughout the day.

If that doesn't work, we'll have to resort to conditional disabling of real time tests.

As for 2, the build script has to detect when it's running on Travis CI, and conditionally disable unit test output redirection (I hope Travis can handle build outputs with ~30k lines). A possible solution is to add a CMake variable like CONTINUOUS_INTEGRATION_BUILD that will be set in .travis.yml. The same variable could also be used to implement the second part of the first solution, if need arises.

Acceptance filters cannot be used with SocketCAN driver

...because the driver relies on TX loopback for purposes of TX queue maintenance, and SocketCAN applies acceptance filters both to regular RX frames and to TX loopback frames. Therefore, if acceptance filters are configured, the driver may lose loopback frames, which breaks the TX queue.

Possible solutions:

  • Use a second socket for RX frames.
  • Implement acceptance filtering in user space.

@ilia-sheremet FYI

Clang build error on OS X

Build of b09509c fails on OS X 10.10.4 with the version of clang/LLVM bundled with Xcode 6.4:

MacBook-Pro:build bendyer$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
Thread model: posix

Error is:

MacBook-Pro:build bendyer$ make
Running from the source directory
[  0%] Built target libuavcan_dsdlc
[  3%] Building CXX object libuavcan/CMakeFiles/uavcan.dir/src/protocol/uc_node_status_provider.cpp.o
In file included from /Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/src/protocol/uc_node_status_provider.cpp:5:
In file included from /Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/include/uavcan/protocol/node_status_provider.hpp:15:
In file included from /Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/include/dsdlc_generated/uavcan/protocol/GetNodeInfo.hpp:16:
/Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/include/dsdlc_generated/uavcan/protocol/HardwareVersion.hpp:159:19: error: use of overloaded operator '==' is ambiguous (with operand types
      'const typename ::uavcan::StorageType<typename FieldTypes::unique_id>::Type' (aka 'const uavcan::Array<uavcan::IntegerSpec<8, 0, 0>, 0, 16>') and 'const typename ::uavcan::StorageType<typename FieldTypes::unique_id>::Type')
        unique_id == rhs.unique_id &&
        ~~~~~~~~~ ^  ~~~~~~~~~~~~~
/Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/src/protocol/uc_node_status_provider.cpp:145:37: note: in instantiation of member function 'uavcan::protocol::HardwareVersion_<0>::operator==' requested here
    if (node_info_.hardware_version == protocol::HardwareVersion())
                                    ^
/Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/include/uavcan/marshal/array.hpp:764:5: note: candidate function [with R = uavcan::Array<uavcan::IntegerSpec<8, 0, 0>, 0, 16>]
    operator==(const R& rhs) const
    ^
/Users/bendyer/Projects/ARM/workspace/libuavcan/libuavcan/include/uavcan/marshal/array.hpp:1090:13: note: candidate function [with R = uavcan::Array<uavcan::IntegerSpec<8, 0, 0>, 0, 16>, T = uavcan::IntegerSpec<8, 0, 0>, ArrayMode = 0, MaxSize = 16]
inline bool operator==(const R& rhs, const Array<T, ArrayMode, MaxSize>& lhs)
            ^
1 error generated.
make[2]: *** [libuavcan/CMakeFiles/uavcan.dir/src/protocol/uc_node_status_provider.cpp.o] Error 1
make[1]: *** [libuavcan/CMakeFiles/uavcan.dir/all] Error 2
make: *** [all] Error 2

The same version builds fine on Ubuntu with GCC 4.9.1:

/mnt/hgfs/workspace/libuavcan/build$ gcc --version
gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Proper file IO loops

UAVCAN in JAVA?

Hello All.
There are implementations of UAVCAN in JAVA?

Thank you.
Andrew.

Flash and RAM size optimization

@pavel-kirienko For a communication library like UAVCAN I would have expected -Os as the default optimisation level - is there a particular reason its -O3? How can I change this to -Os for the PX4 build?

Service invocation response cannot be empty

I tried using the following message, which results in a static assert failing:

float16 test

---

Changing it to the following fixed the problem.

float16 test

---
float16 dummy

I did not see anything preventing service invocation response from being empty in the spec. If this is intended, it should be added to the documentation and it would be nice if the DSDL compiler displayed an error / warning.

Missing file uavcan/Timestamp.hpp

Looks like one of the missing file is missing. We try to compile UAVCAN libraries but Timestamp.hpp file is missing from repository. Please check that all files are correct. Timestamp.hpp is included from uavcan/time.hpp file.

POSIX tools refactoring

@davids5 I reviewed the firmware file management logic in the POSIX tools module, and introduced some style fixes and comments. I believe the classes FirmwareCommon and FirmwareTools should be removed, and their logic should be moved inside FirmwareVersionChecker. Please see the TODO comments I placed in the code.

Thanks!

Remove dependency on std::auto_ptr in unit tests

std::auto_ptr<> has been removed from newer versions of STL.

It should be noted that its replacement to newer means of automatic memory management will break the C++03 unit tests. Perhaps the affected tests should be disabled for the C++03 mode. The resulting lack of coverage should be tolerable, especially considering my intention to drop the support for C++03 at some point in the future.

libuavcan for C2000 - "C"

Good afternoon All.
I have a project of the Motor Controller at C2000 with InstaSpin FOC. Tell me where to start to make UAVCAN. I have the project on a ANSI "C"(only). Now I have realized CANOpen (CANFestival). I want to make my drone. Did not choose where to change to add UAVCAN to the controller or CANOpen in ArduPilot.

Thank you
Andrew.

Baremetal STM32 driver is broken

We'll probably drop the baremetal support completely unless somebody submits an easy fix soon. The problem is that the file chip.h is missing, possibly something else.

some headers may be missing in uavcan/protocol/

uavcan/protocol/data_type_info_provider.hpp:
...

include <uavcan/protocol/ComputeAggregateTypeSignature.hpp>

include <uavcan/protocol/GetDataTypeInfo.hpp>

....
other files in this folder also refer to non-existing includes.
I can`t build px4 firmware project
Или я делаю что-то не так?

False warning from GCC in uavcan::Array<>

Discovered by @NosDE with ARM GCC 4.8.4.

/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/marshal/array.hpp:382:26: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op]
             if ((sz > 0) && ((sz - 1u) > (MaxSize_ - 1u))) // -Werror=type-limits
                          ^

Full report:

%  MODULE_WORK_DIR     = /Users/marco/src/px4/firmware/Firmware/Build/px4fmu-v2_default.build//Users/marco/src/px4/firmware/Firmware/src/modules/uavcan
CXX:     /Users/marco/src/px4/firmware/Firmware/src/modules/uavcan/uavcan_configuration.cpp
In file included from /Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/marshal/types.hpp:9:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:13,
                 from /Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/time.hpp:11,
                 from /Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/uavcan.hpp:10,
                 from /Users/marco/src/px4/firmware/Firmware/src/modules/uavcan/uavcan_configuration.hpp:46,
                 from /Users/marco/src/px4/firmware/Firmware/src/modules/uavcan/uavcan_configuration.cpp:41:
/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'int uavcan::Array<T, ArrayMode, MaxSize_>::decodeImpl(uavcan::ScalarCodec&, uavcan::TailArrayOptimizationMode, uavcan::TrueType) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 255u; uavcan::TrueType = uavcan::BooleanType<true>]':
/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/marshal/array.hpp:528:74:   required from 'static int uavcan::Array<T, ArrayMode, MaxSize_>::decode(uavcan::Array<T, ArrayMode, MaxSize_>::SelfType&, uavcan::ScalarCodec&, uavcan::TailArrayOptimizationMode) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 255u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 255u>]'
dsdlc_generated/uavcan/protocol/HardwareVersion.hpp:237:109:   required from 'static int uavcan::protocol::HardwareVersion_<_tmpl>::decode(uavcan::protocol::HardwareVersion_<_tmpl>::ReferenceType, uavcan::ScalarCodec&, uavcan::TailArrayOptimizationMode) [with int _tmpl = 0; uavcan::protocol::HardwareVersion_<_tmpl>::ReferenceType = uavcan::protocol::HardwareVersion_<0>&]'
dsdlc_generated/uavcan/protocol/GetNodeInfo.hpp:346:109:   required from 'static int uavcan::protocol::GetNodeInfo_::Response_<_tmpl>::decode(uavcan::protocol::GetNodeInfo_::Response_<_tmpl>::ReferenceType, uavcan::ScalarCodec&, uavcan::TailArrayOptimizationMode) [with int _tmpl = 0; uavcan::protocol::GetNodeInfo_::Response_<_tmpl>::ReferenceType = uavcan::protocol::GetNodeInfo_::Response_<0>&]'
/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/node/generic_subscriber.hpp:249:62:   required from 'bool uavcan::GenericSubscriber<DataSpec, DataStruct, TransferListenerType>::decodeTransfer(uavcan::IncomingTransfer&) [with DataSpec = uavcan::protocol::GetNodeInfo_; DataStruct = uavcan::protocol::GetNodeInfo_::Response_<0>; TransferListenerType = uavcan::ServiceResponseTransferListener<357u>]'
/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/node/generic_subscriber.hpp:266:32:   required from 'void uavcan::GenericSubscriber<DataSpec, DataStruct, TransferListenerType>::handleIncomingTransfer(uavcan::IncomingTransfer&) [with DataSpec = uavcan::protocol::GetNodeInfo_; DataStruct = uavcan::protocol::GetNodeInfo_::Response_<0>; TransferListenerType = uavcan::ServiceResponseTransferListener<357u>]'
/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/node/generic_subscriber.hpp:148:13:   required from 'void uavcan::GenericSubscriber<DataSpec, DataStruct, TransferListenerType>::TransferForwarder::handleIncomingTransfer(uavcan::IncomingTransfer&) [with DataSpec = uavcan::protocol::GetNodeInfo_; DataStruct = uavcan::protocol::GetNodeInfo_::Response_<0>; TransferListenerType = uavcan::ServiceResponseTransferListener<357u>]'
/Users/marco/src/px4/firmware/Firmware/src/modules/uavcan/uavcan_configuration.cpp:545:1:   required from here
/Users/marco/src/px4/firmware/Firmware/src/lib/uavcan/libuavcan/include/uavcan/marshal/array.hpp:382:26: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op]
             if ((sz > 0) && ((sz - 1u) > (MaxSize_ - 1u))) // -Werror=type-limits
                          ^
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
make[2]: *** [uavcan_configuration.cpp.o] Error 1
make[1]: *** [/Users/marco/src/px4/firmware/Firmware/Build/px4fmu-v2_default.build//Users/marco/src/px4/firmware/Firmware/src/modules/uavcan/module.pre.o] Error 2
make: *** [/Users/marco/src/px4/firmware/Firmware/Build/px4fmu-v2_default.build/firmware.px4] Error 2

A quick-hack solution would be to detect GCC compiler in the array.hpp file and disable the logical-op warning.

Messages never completed during heavy CPU load

I have a problem where complete messages are not sent during heavy CPU load on small, embedded computers such as Raspberry Pi and BeagleBone Black running Debian. The CAN bus is at 1Mbps and works very well until I put a heavy load on the CPU.

I create an almost empty "gnss fix" message and publishing it every second. Here is the relevant code running on the embedded computer:

while (true)
    {
        static int i = 0;
        uavcan::equipment::gnss::Fix msg;

        msg.lat_1e7 = i;
        pub->broadcast(msg);
        cout << msg << endl;

        i++;
        sleep(1);

    }

Using another computer I monitor the CAN bus with candump. When there is no CPU load, I get the following message, which is correctly formed:

  can0  09648403   [8]  0A E0 00 00 00 00 00 00
  can0  09648413   [8]  00 00 00 00 00 00 00 00
  can0  09648423   [8]  00 00 13 00 00 00 00 00
  can0  09648433   [8]  00 00 00 00 00 00 00 00
  can0  0964844B   [3]  00 00 00

Here is an example of two incomplete messages sent from the embedded computer during heavy CPU load:

  can0  09648404   [8]  A4 92 00 00 00 00 00 00
  can0  09648414   [8]  00 00 00 00 00 00 00 00
  can0  09648424   [8]  00 00 14 00 00 00 00 00

  can0  09648405   [8]  46 82 00 00 00 00 00 00
  can0  09648415   [8]  00 00 00 00 00 00 00 00
  can0  09648425   [8]  00 00 15 00 00 00 00 00
  can0  09648435   [8]  00 00 00 00 00 00 00 00

Only the first 3 or 4 frames of each message are sent.

During heavy CPU load, are the frames being buffered and then timing out? I remember seeing buffer and timeout parameters when I glanced through the code.

Multithreading in libuavcan

The library should support handover of low-priority processing, such as file management and dynamic node ID allocation, to a dedicated low-priority thread.

Memory footprint is large

See Summary here

Things that did not work:

-Os and -flto

** UPDATE -0s causes the debugger not to load the file ** So it is of no value


Distributed

text data bss dec hex filename
892504 2712 35464 930680 e3378 Build/px4fmu-v2_default.build/firmware.elf

147 uavcan 5545 3.282 2856/ 3380 240 (240) w:sem

Centralized
text data bss dec hex filename
871560 2712 35352 909624 de138 Build/px4fmu-v2_default.build/firmware.elf

156 uavcan 568 2.852 2856/ 3380 240 (240) w:sem

Centralized save 20K of FLASH but ONLY 112 Bytes of RAM?

The impact on SRAM is > 42K and 20,800 bytes larger than mater.

nsh> free
total used free largest
Mem: 223600 168608 54992 51536
nsh> uavcan start
uavcan: Node ID 12, bitrate 1000000
uavcan: SW version vcs_commit: 0xa1596614
uavcan: sensor bridge 'gnss' init ok
uavcan: sensor bridge 'mag' init ok
uavcan: sensor bridge 'baro' init ok
nsh> free
total used free largest
Mem: 223600 210352 13248 7952

SRAM cost 43584 bytes to use uavcan with Node allocation and firmware distribution

Using the Node allocation and firmware distribution costs as compared to master

43K of flash 2480 Bytes SRAM and over Master @ 5c53d38652dc6c97e216ea6b70215a95890df572
text data bss dec hex filename
827240 2948 32872 863060 d2b54 Build/px4fmu-v2_default.build/firmware.elf

nsh> free
total used free largest
Mem: 225392 168080 57312 56064
nsh> uavcan start
uavcan: Node ID 12, bitrate 1000000
uavcan: SW version vcs_commit: 0x5c53d386
uavcan: sensor bridge 'gnss' init ok
uavcan: sensor bridge 'mag' init ok
uavcan: sensor bridge 'baro' init ok
nsh> free
total used free largest
Mem: 225392 193216 32176 28752

SRAM cost 27312 bytes to use uavcan

Fix spin()

Fix the spin() logic so it doesn't return until all the incoming frames are processed. There should be also a parameter for changing this behavior back to the current (handle just one frame per call).

Mentioning @davids5 to keep him in the loop.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.