This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Flash read - size word aligned?

Hello.

Reading the documentation of pstorage_load and the actual implementation has left me with confusion.

The documentation states that the size and offset parameters have to be aligned. However inside the function itself it checks for something else. Sure, it makes sure the offset is word aligned BUT it doesn't check the size. It checks p_dest instead. Why does it have to check if the destination pointer is word aligned? Why doesn't the documentation state so?

Clearing this up would be a huge help for me as I'm trying to implement a custom DFU module. Thank you

Parents
  • You have some good points.

    NVMC works only with word aligned addresses. Copy and Paste from the manual "Only word aligned writes are allowed. Byte or half word aligned writes will result in a hard fault."

    This does mean that that we cannot read them into non word aligned address. So I think that the check to dest_addr is not necessary (even though word align reads are more optimal)

    There seems to be some ambiguity in the documentation, but i do not want to create a task for it as the team is re-designing pstorage for next release and all this will not matter any more.

    If you are not happy with the check with p_dest, i suggest you remove the check. It should be ok.

Reply
  • You have some good points.

    NVMC works only with word aligned addresses. Copy and Paste from the manual "Only word aligned writes are allowed. Byte or half word aligned writes will result in a hard fault."

    This does mean that that we cannot read them into non word aligned address. So I think that the check to dest_addr is not necessary (even though word align reads are more optimal)

    There seems to be some ambiguity in the documentation, but i do not want to create a task for it as the team is re-designing pstorage for next release and all this will not matter any more.

    If you are not happy with the check with p_dest, i suggest you remove the check. It should be ok.

Children
No Data
Related