Author Topic: No memory from 0x8000 to 0xbfff  (Read 10300 times)

Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
No memory from 0x8000 to 0xbfff
« on: October 16, 2008, 07:12:30 PM »
I cannot seem to get the linker to understand that there really is memory at 0x8000. I have tried both small and banked models. If I use the "Processor Expert" in the Metrowerks Code Warrior, it will not allow it either. The .PRM file seems to have the correct entries. This has to be something really easy but i'll be darned if I can see it.

Thanks.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3069
    • View Profile
    • uTasker
Re: No memory from 0x8000 to 0xbfff
« Reply #1 on: October 16, 2008, 08:09:07 PM »
Hi Ewan

Which version of CW are you using? I always used V4.5 and the small model (not banked). With previous versions it didn't like to debug with the linear memory but the V4.5 was fine.

You may like to ask on the Freescale forum for CW for 16 bit devices:
http://forums.freescale.com/freescale/board?board.id=CW816COMM


Regards

Mark

Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: No memory from 0x8000 to 0xbfff
« Reply #2 on: October 16, 2008, 09:39:34 PM »
I am using V 5.5.1272. I made sure it was compiling for small and linking for small and using the small library, but still no luck. I will try the Freescale forum.

Many thanks.

Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: No memory from 0x8000 to 0xbfff
« Reply #3 on: October 16, 2008, 10:18:04 PM »
I found this on the Freescale forum and it works. What a mess, though.

Regards,  Ewan.

http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&thread.id=4146

Here's the solution given to me by Freescale:
 
"... The previous solution I mentioned was not useful as there was no possibility to debug the code. So finally the one possible solution is just include the PAGE_3C segment into your default placements :

PLACEMENT
_PRESTART, STARTUP,
ROM_VAR, STRINGS,
VIRTUAL_TABLE_SEGMENT,
DEFAULT_ROM , NON_BANKED,
COPY INTO ROM_C000,
ROM_4000,PAGE_3C;

(please notice the order of segments!)

And to ensure the correct PPAGE register settings you have to modify Start12c file (_Startup function)
___INITRM = 0x39; /* lock Ram to end at 0x3FFF */

/* new line to set the correct PPAGE register value */ *(unsigned char *)0x30 = 0x3C;

#ifdef _HCS12_SERIALMON

/* for Monitor based software remap the RAM & EEPROM to adhere
to EB386. Edit RAM and EEPROM sections in PRM file to match these. */

___INITRG = 0x00; /* lock registers block to 0x0000 */
___INITRM = 0x39; /* lock Ram to end at 0x3FFF */
___INITEE = 0x09; /* lock EEPROM block to end at 0x0fff */ #endif "

Hope this helps,

Anders.

Offline thamanjd

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: No memory from 0x8000 to 0xbfff
« Reply #4 on: October 17, 2008, 01:58:24 AM »
I had the same problem to begin with. same solution. here's a similar extract from my start12c:
i've commented out the #if define(_HCS12_SERIALMON). i'm user the pemicro debugger but i still need those settings.

__asm LDS #0x3FFF;

//#if defined(_HCS12_SERIALMON)
   /* for Monitor based software remap the RAM & EEPROM to adhere
      to EB386. Edit RAM and EEPROM sections in PRM file to match these. */
   ___INITRG = 0x00;  /* lock registers block to 0x0000 */
   ___INITRM = 0x39;  /* lock Ram to end at 0x3FFF */
   ___INITEE = 0x09;  /* lock EEPROM block to end at 0x0fff */
//#endif

---------------------------------------------------------


and here's my prm (theres a bunch of stuff commented out that i really should just delete).
Note that the file_routine segment should be placed in the lowest rom possible. This makes sure it is still accesible when the higher blocks are being swapped so the flash code is still accessible. Also not the two different ram sizes for dhcp and non dhcp. NE64 uses the lowest chunks of ram for ethernet buffers. see app_hw_ne64.h for buffer sizes
----------------------------------------------------------

/* This is a linker parameter file for the MC9S12NE64 */

NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */

SEGMENTS  /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
//    RAM = READ_WRITE 0x2C50 TO 0x3D40;   //for when use dhcp
      RAM = READ_WRITE 0x2602 TO 0x3D00;    //for no dhcp
