how to define starting point in the project?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to define starting point in the project?

1,844 Views
Veter
Contributor I
I am using CodeWarrior for ColdFire version 6.4.
My target is MCF5307.
The project was before created using DIAB compiler.
It has an entry point:
PSECT
XDEF start
ALIGN 4
 
; Boot code section definition: 4 byte alignment, read-only data, & executable code
.section ".text",4 ;rx
start:
    nop
    nop
    nop
    nop
; initialize a5 to sdata (provided by linker)
    move.l #__SDA_BASE_,a5
   
; initialize the stack pointer
    move.l  #__SRAM_END, a7
    jsr _initRegisters     ; jump to the function that will initialize the remaining registers
 
 ; we will never reach this point as initRegisters never returns! 
    jsr _main
 
I have a problem building project in CW for "start" initialization is not recognized.
Is there any alternative to start point initialization in CW?
PSECT
XDEF start
ALIGN 4
 
I tried using .global statement with start: and the substituded three lines above with one:
.global start
However, when running in debugger I get: "__start" is not recognized error.
Please help.
 
 
 
Labels (1)
0 Kudos
Reply
2 Replies

552 Views
CrasyCat
Specialist III
Hello
 
Did you specify your entry point is start?
Per default the linker will use __start as application entry point. You need to tell him you are using another function as entry point.
 
This needs to be specified in the Target settings "Coldfire Linker" panel.
 
CrasyCat
0 Kudos
Reply

552 Views
Veter
Contributor I
I did specified that my entry point is start.
The problem is that in file "startup.s" the starting point initialized with syntax for DIAB compiler. I am looking for alternative in CW for ColdFire. Please see attached "startup.s" file.
 
Thank you for your help!
0 Kudos
Reply