Loading ...
Sorry, an error occurred while loading the content.

First compilation

Expand Messages
  • urk1254
    Hi! Thank you Louis, your answer was helpful, the site contains much interesting information besides the headers. Another question: Now I standing in front of
    Message 1 of 1 , Nov 1, 2004
    • 0 Attachment
      Hi!
      Thank you Louis, your answer was helpful, the site contains much
      interesting information besides the headers.

      Another question:
      Now I standing in front of another problem. I have a custom made
      bootloader which sits at addresses 0x4000-0x5801. Secondary interrupts
      table is at RAM at address 0x3f40-0x3fff. Bootloader works ok (was
      written using CodeWarrior 2.1 and tested extensively with other
      applications). Right now I try to upload new firmware compiled using
      GCC port. The result: the software never reaches "main" function. I
      work at custom board with no evaluation boards, so no debugging is
      available to me at this stage. I don't know on which initialization
      stage the firmware fails. I think, compiler generated code tries to
      initialize some memory at secondary interrupts table or tries to write
      to flash at some stage and gets some exception. The fact stands:
      firmware never reaches "main" function.

      Here is my "memory.x" file
      --------------------------------------------------
      MEMORY
      {
      page0 (rx) : ORIGIN = 0x0, LENGTH = 256
      eeprom (rx) : ORIGIN = 0x400, LENGTH = 0x1000 - 0x400
      /* non-banked memory access */

      /* 0x3E -> 0x4000 */
      text (rx) : ORIGIN = 0x5802, LENGTH = 0xc000 - 0x5802

      common (rx) : ORIGIN = 0xc000, LENGTH = 16k /* 0x3F -> 0xC000
      */

      /* RAM (0x1000 - 0x3F8F), leave a place for secondary interrupts
      table */
      data : ORIGIN = 0x1000, LENGTH = 12K - 0xc0
      /* banked memory access */
      bank0 (rx) : ORIGIN = 0xD0000, LENGTH = 16K /* 0x30 */
      -------- skipped -------------------
      bank13 (rx) : ORIGIN = 0x104000, LENGTH = 16K /* 0x3D */
      }
      /* Setup the stack at the top of the data memory bank (RAM) */
      PROVIDE (_stack = 0x4000);
      PROVIDE (_io_ports = 0);
      ---------------------------------------------------------

      Compilation is peformed this way:
      m6811-elf-gcc -mshort -c -m68hcs12 -Wall -Wmissing-prototypes -g -Os
      main.c
      m6811-elf-gcc -m68hcs12 -mshort -mlong-calls -Wl,-m,m68hc12elfb -o
      main.elf main.o
      m6811-elf-objcopy --output-target=srec main.elf main.s19


      -------------------------------------------------------------------
      I would appreciate your help. This will help me move from CodeWarrior
      to GCC.
      Regards,
      Uri
    Your message has been successfully submitted and would be delivered to recipients shortly.