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

Locating Code

I wish to install a bootloader in a specific sector of the LPC2106. How can I place a section of code to start at a specific address?

Thanks

Rich

Parents
  • I am having no luck getting this to work. I have added the line: LA IAP.OBJ SEGMENTS (?PR?Copy_RAM_Flash?(C:0x1E000)) to the User segments box in the LA locate tab. First, do I have to manually locate every function when I want an entire portion of C code located in a certain area? The above results in a linker error L110 cannot find segment error.

    Rich

Reply
  • I am having no luck getting this to work. I have added the line: LA IAP.OBJ SEGMENTS (?PR?Copy_RAM_Flash?(C:0x1E000)) to the User segments box in the LA locate tab. First, do I have to manually locate every function when I want an entire portion of C code located in a certain area? The above results in a linker error L110 cannot find segment error.

    Rich

Children
  • I am loading:

    DATA (0x40000000-0x4000FFFF),
    CODE (0x1E000-0x1EF00), CONST (0x1C000-0x1D000))

    into the User Class box in the locate tab. This works as expected. I have created a user class with this:

    #pragma userclass (code = IAP) // generates CODE_IAP class

    According to the MAP file this worked. Buuuut when I add this:

    CODE_IAP (0x5000-0x6000)

    to the user class window I get a syntax error.

    Rich

  • First, do I have to manually locate every function when I want an entire portion of C code located in a certain area?

    You may use wildcards in the segment specifications. For example, ?PR?*?MYFILE selects all program segments from the MYFILE source file.

    The above results in a linker error L110 cannot find segment error.

    Compile and link without using the SEGMENTS directive. Scan thru the MAP file for the segment name to use. You should only specify the physical address. The C: prefix which is required in the 8051 tools is not allowed in the ARM tools (since memory is von Neumann).

    Jon

  • According to the MAP file this worked. Buuuut when I add this:

    CODE_IAP (0x5000-0x6000)

    to the user class window I get a syntax error.


    What version of the ARM tools are you using? I tried this with the V2 stuff and everything works just fine.

    You can download the V2 eval software from http://www.keil.com/demo.

    Jon

  • Richard,

    The user class stuff is definetly better that using wildcards with segment names.

    I think you have just a minor problem and you have entered it on the wrong place.


    Reinhard

  • Reinhard,
    You are correct on both counts, the classes are the way to go and I had to workout the details:

    #pragma .....

    plus class definition in LA Locate

    Thanks for the good support
    (Even now that I am on the "outside")

    Richard

  • I have this ALMOST working. I am writing a bootloader to update on-chip flash. I have the BL code located in an upper sector and it all works well except that the IAP calls result in a code fetch from sector 0 which has been erased. Although I was able to locate the BL code to an upper sector there is still a segment called ?PR?C?SDIV which remains. The pragma/User class method does not cover this segment. So I am back to trying to locate this segment manually and have had no luck so far.

    Rich