File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
applications/sdp/mspi/src/hrt Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -239,8 +239,12 @@ hrt_write:
239239 addi sp ,sp ,-16
240240 sw s0,8 (sp )
241241 sw ra,12 (sp )
242+ sw s1,4 (sp )
242243 mv s0,a0
243244 sb zero,3 (sp )
245+ #APP
246+ csrr s1, 3008
247+ #NO_APP
244248 lhu a5 ,90 (a0 )
245249 #APP
246250 csrw 3009 , a5
@@ -344,11 +348,16 @@ hrt_write:
344348 call hrt_tx
345349 lbu a5 ,94 (s0)
346350 bne a5 ,zero,.L43
347- li a5 ,16384
351+ li a5 ,4096
348352 addi a5 ,a5 ,1
349353 #APP
350354 csrw 3019 , a5
351- csrw 3017 , 0
355+ #NO_APP
356+ slli s1,s1,1
357+ slli s1,s1,16
358+ srli s1,s1,16
359+ #APP
360+ csrw 3012 , s1
352361 csrw 2000 , 0
353362 #NO_APP
354363.L44:
@@ -370,6 +379,7 @@ hrt_write:
370379.L31:
371380 lw ra,12 (sp )
372381 lw s0,8 (sp )
382+ lw s1,4 (sp )
373383 addi sp ,sp ,16
374384 jr ra
375385.L38:
@@ -389,7 +399,7 @@ hrt_write:
389399 #APP
390400 csrw 2000 , 0
391401 #NO_APP
392- li a5 ,16384
402+ li a5 ,4096
393403 addi a5 ,a5 ,1
394404 #APP
395405 csrw 3019 , a5
Original file line number Diff line number Diff line change 3131static const nrf_vpr_csr_vio_shift_ctrl_t write_final_shift_ctrl_cfg = {
3232 .shift_count = 1 ,
3333 .out_mode = NRF_VPR_CSR_VIO_SHIFT_NONE ,
34- .frame_width = 4 ,
34+ .frame_width = 1 ,
3535 .in_mode = NRF_VPR_CSR_VIO_MODE_IN_CONTINUOUS ,
3636};
3737
@@ -125,6 +125,12 @@ void hrt_write(hrt_xfer_t *hrt_xfer_params)
125125
126126 nrf_vpr_csr_vio_mode_out_t out_mode = {.mode = NRF_VPR_CSR_VIO_SHIFT_OUTB_TOGGLE };
127127
128+ /*
129+ * Least significant bit is ignored when the whole OUTB is shifted to OUT at once after
130+ * switching to no shifting mode, so the read value need to be shifted left by 1.
131+ */
132+ uint16_t prev_out = nrf_vpr_csr_vio_out_get () << 1 ;
133+
128134 /* Configure clock and pins */
129135 nrf_vpr_csr_vio_dir_set (hrt_xfer_params -> tx_direction_mask );
130136
@@ -199,7 +205,7 @@ void hrt_write(hrt_xfer_t *hrt_xfer_params)
199205 */
200206 if (hrt_xfer_params -> cpp_mode == MSPI_CPP_MODE_0 ) {
201207 nrf_vpr_csr_vio_shift_ctrl_buffered_set (& write_final_shift_ctrl_cfg );
202- nrf_vpr_csr_vio_out_buffered_reversed_word_set ( 0x00 );
208+ nrf_vpr_csr_vio_out_buffered_set ( prev_out );
203209 nrf_vpr_csr_vtim_count_mode_set (0 , NRF_VPR_CSR_VTIM_COUNT_STOP );
204210 } else {
205211 while (nrf_vpr_csr_vio_shift_cnt_out_get () != 0 ) {
You can’t perform that action at this time.
0 commit comments