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

ARM Cortex M4 scatter file and program entry

0

I am having issue to run & profile my C build for Cortex M4 with the ARM Workbench IDE (RVCT) profiler. The profiler just hangs and doesn't entry the main function.

Here is my Makefile:

    CPU       = Cortex-M4
    CFLAGS    = --c99 --cpu=$(CPU) -Otime -O3 --min_array_alignment=8

    ifeq "$(CPU)" "Cortex-M4"
        CPPFLAGS += -DCortex_M4
    endif

    LDFLAGS   = --cpu=$(CPU) --info sizes,totals --remove --inline --scatter Cortex-M4.scat 
    DEPFLAGS  = --depend_target $@ --md --no_depend_system_headers --phony_targets --depend $(BUILD)/$*.Td

And this is the scatter file:

FLASH_LOAD 0x0000 0x10000000
{
  VECTORS 0x0 0x400
  {
    * (:gdef:__vectab_stack_and_reset, +FIRST)
    ; Additional region for other vectors would be added here
  }

  ;; Maximum of 256 exceptions (256*4 bytes == 0x400)
  CODE 0x400 FIXED
  {
    * (+RO)
  }

  DATA 0x00140000 0x00800000-0x00140000-0x00008000
  {                     
    * (+RW, +ZI)
  }

  ;; Stack grows downwards
  ARM_LIB_STACK 0x00800000 EMPTY -0x8000
  {
  }

  ;; Heap grows upwards
  ARM_LIB_HEAP 0x00800000 EMPTY 0x0200000
  {
  } 

}

Do I need to give any specific parameters to the Makefile or to the profiler? The profiler has the following settings that I didn't change by default: Heap Base: 0x00000000, Heap Limit: 0x0007c000, Stack Base: 0x00080000

Parents
  • Hello, my apologies, I did not notice this question when it first posted. Is this still an issue for you?

    To answer briefly, from the information you provided, assuming everything builds without error, the only possible issue notice is that you have defined the size of the Flash as 0x10000000 bytes:

    FLASH_LOAD 0x0000 0x10000000

    This overlaps the DATA and Stack and Heap sections.

    Which profiling tool are you using? If it based on trace output, no additional options are necessary.

Reply
  • Hello, my apologies, I did not notice this question when it first posted. Is this still an issue for you?

    To answer briefly, from the information you provided, assuming everything builds without error, the only possible issue notice is that you have defined the size of the Flash as 0x10000000 bytes:

    FLASH_LOAD 0x0000 0x10000000

    This overlaps the DATA and Stack and Heap sections.

    Which profiling tool are you using? If it based on trace output, no additional options are necessary.

Children
No data