Execute a function in FlexRam in s32k144

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Execute a function in FlexRam in s32k144

719 Views
Guna
Contributor I

Hi NXP,

Full Context for ur understanding. We are using NXP s32k144 for our project. We are writing a code for PBLupdater which will erase and write present PBl with a new PBL. At first, both PBL and PBLUpdater were in FLASH. Then we were facing MEMManage fault , we understood that as both PBL and PBLUpdater were in the same read partition block --that caused the fault. So we are trying to execute the PBLUpdater functions to erase and write to flash in FlexRam.

 

---SORRY FOR MY SYNTAX----

 

Our Function definition look like this:

 

__attribute__(section(".FlexRamSection")) EraseSectorFucntion definition(address){.....}

 

__attribute__(section(".FlexRamSection")) EraseSectorFucntion definition(address){.....}

 

Linker file look like this:-

define region FlexRam=mem:[from 0x14000000 to 0x14000FFF];

place in FlexRam

{ ro section .sectionName};

In our Code we call the function like this:
int main(){
  ...
  ...
  EraseSectorFucntion();
  ....
}

using as a pointer also we tried:
int main(){
  ...
  ...
  funcpointer=&EraseSectorFucntion();
  funcpointer();
  ....
}

i'm sure that the function is at the FlexRam Address(looked in Disassembly). but when i execute the code. i'm getting Hard Fault for Undefined intruction. Please provide some idea/hints.

0 Kudos
Reply
1 Reply

670 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Guna,

Would you please share the project so that I can test it?

 

Thank you,

BR, Daniel

0 Kudos
Reply