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

i have problem to start the MC9S12NE64

Expand Messages
  • fernando_6867
    - i have problem to start the MC9S12NE64, - my source code, file name is hello.c: #include sys/types.h #include sys/ports.h void delay(); int main (){
    Message 1 of 5 , Mar 18, 2010
      - i have problem to start the MC9S12NE64,

      - my source code, file name is hello.c:

      #include "sys/types.h"
      #include "sys/ports.h"
      void delay();
      int main (){
      _io_ports[M6811_PORTB]=0x0F;
      _io_ports[M6812_DDRB]=0x0F;
      while(1){
      delay();
      _io_ports[M6811_PORTB]=0xA;
      delay();
      _io_ports[M6811_PORTB]=0x9;
      delay();
      _io_ports[M6811_PORTB]=0x5;
      delay();
      _io_ports[M6811_PORTB]=0x6;
      }
      return 0;
      }
      void delay(){
      int i,j;
      for(i=0;i<0xff;++i)
      for(j=0;j<0xff;j++);
      }


      - and my memory.x file is:

      MEMORY
      {
      ioports (!x) : ORIGIN = 0x0000, LENGTH = 0x0400
      eeprom (!i) : ORIGIN = 0x, LENGTH = 0x
      data (rwx) : ORIGIN = 0x3200, LENGTH = 0x0E00
      text (rx) : ORIGIN = 0x4000, LENGTH = 0x7fff
      vectors (rx) : ORIGIN = 0xFF80, LENGTH = 0x0080
      }

      PROVIDE (_stack = 0x4000-1);
      PROVIDE (_io_ports = 0xFF80);
      PROVIDE (_start = 0xFFFE);


      - i compile this in debian squeeze.

      # m68hc11-gcc -m68hc12 -g -Os -mshort -Wl,-m,m68hc12elfb -o hello.elf hello.c -I /home/fernando/programacion/gel-hc1x-1.6.1/include

      # gedit /home/fernando/programacion/gel-hc1x-1.6.1/include/asm-m68hc12/ports_def.h

      # m68hc11-objdump -s hello.s19

      hello.s19: file format srec

      Contents of section .sec1:
      4000 cf3fff16 407ece40 88cd3200 cc000027 .?..@~.@..2....'
      4010 07180a30 700434f9 cc000227 08ce3200 ...0p.4....'..2.
      4020 69300434 fb164031 16408220 fb400640 i0.4..@1.@. .@.@
      4030 181801ae 32007f32 00180b0f ff81180b ....2..2........
      4040 0fff8307 1c180b0a ff810715 180b09ff ................
      4050 81070e18 0b05ff81 0707180b 06ff8120 ...............
      4060 e21801ae 32007f32 00ce0000 cc001104 ....2..2........
      4070 34fd088e 00fe2ff4 1805b132 003d87b7 4...../....2.=..
      4080 023d10ef 3e20fba7 .=..> ..

      but, with the .s19 file generated with codewarrio i have:
      #m68hc11-objdump -s Project.abs.s19

      Project.abs.s19: file format srec

      Contents of section .sec1:
      c000 fec033fd c031270e 35ed31ec 31697004 ..3..1'.5.1.1ip.
      c010 34fb3103 26f2fec0 35ec3127 0bed3118 4.1.&...5.1'..1.
      c020 0a307004 34f920f1 3dcf0500 07d206c0 .0p.4. .=.......
      c030 3b0000c0 37c07d00 0000003b 10efc60f ;...7.}....;....
      c040 5b03c655 5b3f585b 3f790001 c7876c80 [..U[?X[?y....l.
      c050 ce000008 8e00ff2d fa07192d f3c6015b .......-...-...[
      c060 01c7876c 80ce0000 088e00ff 2dfa0704 ...l........-...
      c070 2df320ce ee82086e 828e00ff 3d0000 -. ....n....=..
      Contents of section .sec2:
      fffe c029 .)


      the file generated for codewarrior add "fffe c029", gcc no add this.
      helpme please.

      sorry, my inglish is not very good.

      fernando
    • fernando_6867
      sorry, ... is m68hc11-objcopy --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data --output-target=srec hello.elf hello.s19
      Message 2 of 5 , Mar 18, 2010
        sorry,


        > # gedit /home/fernando/programacion/gel-hc1x-1.6.1/include/asm-m68hc12/ports_def.h
        >

        is

        m68hc11-objcopy --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data --output-target=srec hello.elf hello.s19
      • Keith V
        Most likely your reset vector isn t pointing to your startup code or your startup code isn t pointng to your main To: gnu-m68hc11@yahoogroups.com From:
        Message 3 of 5 , Mar 18, 2010
          Most likely your reset vector isn't pointing to your startup code or your startup code isn't pointng to your main


          To: gnu-m68hc11@yahoogroups.com
          From: fernando_6867@...
          Date: Thu, 18 Mar 2010 21:26:14 +0000
          Subject: Re: i have problem to start the MC9S12NE64

           
          sorry,

          > # gedit /home/fernando/ programacion/ gel-hc1x- 1.6.1/include/ asm-m68hc12/ ports_def. h
          >

          is

          m68hc11-objcopy --only-section= .text --only-section= .rodata --only-section= .vectors --only-section= .data --output-target= srec hello.elf hello.s19




          The New Busy is not the old busy. Search, chat and e-mail from your inbox. Get started.
        • fernando_6867
          the problem is that it do not search the startup code, what do it produce this? i probe add vectors.s. but it do not found.
          Message 4 of 5 , Mar 19, 2010
            the problem is that it do not search the startup code, what do it produce this? i probe add vectors.s. but it do not found.



            --- In gnu-m68hc11@yahoogroups.com, Keith V <my427v8@...> wrote:
            >
            >
            > Most likely your reset vector isn't pointing to your startup code or your startup code isn't pointng to your main
            >
            > To: gnu-m68hc11@yahoogroups.com
            > From: fernando_6867@...
            > Date: Thu, 18 Mar 2010 21:26:14 +0000
            > Subject: Re: i have problem to start the MC9S12NE64
            >
            >
            >--------------------------------------------------------
            >
            >
            > sorry,
            >
            >
            >
            > > # gedit /home/fernando/programacion/gel-hc1x-1.6.1/include/asm-m68hc12/ports_def.h
            >
            > >
            >
            >
            >
            > is
            >
            >
            >
            > m68hc11-objcopy --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data --output-target=srec hello.elf hello.s19
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > _________________________________________________________________
            > The New Busy is not the old busy. Search, chat and e-mail from your inbox.
            > http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3
            >
          • fernando_6867
            the problem is that it do not search the startup code, what do it produce this? i probe add vectors.s. but it do not found.
            Message 5 of 5 , Mar 19, 2010
              the problem is that it do not search the startup code, what do it produce this? i probe add vectors.s. but it do not found.

              --- In gnu-m68hc11@yahoogroups.com, Keith V <my427v8@...> wrote:
              >
              >
              > Most likely your reset vector isn't pointing to your startup code or your startup code isn't pointng to your main
              >
              > To: gnu-m68hc11@yahoogroups.com
              > From: fernando_6867@...
              > Date: Thu, 18 Mar 2010 21:26:14 +0000
              > Subject: Re: i have problem to start the MC9S12NE64
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              > sorry,
              >
              >
              >
              > > # gedit /home/fernando/programacion/gel-hc1x-1.6.1/include/asm-m68hc12/ports_def.h
              >
              > >
              >
              >
              >
              > is
              >
              >
              >
              > m68hc11-objcopy --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data --output-target=srec hello.elf hello.s19
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              > _________________________________________________________________
              > The New Busy is not the old busy. Search, chat and e-mail from your inbox.
              > http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.