Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hello all,

I am using BREW 3.1.5 SDK, Visual Studio 2005 as my IDE, and RVCT 3.0 as my compiler.

In my Handset spesification, it is clear written that my handset processor is ARM9 processor.

For the first time, my makefile is generated for ARM7, it is signed by

--CPU ARM7TDMI

So, i tried to changed that parameter into:

--CPU ARM926EJ-S

then, My_app.MOD file is successfully generated...
But, when i runned that MOD file in my handset, my handset got crashed....:confused:

What happend ??

I tried all CPU parameter value:
The following arguments to option 'cpu' can be selected:
--cpu=4T
--cpu=5TE
--cpu=6
--cpu=ARM7TDMI
--cpu=ARM720T
--cpu=ARM7TDMI-S
--cpu=ARM926EJ-S
--cpu=ARM1136J-S

But, it is the same...:confused::(

Please Help me solve this Problem.....

=========this is my sample of Makefile==========

BREW_HOME =$(BREWDIR)
ARM_HOME =$(ARMHOME)
TARGET =my_app
OBJS =AEEAPP~1.o AEEMED~1.o AEEMOD~1.o my_app.o
APP_INCLUDES =-I $(BREWDIR)\inc

#-------------------------------------------------------------------------------
# Target file name and type definitions
#-------------------------------------------------------------------------------

EXETYPE = elf # Target image file format
MODULE = mod # Downloadable module extension

#-------------------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a dynamic app.
#-------------------------------------------------------------------------------

DYNAPP = -DDYNAMIC_APP

#-------------------------------------------------------------------------------
# Software tool and environment definitions
#-------------------------------------------------------------------------------

AEESRCPATH = $(BREW_HOME)\src
AEEINCPATH = $(BREW_HOME)\inc

#ARMBIN = $(ARM_HOME)\bin # ARM ADS application directory
#ARMINC = $(ARM_HOME)\include # ARM ADS include file directory
#ARMLIB = $(ARM_HOME)\lib # ARM ADS library directory

ARMBIN = C:\PROGRA~1\ARM\RVCT\Programs\3.0\970\brew\win_32-pentium # ARM ADS application directory
ARMINC = C:\PROGRA~1\ARM\RVCT\Data\3.0\900\include # ARM ADS include file directory
ARMLIB = C:\PROGRA~1\ARM\RVCT\Data\3.0\900\lib # ARM ADS library directory

ARMCC = $(ARMBIN)\armcc # ARM ADS ARM 32-bit inst. set ANSI C compiler
LD = $(ARMBIN)\armlink # ARM ADS linker
HEXTOOL = $(ARMBIN)\fromelf # ARM ADS utility to create hex file from image

OBJ_CMD = -o # Command line option to specify output filename

#-------------------------------------------------------------------------------
# Processor architecture options
#-------------------------------------------------------------------------------

#CPU = -cpu ARM7TDMI # ARM7TDMI target processor
CPU = -cpu ARM926EJ-S # ARM7TDMI target processor

#-------------------------------------------------------------------------------
# ARM Procedure Call Standard (APCS) options
#-------------------------------------------------------------------------------

#ROPI = ropi # Read-Only(code) Position independence
#ROPI =
INTERWRK = interwork # Allow ARM-Thumb interworking

APCS = -apcs /$(ROPI)/$(INTERWRK)/norwpi

#-------------------------------------------------------------------------------
# Additional compile time error checking options
#-------------------------------------------------------------------------------

#CHK = -fa # Check for data flow anomolies
CHK = -O0

#-------------------------------------------------------------------------------
# Compiler output options
#-------------------------------------------------------------------------------

OUT = -c # Object file output only

#-------------------------------------------------------------------------------
# Compiler/assembler debug options
#-------------------------------------------------------------------------------

DBG = -g # Enable debug

#-------------------------------------------------------------------------------
# Compiler optimization options
#-------------------------------------------------------------------------------

#OPT = -Ospace -O2 # Full compiler optimization for space
OPT = -O2

#-------------------------------------------------------------------------------
# Compiler code generation options
#-------------------------------------------------------------------------------

END = -littleend # Compile for little endian memory architecture
ZA = -zo # LDR may only access 32-bit aligned addresses

CODE = $(END) $(ZA)

#-------------------------------------------------------------------------------
# Include file search path options
#-------------------------------------------------------------------------------

INC = -I. -I$(AEEINCPATH) $(APP_INCLUDES)

#-------------------------------------------------------------------------------
# Compiler pragma emulation options
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# Linker options
#-------------------------------------------------------------------------------

LINK_CMD = -o #Command line option to specify output file
#on linking

ROPILINK = -ropi #Link image as Read-Only Position Independent

LINK_ORDER = -first AEEMod_Load

#-------------------------------------------------------------------------------
# HEXTOOL options
#-------------------------------------------------------------------------------

BINFORMAT = -bin

#-------------------------------------------------------------------------------
# Compiler flag definitions
#-------------------------------------------------------------------------------

CFLAGS0 = $(OUT) $(DYNAPP) $(CPU) $(APCS) $(CODE) $(CHK) $(DBG)
CFLAGS = $(CFLAGS0) $(OPT)

#-------------------------------------------------------------------------------
# Linker flag definitions
#-------------------------------------------------------------------------------

# the -entry flag is not really needed, but it keeps the linker from reporting
# warning L6305W (no entry point). The address
LFLAGS = $(ROPILINK) -rwpi -entry 0x8000#

#----------------------------------------------------------------------------
# Default target
#----------------------------------------------------------------------------

all : $(TARGET).$(MODULE)

#----------------------------------------------------------------------------
# Clean target
#----------------------------------------------------------------------------

# The object subdirectory, target image file, and target hex file are deleted.

clean :
@echo ---------------------------------------------------------------
@echo CLEAN
-del /f $(OBJS)
-del /f $(TARGET).$(EXETYPE)
-del /f $(TARGET).$(MODULE)
@echo ---------------------------------------------------------------

#===================
# DEFAULT SUFFIX RULES

SRC_FILE = $(@F:.o=.c) # Input source file specification
OBJ_FILE = $(OBJ_CMD) $(@F) # Output object file specification

.SUFFIXES :
.SUFFIXES : .o .dep .c

#--------------------------------------------------------------------------
# C code inference rules
#----------------------------------------------------------------------------

.c.o:
@echo -----
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(SRC_FILE)
@echo -----

.c.mix:
@echo -------
@echo OBJECT $(@F)
$(ARMCC) -S -fs $(CFLAGS) $(INC) $(OBJ_FILE) $<
@echo -----

{$(AEESRCPATH)}.c.o:
@echo ----------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(AEESRCPATH)\$(SRC_FILE)
@echo ---------

#======================
# MODULE SPECIFIC RULES

APP_OBJS = $(OBJS)

# Lib file targets
#----------------------------------------------------------------------------

$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET $@
$(HEXTOOL) $(TARGET).$(EXETYPE) $(BINFORMAT) $(TARGET).$(MODULE)

$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET $@
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LFLAGS) $(APP_OBJS) $(LINK_ORDER)

