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

Rx f low #20731

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Rx f low #20731

wants to merge 6 commits into from

Conversation

mif1-nordic
Copy link
Contributor

depends on #20602

@mif1-nordic mif1-nordic requested review from a team as code owners March 4, 2025 15:37
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 4, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Mar 4, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 27

Inputs:

Sources:

sdk-nrf: PR head: 0720d3ca57c60bb813d4f8e14826b7e827c071f2

more details

sdk-nrf:

PR head: 0720d3ca57c60bb813d4f8e14826b7e827c071f2
merge base: 1d5fa93d98afc9d70656ac6b9311f01180d94a46
target head (main): 762492f3d6d86efb602182ce86ce21a3be588260
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (8)
applications
│  ├── sdp
│  │  ├── mspi
│  │  │  ├── boards
│  │  │  │  │ nrf54l15dk_nrf54l15_cpuflpr.overlay
│  │  │  ├── src
│  │  │  │  ├── hrt
│  │  │  │  │  ├── hrt-nrf54l15.s
│  │  │  │  │  ├── hrt.c
│  │  │  │  │  │ hrt.h
│  │  │  │  │ main.c
drivers
│  ├── mspi
│  │  │ mspi_nrfe.c
include
│  ├── drivers
│  │  ├── mspi
│  │  │  │ nrfe_mspi.h
snippets
│  ├── sdp
│  │  ├── mspi
│  │  │  ├── soc
│  │  │  │  │ nrf54l15_cpuapp.overlay

Outputs:

Toolchain

Version: 4ffa2202d5
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:4ffa2202d5_e579f9fbe6

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 42
  • ✅ Integration tests
    • ✅ test-low-level
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

Copy link

github-actions bot commented Mar 4, 2025

You can find the documentation preview for this PR here.

@masz-nordic masz-nordic added this to the 3.0.0 milestone Mar 6, 2025
@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 6 times, most recently from 3b6d9cf to 3a72ed1 Compare March 11, 2025 08:57
@mif1-nordic mif1-nordic mentioned this pull request Mar 11, 2025
@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 6 times, most recently from 7d6bc30 to 27c9038 Compare March 12, 2025 15:05
@mif1-nordic mif1-nordic requested a review from a team as a code owner March 12, 2025 15:05
@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 2 times, most recently from 22b33e4 to 3970be6 Compare March 13, 2025 12:01
@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 2 times, most recently from 3d7957c to 2499e70 Compare March 13, 2025 13:46
Copy link
Contributor Author

@mif1-nordic mif1-nordic left a comment

Choose a reason for hiding this comment

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

reviewed during meeting

@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 2 times, most recently from 5278151 to 6b7ac9f Compare March 17, 2025 16:39
@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 2 times, most recently from 2b7e509 to f160adf Compare March 18, 2025 08:22
@@ -96,6 +96,7 @@ typedef struct {

typedef struct {
nrfe_mspi_opcode_t opcode; /* Same as application's request. */
uint32_t reserved : 24; /* Reserved in order to align data to 32 bits. */
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this will work correctly without the __packed attribute on every compiler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed opcode to be uint32_t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cnahged nrfe_mspi_opcode_t size to 32 bits

@@ -731,7 +745,7 @@ static int nrfe_mspi_init(const struct device *dev)
.callback = flpr_fault_handler,
.user_data = NULL,
.flags = 0,
.ticks = counter_us_to_ticks(flpr_fault_timer, CONFIG_MSPI_NRFE_FAULT_TIMEOUT)
.ticks = counter_us_to_ticks(flpr_fault_timer, CONFIG_MSPI_NRFE_FAULT_TIMEOUT),
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use auto formatting on the whole file. Only use it on the parts of the file that you have changed.
-> The rule is to not add such unnecessary changes to the PR. In the long run it disrupts/makes it harder to merge the whole file with the code of others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 98 to 99
nrfe_mspi_opcode_t opcode; /* Same as application's request. */
unsigned reserved : 24; /* Reserved to ensure proper alignment of data field. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nrfe_mspi_opcode_t opcode; /* Same as application's request. */
unsigned reserved : 24; /* Reserved to ensure proper alignment of data field. */
nrfe_mspi_opcode_t opcode : 32; /* Same as application's request. */

What about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this does not compile

Copy link
Contributor

@jaz1-nordic jaz1-nordic Mar 19, 2025

Choose a reason for hiding this comment

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

I confirm, it does not compile due to the added short-enums compiler flag. Another solution is to use a union. This is a transparent solution, and it causes the field size to be correct and the data is shifted by 32 bits.

typedef struct {
union {
nrfe_mspi_opcode_t opcode; /* Same as application's request. */
unsigned : 32;
};
uint8_t data;
} nrfe_mspi_flpr_response_msg_t;

But I think the least intrusive thing to do would be to simply add the value NRFE_MSPI_OPCODES_MAX = 0xFFFFFFFF at the end of nrfe_mspi_opcode_t, which would force the enum size to 32bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed using this solution: NRFE_MSPI_OPCODES_MAX = 0xFFFFFFFF

@mif1-nordic mif1-nordic force-pushed the rx_fLow branch 2 times, most recently from dac73d9 to de9df28 Compare March 19, 2025 09:15
/* This is to avoid writing outside of data buffer in case when buffer_length%4 !=
* 0.
*/
switch (NRFX_CEIL_DIV(last_word_bits - penultimate_word_shift, BITS_IN_BYTE)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed switch to for

if ((penultimate_word_shift != 0) && (i > 1)) {
penultimate_word = data[i - 2];

penultimate_word = (penultimate_word >> (penultimate_word_shift)) |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
penultimate_word = (penultimate_word >> (penultimate_word_shift)) |
penultimate_word = (penultimate_word >> penultimate_word_shift) |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 258 to 262
uint32_t last_word = 0;
uint32_t penultimate_word = 0;
uint16_t prev_out = 0;
uint16_t cnt0 = 0;
uint16_t cnt0_prev = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be only declared here and defined later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


/* Wait for reception to end, transfer has to be stopped "manualy".
* Setting SHIFTCTRLB cannot be used because with RTPERIPHCTRL:STOPCOUNTERS == 1,
* counter stops 1 clock to early.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* counter stops 1 clock to early.
* counter stops 1 clock too early.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 27 to 28
#define STD_PAD_BIAS_CNT0_THRESHOLD 1 /* 32MHz */
#define RX_CNT0_MIN_VALUE 2 /* 21.333333MHz */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments describing those defines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can limit the max possible freq to 21 MHz on the APP side, but can be left as is for now.

memcpy((void *)packet->data_buf, (void *)ipc_receive_buffer, ipc_received);
if (packet->dir == MSPI_RX) {
#ifdef CONFIG_MSPI_NRFE_IPC_NO_COPY
/* Not aligned buffer. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please describe in comment how this is different from alignment done above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 27 to 28
#define STD_PAD_BIAS_CNT0_THRESHOLD 1 /* 32MHz */
#define RX_CNT0_MIN_VALUE 2 /* 21.333333MHz */
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can limit the max possible freq to 21 MHz on the APP side, but can be left as is for now.

Copy link
Contributor

@magp-nordic magp-nordic left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just the recent changes need to be pushed.

Modified hrt rx flow to use write function for command,
address and dummy cycles. Modified Rx function to work
in 32 bit mode instead of 8 bit.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Modified return buffer alignment.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Added no copy functionality to RX.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Added no copy functionality to RX.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Increased partition size for flipper code.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Increased partition size for flipper code.

Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants