Author Topic: How to use Sourcery g++ to compile uTasker1.4 for M52259DEMO?  (Read 9707 times)

Offline epl

  • Newbie
  • *
  • Posts: 2
    • View Profile
HI~
I try to use Sourcery g++ Lite to compile the uTasker1.4 for M52259 Demo board, but it doesn't work.
After download the code to Demo board, it  reset repetitively.

what i have done is as follow
1. edit config.h open the M52259DEMO setting , active the _M5225X setting and disable the SDcard support
       #define _M5225X  
    &
      //#define M52259EVB                                                // EVB Board for M52259
        #define M52259DEMO                                               // DEMO Board for M52259
    &
      //#define SDCARD_SUPPORT  

2.click the batch file to compile the uTasker
        uTaskerV1.4_M522XX\Applications\uTaskerV1.4\GNU_ColdFire\Build_M5223X.bat

3.download the uTaskerV1.4.s19 to the M52259DEMO board, using CW Flash programmer

Is there anything i missing?? thanks.

(ps. use the CW to compile the uTasker1.4 is working on the M52259DEMO board)
« Last Edit: July 28, 2010, 02:57:34 PM by epl »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: How to use Sourcery g++ to compile uTasker1.4 for M52259DEMO?
« Reply #1 on: July 30, 2010, 10:54:50 PM »
Hi

Please check the make file used. When linking, it uses one of the linker script files and it is possible that it is using one that doesn't match.

For example:
   $(CC) -mcpu=52235 -nostartfiles -Wall -Wstrict-prototypes $(INC) -D _GNU -D _M5223X -g -Os -Wl,-Map=uTaskerV1.4.map -Tm5225XUSB-rom.ld -o uTaskerV1.4.elf $(OBJS)

Another option is to use m52235evb-rom.ld.

Also check the linker script content since it may have some option which needs to be adjusted for the exact part used (like size of SRAM or size of FLASH). A mismatch in such settings can cause a failure.

When using CW there are a number of targets defined and these select a specific linker script (see the dot next to the active one when you compile the working project and then compare with the content of the one used by the GCC linker).

Regards

Mark

Offline epl

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: How to use Sourcery g++ to compile uTasker1.4 for M52259DEMO?
« Reply #2 on: August 04, 2010, 07:22:48 PM »
Hi~

Compare to the makefile of uTaskerSerialBoot project (it work on the M52259DEMO board).
I try to change the linker script from m5225XUSB-rom.ld to m52235evb-rom.ld, but it still not work.

About the linker script, I try to compare it to the M52235EVB_FLASH.lcf of CW setting.
But i don't understand that.@@

Compare the file used by  CW to GCC, the "flash_config.s" only use in the CW. Is it right??

(I don't understand  "the dot next to the active one ". what dose it mean??)

Thanks.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: How to use Sourcery g++ to compile uTasker1.4 for M52259DEMO?
« Reply #3 on: August 04, 2010, 10:21:28 PM »
Hi

The GCC startup file Startup_gnu.s contains the flash_config.s content and so doesn't use a second file

/* 0x98..fill out with zeros - add general purpose assembler in this space if required */
    .rept 256-45
    .long 0x00000000                                                  /* fill unused area */
    .endr
/* 0x400..0x417 is used to configure FLASH controller on initialisation  */
   .rept 265-257
   .long 0x00000000                                                  /* flash initialisation range - must be zero */
   .endr


Below is the view in CW showing the M5223X_ROM target selected. If you look at the list of *.lcf files you will see that only M52235EVB_FLASH.lcf has a dot to the right of it in the target column. This indicates that it is used when this target is selected and the others are not.

Regards

Mark