- This topic has 2 replies, 2 voices, and was last updated 1 year, 11 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › AUTOSAR General Discussion › Memory mapping in C generated Autosar compliant code with MATLAB
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!
Yes you can do as you did in the last example use a section for all your vars.
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