ramcode section not used when optimization level < O2

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ramcode section not used when optimization level < O2

ソリューションへジャンプ
1,622件の閲覧回数
Novalis
Contributor III

Hello,
I am using S32DS 3.5 update 10 + RTD 3 for S32K312 and trying to put some code to .ramcode section so that it runs from RAM.

ie. for some functions in C40_ip.h I have changed

C40_Ip_StatusType C40_Ip_MainInterfaceSectorEraseStatus(void);

to

C40_Ip_StatusType C40_Ip_MainInterfaceSectorEraseStatus(void) __attribute__((section (".ramcode")));

But when I select Optimize level O0 or O1, the code is not put into .ramcode section

With O2 and more, it is put into .ramcode but I cannot debug where it is causing HardFault

Can anybody help with this? Or give me another solution to make the code run from RAM (to be able to erase sectors and write to flash)?

Thanks,
Martin

 

0 件の賞賛
返信
1 解決策
1,602件の閲覧回数
Novalis
Contributor III

I have found that I have to change

#define MEM_43_INFLS_START_SEC_CODE
#include "Mem_43_InFls_MemMap.h"

to

#define MEM_43_INFLS_START_SEC_RAMCODE
#include "Mem_43_InFls_MemMap.h"

 

and also

#define MEM_43_INFLS_STOP_SEC_CODE
#include "Mem_43_InFls_MemMap.h"

to

#define MEM_43_INFLS_STOP_SEC_RAMCODE
#include "Mem_43_InFls_MemMap.h"

in the end of the file c40_ip.h

do not forget to also add C40_Ip_MainInterfaceHVJobStatus to the header file like in the linked post below.

and then functions get into .ramcode even if no optimization is selected

like in this post  https://community.nxp.com/t5/S32K/S32K344-C40-IP-Hardware-Fault-Problem/td-p/1697432

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,603件の閲覧回数
Novalis
Contributor III

I have found that I have to change

#define MEM_43_INFLS_START_SEC_CODE
#include "Mem_43_InFls_MemMap.h"

to

#define MEM_43_INFLS_START_SEC_RAMCODE
#include "Mem_43_InFls_MemMap.h"

 

and also

#define MEM_43_INFLS_STOP_SEC_CODE
#include "Mem_43_InFls_MemMap.h"

to

#define MEM_43_INFLS_STOP_SEC_RAMCODE
#include "Mem_43_InFls_MemMap.h"

in the end of the file c40_ip.h

do not forget to also add C40_Ip_MainInterfaceHVJobStatus to the header file like in the linked post below.

and then functions get into .ramcode even if no optimization is selected

like in this post  https://community.nxp.com/t5/S32K/S32K344-C40-IP-Hardware-Fault-Problem/td-p/1697432

0 件の賞賛
返信