Skip to content

Add CAN support to nRF54H20 #1757

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

Merged
merged 27 commits into from
Jun 4, 2024
Merged

Add CAN support to nRF54H20 #1757

merged 27 commits into from
Jun 4, 2024

Conversation

gmarull
Copy link
Member

@gmarull gmarull commented May 31, 2024

No description provided.

@NordicBuilder
Copy link
Contributor

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_nordic zephyrproject-rtos/hal_nordic@a3aacc7 zephyrproject-rtos/hal_nordic@fc02d66 (master) zephyrproject-rtos/[email protected]

Note: This message is automatically posted and updated by the Manifest GitHub Action.

gmarull and others added 9 commits June 4, 2024 09:57
…um version"

This reverts commit c4c30c3.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
…F54 DKs"

This reverts commit 58f7829.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
This reverts commit eb71554.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Clock control for MAX32690

Co-authored-by: Okan Sahin <[email protected]>
Signed-off-by: Sadik Ozer <[email protected]>
(cherry picked from commit 45df896)
Adds 8bit support in SAADC hal.

Signed-off-by: Karol Lasończyk <[email protected]>
(cherry picked from commit 64de50f)
Define HFXO (High Frequency Crystal Oscillator). This clock is managed
by system controller, from an application point of view it is a fixed
clock.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit b88a1f7)
Add a new binding for the AUXPLL IP found in some new Nordic SoCs, e.g.
nRF54H20.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit eaeebf1)
Define CANPLL, an AUXPLL IP instance used by the CAN IP. PLL settings
are hardcoded in SoC files, as this PLL should not be configured by the
application. It is meant to always run at 80 MHz.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 8e46f3c)
So that we have access to AUXPLL HAL APIs.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit c0163e9)
gmarull and others added 18 commits June 4, 2024 09:57
Add a new driver for the AUXPLL peripheral found in some new Nordic
SoCs, e.g. nRF54H20. AUXPLL is used to clock some peripherals like e.g.
CAN. Note that driver is implemented natively as Nordic HAL lacks
definitions for the AUXPLL IP, this may be changed once these become
available.

Note that usage of nrf_auxpll_config_set generates unnecessary extra
assembly code compared to the proposed API in
zephyrproject-rtos/hal_nordic#185 which
guarantees static initialization and single write access, possible in
the Zephyr context. However, current solution has been enforced until
further discussion on raw access APIs takes place.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 47e14db)
This patch adds a timeout to the clock_control_on() implementation. The
reason for this timeout is to prevent system freezes when the PLL is
configured incorrectly, or, if BICR is wrong. The locking time of the
AUXPLL is <30us, however, when it starts it also starts other
dependencies which take much longer to become ready. The locking time
has been experimentally measured to be around 2ms, so a 10x bound has
been added.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 71dcbdd)
…ngth is 0

can_mcan_send/can_mcan_get_message issued a message ram write/read even
when data length was 0. This caused some issues on systems where data
cache is enabled, because the cache invd/flushing calls present in the
mcan driver can fail if provided length is 0.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit e2f8f5b)
>=5.3.0 is required for proper CAN support.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 7ff30b6)
Add binding for Nordic CAN peripheral, based on the Bosch MCAN IP.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 955f720)
Define CAN120 instance.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 8f27e49)
Configure CAN120 MCAN core registers as non-cachable to prevent D-Cache
from inhibiting volatile accesses to the CAN120 MCAN registers. Also
apply non-cachable attribute to the message ram region. Even though the
MCAN driver handles cache invalidation/flushing, MPU faults are still
triggered (to be investigated).

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 3731a13)
So that we can configure CAN pins.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 0d4d4e7)
Add driver for the Nordic CAN peripheral, based on Bosch MCAN IP.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit cdcb055)
Enable canpll (required to clock CAN), and can120 instance, routed to
pins P9.4 and P9.5.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit c0b0443)
…ding

Zerorise the CAN frame before filling in data to ensure all data bytes are
initialized.

Fixes: #73309

Signed-off-by: Henrik Brix Andersen <[email protected]>
(cherry picked from commit fb4f67b)
… not bytes

Print the raw DLC when enqueuing a CAN frame for sending, not the
corresponding number of bytes.

Fixes: #73309

Signed-off-by: Henrik Brix Andersen <[email protected]>
(cherry picked from commit 6a070ee)
Include the device name when printing received CAN frames. This improves
the user experience when working with multiple CAN controllers via the CAN
shell.

Signed-off-by: Henrik Brix Andersen <[email protected]>
(cherry picked from commit 88fb5e2)
…printing CAN frames

Optionally bypass the shell when printing received CAN frames in order not
to break up the line containing the frame. This allows for parsing the
printed CAN frames using Twisters pytest and console harnesses with the
cost of the shell ignoring input while the frame is being printed.

Signed-off-by: Henrik Brix Andersen <[email protected]>
(cherry picked from commit c4c6960)
Add test suite using python-can for testing Controller Area Network (CAN)
communication between a host PC and a device under test running Zephyr.

Signed-off-by: Henrik Brix Andersen <[email protected]>
(cherry picked from commit 127cb9e)
… match

Require the presence of the nrf-regtool package as well as its exact
version, failing the build whenever the required version is not found in
the system.

Upstream PR: zephyrproject-rtos/zephyr#69633

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit 0e010fbcb2b23a6b860198fd4152ca092d397f9e)
Adds support for first possible LED to be connected with HW PWM.

Upstream PR: zephyrproject-rtos/zephyr#72010
Applied as noup, did not apply cleanly

Signed-off-by: Karol Lasończyk <[email protected]>
Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit 58f7829)
This adds temporary entropy driver simulation for
nRF54h20 device since final entropy source is not
available yet.

TODO: Remove this commit when proper solution will
be available.

Jira: NCSDK-25947

Signed-off-by: Kamil Gawor <[email protected]>
Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit c976657)
(cherry picked from commit e2b6a2d)
(cherry picked from commit eb71554)
@gmarull gmarull merged commit de7a6f8 into nrfconnect:main Jun 4, 2024
16 checks passed
@gmarull gmarull deleted the add-can branch June 4, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants