Skip to content
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

Update adc driver to support nRF54H20 #1496

Open
wants to merge 2,330 commits into
base: main
Choose a base branch
from

Conversation

kl-cruz
Copy link
Contributor

@kl-cruz kl-cruz commented Feb 13, 2024

Work done ahead of #1494
To be rebased when nRF54L15 merged.
GPIO pin owner configuration generation to UICR not included - needed to use pin as analog input.

Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noup patches need to be upstreamed, some miss better explanation 9b67f02

martintv and others added 23 commits June 21, 2024 17:24
Time it takes to "erase" one "page" of rram is too low.
Where getting timeouts.
"erase" of rram is done by writing all the words.
one "page" is 4096 bytes meaning 1024 32bit words.
worstcase time it takes to write one 32bit word from
0x00000000 to 0xffffffff is about 42us, giving 42ms
to write 1024 words.

Upstream PR: zephyrproject-rtos/zephyr#74589

Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
(cherry picked from commit 11599b2c52da541ae1bb7c1e8c41aeddbc3aa855)
Fixes an issue in the code that processes the output file of a
compiler to see which files should be watched, the compiler can
combine multiple files into a single line instead of putting them
each on separate lines if the length of the file paths is short,
therefore account for this and split it up into multiple elements

Upstream PR: zephyrproject-rtos/zephyr#74655

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes and simplifies the handling of how the dts watch file is
processed

Upstream PR: zephyrproject-rtos/zephyr#74655

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This reverts commit 33786b5.

Reverting it because the upstream PR has been abandoned, and
this extra CMake variable is causing the warning
"Manually-specified variables were not used by the project".

As of now the version warning doesn't come up.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
(cherry picked from commit 2c57519)
…to RFC2131

DHCP Request retransmission in RENEW and REBIND states was not
compliant with RFC2131.

The retransmission interval should not be calculated as in REQUESTING
state in such case, but rather calculated based on the remaining T2
or lease time (depending on current state).

RFC doesn't also mention any retransmission count limit for those
states. The client should retransmit the REQUEST until T2 or lease
expiry time are reached.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 4d4391b)
In case no Renewal/Rebinding times have been provided the server via
DHCP options, we should reset their values on ACK, so that the client
can recalculate the defaults. This is important, as the lease time may
change, so we should recalculate default T1/T2 timeout based on the new
lease time value.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 0d3a021)
There were two errors in calculations of LFXO INTCAP code:
- The value provided by DTS files is internal desired capacitance.
  The value from DTS has to be "encoded" before use in INTCAP
  calculations formula. The formula for encoding is:
  CAPACITANCE_CODE = (<desired_value> - 4pF) / 0.5
  Subtract of 4 is related with lowest value in the allowed range.
  Division by 0.5 is related with change to steps size.
  In former code the subtration of 4pF was missing.

- The mid_val calcuation was wrong due offset_k left shift by 4.
  It should be left shift by 3 to get total left shift of 9.
  That matches the left shift of former part of the equation.
  Final integer value was calculated by right shift 10, it should
  be right shift 9. Then rounding was done by use of mod by (1 << 10)
  It should be mod by (1 << 9) and compared with (1 << 8), that is
  half of 0-512 range.

Upstream PR: zephyrproject-rtos/zephyr#74668

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
…ng error

The implementation of formula, to calculate HFXO INTCAP code,
had a rounding error. That may lead so small deviation of HFXO
clock accuracy.

The IPS formula uses capacitance values in piko Fartd units.
That requires use of floating point data types. To avoid that
implementation of the formula uses femto Farats (1000 smaller unit).

In the former implementation conversion from femto Farad to piko Farad
was done just after reading of the desired capacitance from DTS.

To make sure the calculations are correct the change of unit must be
done at very end. Also rounding must be applied.

Also the formula was split and more comments were added to make the
implementation clear.

The commit fixes the implementation of the IPS formula.

Upstream PR: zephyrproject-rtos/zephyr#74668

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
…r nRF54L

There was an error in calculation of LFXO INTCAP code that prevented
obtaining desired XTAL accuracy below 50PPM. The error was fixed
the accuracy should be within expected range.

Upstream PR: zephyrproject-rtos/zephyr#74668

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
…e beacon server

Commit add extension of configuration server by private
beacon server.
Mesh Protocol v1.1 specification
4.4.11.1
The Mesh Private Beacon Server model is a main model
that extends the Configuration Server model.

Configuration server and private beacon server shall always
exist together since they have bound states.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
(cherry picked from commit 3e2b44a)
…rver

Commit add extension of configuration server by large
composition data server.
Mesh Protocol v1.1 specification
4.4.21.1
The Large Composition Data Server is a main model
that extends the Configuration Server model.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
(cherry picked from commit f9d7385)
Turn off suspending MRAM for NRF54H20 DK
This change is required so sections of code
depending on critical timings will not have unacceptable latency.

Signed-off-by: Jan Zyczkowski <jan.zyczkowski@nordicsemi.no>
To match used loopbacks.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
(cherry picked from commit 456fed3)
At least for nrf boards, the emulation timer settings generate
reading around -60 degrees. Verify that value with some threshold.

Delay the first reading to prevent 0 at the beginning.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
(cherry picked from commit 6898f93)
…ted by cpuppr

Extend Twister configuration for nrf54h20dk/nrf54h20/cpuppr.
Add counter and i2c to the list of supported peripherals.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
(cherry picked from commit b99cf9f)
nrf-squash! [nrf noup] boards: nordic: Turn off MRAM suspend for NRF54H20 DK
Turn on NRFS globally so turning off
suspending MRAM for NRF54H20 DK will work.

Signed-off-by: Jan Zyczkowski <jan.zyczkowski@nordicsemi.no>
nrf-squash! [nrf noup] boards: nordic: Turn on NRFS globally

Signed-off-by: Jan Zyczkowski <jan.zyczkowski@nordicsemi.no>
…vice

Expands driver to cover nRF54L15 features like AIN as GPIO configuration,
new reference voltage, different set of supported gain options.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
(cherry picked from commit 5f1fdc4)
…vice

Expands driver to cover nRF54H20 features like 8bit sample width.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
(cherry picked from commit 13196ec)
Adds full description of the adc node and support for memory regions.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
(cherry picked from commit 15fa37d)
Adds configuration to play with nRF54H20 PDK board.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
(cherry picked from commit 3c4ea76)
Adds configuration for making tests work.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
(cherry picked from commit ba30517)
Enables adc node to make it usable in tests/examples.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
(cherry picked from commit a04b2ad)
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.