-
Notifications
You must be signed in to change notification settings - Fork 205
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
Backport all CAN-related changes from upstream NuttX #186
base: px4_firmware_nuttx-10.1.0+
Are you sure you want to change the base?
Backport all CAN-related changes from upstream NuttX #186
Conversation
Adds an FDCAN driver for STM32H7 MCUs using the SocketCAN interface
Note that pinmap.h, irq.h, fdcan.h still need to be updated with proper register definitions for the FDCAN3 peripheral present in STM32H7[2|3][3|5] MCUs
This file is used by the libcanutils and can be isolated in apps Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
…k free MBs CAN_ESR2 register was having problems of havng the correct values when the bus was busy (with 3 and more nods). The register bit fields were incorrectly indicating that there is no free MB and would not updated itself from this state which was causing the applications to freeze on write. This change relies only on a software control which should avoid the problems described above. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit adds option for Teensy 4.x board to initialize CAN3 as can0. The reason of this is the CAN FD capability of CAN3. This commit also disables tickless mode support for pikron-bb configuration as this option started causing hard faults which are yet to be solved. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
…ect scope of variable
…only those connections that are bound to the device. tcp_timer: eliminated false decrements of conn->timer in case of multiple network adapters. The false timer decrements sometimes provoked TCP spurious retransmissions due to premature timeouts.
based on PR #2987
…or compatibility with libcanutils
remove the psock back reference since timestamp has been migrated to can_conn_s Signed-off-by: chao.an <anchao@xiaomi.com>
by fixing filter initialization. STM32F7 CAN3 works in single peripheral configuration and there is only 14 filter banks: 0-13. Previously not available 14 indexed filter (CAN_NFILTERS/2) was wrongly used for for receiving to FIFO. Now zero indexed filter is correctly used instead.
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
be60696
to
e596450
Compare
This reverts commit 9ce3fab. PR reference: apache/nuttx#5467 In order for this commit to be valid, the following other PRs must also be back-ported first: - apache/nuttx#5434 Additional PRs that fix related bugs: - apache/nuttx#5462 - apache/nuttx#5466
Point to the branch of PX4/NuttX#186 Adds SocketCAN drivers for all STM32 targets Includes other fixes and improvements to CAN drivers in NuttX
You might want to backport this patch as well. We could also consider upgrading the NuttX kernel in general. |
I have a similar branch compiling against NuttX 10.3; I'm a little concerned about that route, though, just based on the amount of churn / rapid changes to upstream NuttX. |
I could not agree more. |
Although I agree with rapid changes and poor QA control in upstream NuttX. Furthermore right now we can build PX4 with both upstream NuttX (10.3+) and PX4 NuttX (10.1+), which is perfect to do some A/B testing and addressing the issues we encounter to Apache/incubator-nuttx. |
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
CC: modlib/modlib_depend.c "modlib/modlib_bind.c", line 741: warning #186-D: pointless comparison of unsigned integer with zero if (rel->r_offset < 0) ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
"ioexpander/gpio.c", line 529: warning #186-D: pointless comparison of unsigned integer with zero if (pintype < GPIO_INPUT_PIN || pintype >= GPIO_NPINTYPES) ^ Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Summary
Extension of #185 to include all CAN related development from upstream NuttX beyond PX4's forked 10.1.0+ version.
Open to discussion on how many of these changes we'd like to backport, and how many we'd prefer to leave out. For now, I tried to backport everything that touched PX4-supported CAN drivers or the SocketCAN layer.
Impact
Adds the following features / fixes:
Testing
None yet