-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
applications: sdp: mspi: RX High frequency fix #21112
base: main
Are you sure you want to change the base?
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 804cb68e80f9a59afca0ae25f0a411b255d4d3db more detailssdk-nrf:
Github labels
List of changed files detected by CI (2)
Outputs:ToolchainVersion: 4ffa2202d5 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
You can find the documentation preview for this PR here. |
Modified hrt rx to work in quad mode in 21.333333MHz. Signed-off-by: Michal Frankiewicz <michal.frankiewicz@nordicsemi.no>
2e9fb59
to
804cb68
Compare
while (nrf_vpr_csr_vio_shift_cnt_in_get() > 0) { | ||
} | ||
/* Wait until timer 0 stops. | ||
* counter stops 1 clock to early. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* counter stops 1 clock to early. | |
* counter stops 1 clock too early. |
As it was before.
@@ -41,6 +41,34 @@ static nrf_vpr_csr_vio_shift_ctrl_t xfer_shift_ctrl = { | |||
.in_mode = NRF_VPR_CSR_VIO_MODE_IN_CONTINUOUS, | |||
}; | |||
|
|||
NRF_STATIC_INLINE bool is_counter_running(uint8_t counter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, to be more readable:
NRF_STATIC_INLINE bool is_counter_running(uint8_t counter) | |
NRF_STATIC_INLINE bool is_counter_running(uint8_t cnt_idx) |
return cnt != nrf_vpr_csr_vtim_simple_counter_get(counter); | ||
} | ||
|
||
NRF_STATIC_INLINE uint32_t get_shift_count(volatile hrt_xfer_t *hrt_xfer_params, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would change name of this function to something different, "get" may suggest it is read from a register. But I am not sure what, "calculate" does not fit either. Maybe something like get_next_shift_count
?
switch (word_count - *index) { | ||
case 1: /* Last transfer */ | ||
(*index)++; | ||
return SHIFTCNTB_VALUE(hrt_xfer_params->xfer_data[HRT_FE_DATA].last_word_clocks); | ||
case 2: /* Last but one transfer */ | ||
(*index)++; | ||
return SHIFTCNTB_VALUE( | ||
hrt_xfer_params->xfer_data[HRT_FE_DATA].penultimate_word_clocks); | ||
default: | ||
(*index)++; | ||
return SHIFTCNTB_VALUE(BITS_IN_WORD / hrt_xfer_params->bus_widths.data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If index is incremented for every case, then why is it changed in this function? I think it would be better to do it outside and pass index directly, not by a pointer.
* nrf_vpr_csr_vio_shift_cnt_in_get function inside while cannot be used because in | ||
* higher frequencies shifting stops before it is called 1-st time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English has a strict order of words in a sentence for a reason ;)
* nrf_vpr_csr_vio_shift_cnt_in_get function inside while cannot be used because in | |
* higher frequencies shifting stops before it is called 1-st time. | |
* nrf_vpr_csr_vio_shift_cnt_in_get function cannot be used inside while loop because at | |
* higher frequencies shifting stops before it is called the first time. |
nrf_vpr_csr_vio_in_buffered_reversed_byte_get(); | ||
nrf_vpr_csr_vio_shift_ctrl_buffered_set(&rx_shift_ctrl); | ||
|
||
for (uint32_t i = 0; i < word_count - 1; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could start the for loop from i = 2
, then index
variable is not needed.
Modified hrt rx to work in quad mode up to 21.333333MHz.