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

Problem calling RAM based code.

As part of programming the flash from in the application I am loading code into ram and trying to transfer control to it. However when I trace the start of the ram code the machine code matches but the assembly code does not. I guess this has something to do with thumb mode and non-thumb mode?

The RAM code list file shows:

   61: void ISP(void)
 00000000  B530      PUSH        {R4-R5,LR}
   62: {
 00000002            ; SCOPE-START
   64:   void (*ISPExecutePtr)(void) = NULL;
 00000002  2400      MOV         R4,#0x0


But when tracing shows as:

0x40001B48  2400B530  STRCS  R11,[R0],#-0x0530


The calling code, in flash is:

  Uint32 Address;
  void (*ISPExecutePtr)(void) = NULL;

// Gap, code here removed for this forum posting

  Address = ISPRXBuffer[7] * 0x1000000 +
            ISPRXBuffer[8] * 0x10000 +
            ISPRXBuffer[9] * 0x100 +
            ISPRXBuffer[10];
  ISPExecutePtr = (void*)Address;
  ISPExecutePtr();


NB: Please don't be confused by both the flash code and the RAM code having the same source lines as both programs are almost the same since both talk to the same external PC program. I wellcome any sugestions of what I need to do to resolve the problem. Thanks in advance, David

0