This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[hal][nrfx_qspi.c] Is it reasonable to check if 'p_buffer' word aligned in 'qspi_xfer'?

Hi Nordic guys,

I'm developing with nrf5340, and meet some problem with writing external flash - nrf qspi flash.

I found it sometime failed in 'flash_area_write' and return -22.

And I debug and find that, in qspi_xfer, line 99 at 'modules/hal/nordic/nrfx/drivers/src/nrfx_qspi.c', it check if the write data buffer's address is word aligned!

That's why it failed at writing nrf qspi flash.

In my opinion, it need to check aligned with 'address', but not 'p_buffer'.

Will any body help and fix me?

BR

Ben

Parents
  • Hi Ben

    Sorry about the late reply, but I wanted to understand this for myself before answering you. The EasyDMA requires that the buffers are word aligned, that's just a HW requirement I'm afraid. I can ask for the details from a HW perspective if you'd like.

    If you want to skip some of the header of a buffer so that it's not matching the word alignment, you can fill it with empty bytes so it will match the alignment requirement.

    Best regards,

    Simon

  • Sure, I have filled the buffer into another empty buffer, that works fine.

    I'm just curious about why the buffer address should be aligned.

    If that's the easyDMA protocol, that's it.

    Thanks Simon

    BR

    Ben

Reply Children
No Data
Related