//    STACKSPACE=NO_INIT 0x3D02 TO 0x3FFC;
//      STACKSPACE=READ_ONLY 0x3D02 TO 0x3FFC;

    /* unbanked FLASH ROM */
    ROM_4000 = READ_ONLY  0x4000 TO 0x7FFF;
    ROM_C000 = READ_ONLY  0xC000 TO 0xFEFF;
    ROM_8000 = READ_ONLY  0x8000 TO 0xBFFF;

    /* banked FLASH ROM */
    PAGE_3C = READ_ONLY  0x3C8000 TO 0x3CBFFF;
    PAGE_3D = READ_ONLY  0x3D8000 TO 0x3DBFFF;
/*  PAGE_3E = READ_ONLY  0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */
/*  PAGE_3F = READ_ONLY  0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */
END

PLACEMENT  /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    FILE_ROUTINE,
    _PRESTART,                   /* Used in HIWARE format: jump to _Startup at the code start */
    STARTUP,                     /* startup data structures */
    ROM_VAR,                     /* constant variables */
    STRINGS,                     /* string literals */
    VIRTUAL_TABLE_SEGMENT,       /* C++ virtual table segment */
  //.ostext,                     /* OSEK */
    DEFAULT_ROM, NON_BANKED,                  /* runtime routines which must not be banked */
    COPY                         /* copy down information: how to initialize variables */
                                 /* in case you want to use ROM_4000 here as well, make sure
                                    that all files (incl. library files) are compiled with the
                                    option: -OnB=b */
                                 INTO  ROM_4000,ROM_8000, ROM_C000 /*, ROM_4000*/;
 //   OTHER_ROM                    INTO  PAGE_3D, PAGE_3C;
                                             
  //.stackstart,               /* eventually used for OSEK kernel awareness: Main-Stack Start */
//    SSTACK,                    /* allocate stack first to avoid overwriting variables on overflow */
  //.stackend,                 /* eventually used for OSEK kernel awareness: Main-Stack End */
    DEFAULT_RAM                  INTO  RAM;
  //.vectors                     INTO OSVECTORS; /* OSEK */
END

ENTRIES /* keep the following unreferenced variables */
    /* OSEK: always allocate the vector table and all dependent objects */
  //_vectab OsBuildNumber _OsOrtiStackStart _OsOrtiStart
END

STACKSIZE 0x01

//VECTOR 0 _Startup /* Reset vector: this is the default entry point for a C/C++ application. */
//VECTOR 0 Entry  /* Reset vector: this is the default entry point for an Assembly application. */
//INIT Entry      /* For assembly applications: that this is as well the initialization entry point */

-----------------------------------------------------

JD


Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: No memory from 0x8000 to 0xbfff
« Reply #5 on: October 17, 2008, 09:14:50 PM »
Well, it turns out that V 5.5.1272 that I said was for the IDE, not the innards. I now have V4.7 Eval.. There is now no problem whatsoever with compiling or linking the uTasker project. I wish it were so simple.

I have a P&E USB Multilink connected to a board with an NE64. I can download my old software (written by me before uTasker and using the banked model) and the new Metrowerks with the P&E works fine. Now, when I try to load the uTasker Monitor.abs to the target hardware I get the message:-
"Loading verification failed at 0x4000."

Any ideas?

On another barely related matter, I got my licence from Freescale but Metrowerks keeps asking me to register, which I already did. Is it limited to 64K or to 30 days or both?

Thanks.

Offline thamanjd

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: No memory from 0x8000 to 0xbfff
« Reply #6 on: October 20, 2008, 07:09:51 AM »
I've got a feeling that the target setup/setttings for a "monitor" target wont work with the PE debugger.

Mark might jump in here with a comment but i believe that at least originally, uTasker CW project did not include a target for PE debugger.

You can add a target but at least in my CW version there is no option for automatic settings for PE multilink debugger. You could try entering the details in manually or....

To make it easy on myself i created a new ne64 project with the wizard in CW, and then chose to add a target for PE debugger and one for simulator. ( i wasnt using serial monitor). Deleted all or most(keep linker/prm/project/cmd and start12c files of the new project) of the new project files and replaced them with the uTasker files. Then i modified as mentioned previously the prm and start12c files.

Regarding the licence. I'm not sure. i take it they've sent you a new licence.dat file which has now been copied in place of the old one? Its a text file. open it up and see if the entry for version matches what you have. I've been sent licence.dat files for the wrong version once before.

JD