Search code examples
encapsulationnvmautosarhidden-variables

how to make a structure defined in a NVM AUTOSAR module invisible for the application in C?


There is a requirement in the AUTOSAR NVM module that says: [SWS_NvM_00135] The Administrative block shall be invisible for the application and is used exclusively by the NvM module for security and administrative purposes of the RAM block and the NVRAM block itself.

how can I implement such an Administrative block which is invisible for the application?

it should be considered that the administrative block has to be accessible in different files in the NVM module itself. So it could not be defined as a static structure in a .c file. Furthermore, if it is declared in a header file, the application can also include it and use it. Therefore it would not be invisible for the application. Totally how could it be implemented meeting the requirement?


Solution

  • As per AUTOSAR specification, application are supposed to include only Nvm.h. Only provide information which are required by upper layer in Nvm.h

    5.1.1 Header file structure The include file structure shall be as follows: [SWS_NvM_00554] dNvM module shall include NvM.h, Dem.h, MemIf.h.c() [SWS_NvM_00691] dOnly NvM.h shall be included by the upper layer.c()

    More information about BSW file structure and implementation idea can be found here, AUTOSAR_SWS_BSWGeneral.pdf