Home › Forums › AUTOSAR General Discussion › Memory mapping in C generated Autosar compliant code with MATLAB
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by autoady.
-
AuthorPosts
-
-
October 12, 2022 at 3:28 pm #3102autoadyParticipant
Hi!
I am trying to solve my issue as to generate an AUTOSAR compliant C code form MATLAB. I successfully created similar memory segments as in your documentation, like:
#define CAN_START_SEC_VAR_8BIT
#include “MemMap.h”
static uint8 myvar_1;
#define CAN_STOP_SEC_VAR_8BIT
#include “MemMap.h”#define CAN_START_SEC_VAR_8BIT
#include “MemMap.h”
static uint8 myvar_2;
#define CAN_STOP_SEC_VAR_8BIT
#include “MemMap.h”What I can not figure out, and I would be really grateful if you could lend a hand here is that:
For all the different functions/vars a new memory segment opens and close. Even if the segment is the same. This is bad, because it takes time to read multiply times the same opening and closing segments.
Do you know any way to prevent this and group those vars/functions within the same memory segment, which have matching starting and closing segment?
so it would be like this:#define CAN_START_SEC_VAR_8BIT
#include “MemMap.h”
static uint8 myvar_1;
static uint8 myvar_2;
#define CAN_STOP_SEC_VAR_8BIT
#include “MemMap.h”Thanks a lot for any advice!
-
November 19, 2022 at 6:37 pm #3107Admin_AlphaKeymaster
Yes you can do as you did in the last example use a section for all your vars.
-
November 29, 2022 at 6:28 pm #3108autoadyParticipant
Unfortunately when generating code in Matlab, even if AUTOSAR4 is selected in cscdesigner, and using Autosar component designer still can’t solve this issue for me.
Sections are generated that’s not the problem, they are not grouped, that’s the issue here!My generated code will result the upper version, the below version is what I would like to achieve. If you know the solution please share your settings and configurations.
I am using Matlab 2019b if that helps. I cant update version I am searching the solution for that exact version.Kind regards: Adam
- This reply was modified 2 years ago by autoady.
-
-
AuthorPosts
- You must be logged in to reply to this topic.