AnsweredAssumed Answered

Ethernet Bootloader for MK64FX512 in Keil MDK5.21

Question asked by haiwagn zuo on Nov 7, 2017
Latest reply on Nov 15, 2017 by Jorge Antonio Alcala Vazquez

1、I have run Ethernet Bootloader on my board of MK64FX512 through IAR development;

2、But my company must use Keil MDK development,in In the process of transplantation,I Encountered one  problem.

  I want to put the Fapp_params to address 0x7f000 in flash,so I add the scatter file

  ER_m_fnet_app FappParams_start FappParams_size{
  fapp_params.o (+RO)
  }

bulid the project  the map file show

    Execution Region ER_m_fnet_app (Base: 0x0007f000, Size: 0x00000244, Max: 0x00000fff, ABSOLUTE)

    Base Addr    Size         Type   Attr      Idx    E Section Name        Object

    0x0007f000   0x0000008c   Code   RO         6026    i.fapp_params_from_flash  fapp_params.o
    0x0007f08c   0x000000dc   Code   RO         6027    i.fapp_params_to_flash  fapp_params.o
    0x0007f168   0x000000dc   Data   RO         6029    .fapp_params        fapp_params.o

it seems that the result is ok,

but I debug the project through the J-Link online,it come in hardfault at the beginning.I donot know what is wrong?

 

please help me ,thank you very much!

 

This is my scatter file

;#if (defined(__ram_vector_table__))
  #define __ram_vector_table_size__    0x00000400
;#else
  ;#define __ram_vector_table_size__    0x00000000
;#endif

#define m_interrupts_start             0x00000000
#define m_interrupts_size              0x00000400

#define m_flash_config_start           0x00000400
#define m_flash_config_size            0x00000010

#define m_text_start                   0x00000410
#define m_text_size                    0x0007EBF0

#define m_interrupts_ram_start         0x1FFF0000
#define m_interrupts_ram_size          __ram_vector_table_size__

#define m_data_start                   (m_interrupts_ram_start + m_interrupts_ram_size)
#define m_data_size                    (0x00010000 - m_interrupts_ram_size)

#define m_data_2_start                 0x20000000
#define m_data_2_size                  0x00020000

/* FNET application parameters (optional).*/
#define FappParams_start (0x0007FFFF + 1 - (4*0x400))
#define FappParams_end   0x0007FFFF
#define FappParams_size  0xFFF

/* Sizes */
#if (defined(__stack_size__))
  #define Stack_Size                   __stack_size__
#else
  #define Stack_Size                   0x01000
#endif

#if (defined(__heap_size__))
  #define Heap_Size                    __heap_size__
#else
  #define Heap_Size                    0x0400
#endif

LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load region size_region
  VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
    * (RESET,+FIRST)
  }
  ER_m_flash_config m_flash_config_start FIXED m_flash_config_size { ; load address = execution address
    * (FlashConfig)
  }
  ER_m_text m_text_start m_text_size { ; load address = execution address
    * (InRoot$$Sections)
    .ANY (+RO)
  }
  ER_m_fnet_app FappParams_start FappParams_size{
  fapp_params.o (+RO)
  }

;#if (defined(__ram_vector_table__))
  VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
  }
;#else
  ;VECTOR_RAM m_interrupts_start EMPTY 0 {
  ;}
;#endif
  RW_m_data m_data_start m_data_size { ; RW data
    .ANY (+RW +ZI)
  }
  RW_m_data_2 m_data_2_start m_data_2_size-Stack_Size-Heap_Size { ; RW data
    .ANY (+RW +ZI)
  }
  ARM_LIB_HEAP ((ImageLimit(RW_m_data_2) == m_data_2_start) ? m_data_2_start : +0) EMPTY Heap_Size { ; Heap region growing up
  }
  ARM_LIB_STACK m_data_2_start+m_data_2_size EMPTY -Stack_Size { ; Stack region growing down
  }
}

Outcomes