#----------------------------------------------------------------------------
# Applet Specific Rules
#----------------------------------------------------------------------------

RULE1 = c:\PROGRA~1\BREW31~1.5\sdk\src
{$(RULE1)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(RULE1)\$(SRC_FILE)
@echo ---------------------------------------------------------------

RULE2 = d:\DATAUS~1\VISUAL~1\Projects\FLEXI_~4\FLEXI_~1
{$(RULE2)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(RULE2)\$(SRC_FILE)
@echo ---------------------------------------------------------------

# --------------------------------------------
# DEPENDENCY LIST, DO NOT EDIT BELOW THIS LINE
# --------------------------------------------

.....................i don't post this part

Do you mean MOD generated for ARM7 works but one for ARM9 crashes?

Do you mean MOD generated for ARM7 works but one for ARM9 crashes?

when i am using GNUDE as my compiler and CPU = ARM7TDMI, the MOD file run well :)
But...
when i am using RVCT 3.0 as my compiler, MOD file cause my handset Crash for CPU = ARM7TDMI, CPU = ARM9, CPU = ARM11, CPU = 5TEJ, etc (for all options)....i am so Confused....:confused:
Please Help Me...

when i am using GNUDE as my compiler and CPU = ARM7TDMI, the MOD file run well :)
But...
when i am using RVCT 3.0 as my compiler, MOD file cause my handset Crash for CPU = ARM7TDMI, CPU = ARM9, CPU = ARM11, CPU = 5TEJ, etc (for all options)....i am so Confused....:confused:
Please Help Me...

When did it crash? Did you debug using DBGPRINTFs? Are you using static/global data? If yes, Use Elf2Mod to generate mod and try.

When did it crash? Did you debug using DBGPRINTFs? Are you using static/global data? If yes, Use Elf2Mod to generate mod and try.

Thank you for replying,
It compiled perfectly using the ARMmake button in the brew 3.15 plugin for MVS 2005, and the mod file has been generated by modifying the .mak file and using the command "nmake -f myapp.mak".
I didn't use static/global data....
But the prototype of functions or procedure that i created is using static syntax, e.g "static void myprocedure(int x, int y)". what do you think about this?
And..there is no elf2mod.exe in my computer, just fromelf.exe or BREWelf2mod.exe....
It crashed when i click the application icon in the brew appmanager in my handset, and the handset restarted by itself.

Thank you for replying,
It compiled perfectly using the ARMmake button in the brew 3.15 plugin for MVS 2005, and the mod file has been generated by modifying the .mak file and using the command "nmake -f myapp.mak".
I didn't use static/global data....
But the prototype of functions or procedure that i created is using static syntax, e.g "static void myprocedure(int x, int y)". what do you think about this?
And..there is no elf2mod.exe in my computer, just fromelf.exe or BREWelf2mod.exe....
It crashed when i click the application icon in the brew appmanager in my handset, and the handset restarted by itself.

Not necessarily a ARM compilation issue. Can you analyze the Brew logs - to see if you are getting EVT_APP_START and where exactly it is crashing?
May be useful:
http://www.brewdevelopers.net/brew_bnry/pdf/brew_2008/PROG-601.pdf

Not necessarily a ARM compilation issue. Can you analyze the Brew logs - to see if you are getting EVT_APP_START and where exactly it is crashing?
May be useful:
http://www.brewdevelopers.net/brew_bnry/pdf/brew_2008/PROG-601.pdf

I've solved that problem...
the problem happened because i separated my code in two file
- myapp.c
- myapp.h = for function prototype, and other variable definition
when, i combine that code in just one file, that is myapp.c....the MOD file works well.:)
But, i still don't know why this can happen ??
Could you please explain this phenomena to me ??
thank you very much..

I've solved that problem...
the problem happened because i separated my code in two file
- myapp.c
- myapp.h = for function prototype, and other variable definition
when, i combine that code in just one file, that is myapp.c....the MOD file works well.:)
But, i still don't know why this can happen ??
Could you please explain this phenomena to me ??
thank you very much..

You can have multiple source/header files; that shouldn't affect the mod file. Not sure, why it happened.

You can have multiple source/header files; that shouldn't affect the mod file. Not sure, why it happened.