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

pstorage_size_t is short or int?

From SDK 7.2, we have the following definitions:

components\drivers_nrf\pstorage\config\pstorage_platform.h

typedef uint16_t pstorage_size_t; /** Size of length and offset fields. */

examples\dfu\bootloader\config\pstorage_platform.h

typedef uint32_t pstorage_size_t; /** Size of length and offset fields. */

I would think my bootloader and application should share the same code, so I'm confused why there are different definitions of this type.

Can someone explain why these differ?

Parents
  • This is a guess, but I suspect because the bootloader has to be able to load in more than 64K of code, it needs a larger pstorage size than most "reasonable" applications that wouldn't need that much flash space.

    Also, I believe the pstorage_platform.h file is meant to be customized and tailored to your application so differences should be expected. There is this comment in the version of the file I am using:

     /** @file
     *  This header contains defines with respect persistent storage that are specific to
     *  persistent storage implementation and application use case.
     */
    
Reply
  • This is a guess, but I suspect because the bootloader has to be able to load in more than 64K of code, it needs a larger pstorage size than most "reasonable" applications that wouldn't need that much flash space.

    Also, I believe the pstorage_platform.h file is meant to be customized and tailored to your application so differences should be expected. There is this comment in the version of the file I am using:

     /** @file
     *  This header contains defines with respect persistent storage that are specific to
     *  persistent storage implementation and application use case.
     */
    
Children
Related