This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Putting a bunch of code in external flash and run from RAM.

Hi All,
I have bunch of code that we want to put the compiled file in the external flash, in the runtime i want to copy the code to RAM and run it from RAM. Consider that the code is using some variable in the RAM. the code is like this:

extern PROTOCOL_SOLVER PROTOCOL_CAN_SOLVER;

//for ccn!!!
CAN_FILTERING_ARRAY filter_array = { {0x650},1};
Can_Device m_canDev = {0x750, 0x0, 0xff, 500, &filter_array};

ProtocolProfiler profile1 = {
  PROTOCOL_CAN,
  &m_canDev,
  &PROTOCOL_CAN_SOLVER
};

//task development :::::

ProtocolProfiler * m_CurrentProfile = &profile1;

float Calculate_Ids_B0(void)
{
  return 0.0f;
}


taskDiag task_sample[2] = {{1, 3, Calculate_Ids_B0, {{0, {0x10,0x90},2}}, {1}, 0, {""}, {0}},
{1, 3, Calculate_Ids_B0, {{0, {0x10,0x90},2}}, {1}, 0, {""}, {0}}};


////just for references.....
typedef struct _can_devices_
{
  uint16_t ID_part;
  uint8_t split_part;
  uint8_t fill_the_Rest ;
  uint16_t Delay_BetweenFrm;
  CAN_FILTERING_ARRAY * filter_array;
} Can_Device;

typedef struct _frame_bank_
{
  uint8_t frmBank[270];
  uint16_t rec_byte_number;
} m_FrmBank;

typedef struct _PROTOCOL_SOLVER_ {
  uint8_t (*ConnectProcedure) (Can_Device * canSpec);
  uint8_t (*SendAndRecieveFrame) (Can_Device * DevSpec, uint8_t * buffer, uint16_t size_of_buffer, uint8_t bank_frm_num);
} PROTOCOL_SOLVER;

typedef struct _comm_protocol_profile_
{
  uint8_t protocol_type;
  Can_Device * can_spect;
  PROTOCOL_SOLVER * protocol_solver;
} ProtocolProfiler;


I am using LPC1788 and EA-1788 board. I hope someone can help me.

Best Regards,
MJM

Parents Reply Children