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

Developer

Forums

I've been trying for days now to get a working app onto a handset, compiled with RVCT 2.0.

The Visual Studio add-ins do not work with 2.0, and so I've been using the Realview Debugger/IDE to compile projects. This is compiling the project and linking everything into a .AXF file.

I can then run fromElf and convert the AXF file into a MOD. [If you read my other thread, the problems I was having with fromElf were caused by a missing entry in the license.dat file, which ARM support fixed for me]

However, every app I build returns the following error on the handset: Unknown Error (1)

The sig file is fine and classID compiled in the BID file matches that in the MIF. I've set entry point to AEEMod_Load. I've referenced the INC directory from the BREW SDK. But not even the hello world sample I have will run.

Please note that fromElf is working ok. I used it to convert an old ELF file to a MOD and that ran fine on the handset, so it's obviously a problem with my code, or the way I'm compiling/linking.

Can anyone help me? I'm getting close to throwing my pc out the window! :)

Below is the output from when I build (using BREW 2.0 SDK) which results in the .AXF file. I then use the following command to create the mod:

fromelf -bin -o hello.mod hello.axf

Thanks in advance for anyone who can assist me.

Matt

[Edit] Forgot to mention - all apps are running fine in the emulator.

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

make -f hello_Release.mk rebuild
for %d in ( Release\AEEAppGen.o Release\AEEModGen.o Release\hello.o Release\hello.axf none.lib) do if exist %d del %d

C:\Data\RealView\hello>if exist Release\AEEAppGen.o del Release\AEEAppGen.o

C:\Data\RealView\hello>if exist Release\AEEModGen.o del Release\AEEModGen.o

C:\Data\RealView\hello>if exist Release\hello.o del Release\hello.o

C:\Data\RealView\hello>if exist Release\hello.axf del Release\hello.axf

C:\Data\RealView\hello>if exist none.lib del none.lib
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c \
AEEAppGen.c -I..\..\..\brewsdk\active\inc\ -dwarf2 -O2 -o Release\AEEAppGen.o
Licence found.
Your trial started at: Wed Jan 21 00:00:00 2004
Your trial will end at: Sat Mar 06 23:59:59 2004
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c \
AEEModGen.c -I..\..\..\brewsdk\active\inc\ -dwarf2 -O2 -o Release\AEEModGen.o
Licence found.
Your trial started at: Wed Jan 21 00:00:00 2004
Your trial will end at: Sat Mar 06 23:59:59 2004
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c hello.c \
-I..\..\..\brewsdk\active\inc\ -dwarf2 -O2 -o Release\hello.o
Licence found.
"..\..\..\brewsdk\active\inc\AEEMenu.h", line 1775: Warning: #1-D: last line of file ends without a newline
=====================================================================*/
^
hello.c: 1 warning, 0 errors
Your trial started at: Wed Jan 21 00:00:00 2004
Your trial will end at: Sat Mar 06 23:59:59 2004
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armlink --entry AEEMod_Load -locals Release\AEEAppGen.o Release\AEEModGen.o Release\hello.o -o Release\hello.axf
Licence found.
Your trial started at: Wed Jan 21 00:00:00 2004
Your trial will end at: Sat Mar 06 23:59:59 2004
--- Build-all done ---
***

Quote:Originally posted by MattJ
However, every app I build returns the following error on the handset: Unknown Error (1)Such an ambiguous error message... See my response in this thread (http://brewforums.qualcomm.com/showthread.php?threadid=1535).
Also, I don't think you can compile to BREW 2.0 SDK with a v2.0 eval ARM compiler. You should use BREW 2.1 without any calls specific to BREW 2.1. See this thread (http://brewforums.qualcomm.com/showthread.php?threadid=3410
It looks like you're using an eval version of RVCT. I didn't know there was an eval version of RVCT?!?!
We tried using an ADS v2.0 eval, and it wouldn't compile some of the source. It said something about the source module being "too big for this version of the compiler."
--t

Quote:Originally posted by MattJ
However, every app I build returns the following error on the handset: Unknown Error (1)Such an ambiguous error message... See my response in this thread (http://brewforums.qualcomm.com/showthread.php?threadid=1535).
Also, I don't think you can compile to BREW 2.0 SDK with a v2.0 eval ARM compiler. You should use BREW 2.1 without any calls specific to BREW 2.1. See this thread (http://brewforums.qualcomm.com/showthread.php?threadid=3410
It looks like you're using an eval version of RVCT. I didn't know there was an eval version of RVCT?!?!
We tried using an ADS v2.0 eval, and it wouldn't compile some of the source. It said something about the source module being "too big for this version of the compiler."
--t

Don't set the entry point -- the BREW Application Execution Environment provides the entry point.
just use -first AEEModLoad on your linker command line, instead of -entry AEEModLoad.

Don't set the entry point -- the BREW Application Execution Environment provides the entry point.
just use -first AEEModLoad on your linker command line, instead of -entry AEEModLoad.

IT'S WORKING!!!
Firstly, thanks very much Murray. Changing from 'entry' to 'first' was part of the solution.
I'd also missed a few other settings. I'd been working through a sample make file for ADS 1.0.1 and changing the appropriate settings in the Realview Debugger Project Properties, but managed to miss the APCS options (interwork/ropi/norwpi)
[I changed both these things at the same time, so I'm not sure whether both would cause the crash I was seeing]
To help out anyone else using the RVCT 2.0 Realview Debugger to compile projects, here are the appropriate extracts from my working project file (NOTE: uses both C and C++ modules). The key names match directly to the section names in the Project Properties, so just set them as shown below and you should be fine:
...
type_=Standard
processor_=ARM-C2
description="Standard project"
[SETTINGS]
[CONFIGURATION]
config=Debug
config=Release
config=DebugRel
[COMPILE=arm]
%Release%Compilation.generate_debug=disabled
%Release%Optimization.debug_optimize=full
%DebugRel%Optimization.debug_optimize=partial
Preprocessor.include="..\..\..\brewsdk\active\inc\"
Compilation.ELF_section_per_fn=enabled
Compilation.APCS.interworking=enabled
Compilation.APCS.ropi=enabled
Compilation.APCS.rwpi=disabled
Compilation.Alignment.struct_align=4
Optimization.speed_vs_space=space
Sources.files=""AEEModGen.c""
Sources.files=""AEEAppGen.c""
Compilation.Checking.data_flow=enabled
Optimization.cpu=ARM7TDMI
[COMPILE=arm_cpp]
Sources.files=""BrewEng.cpp""
Compilation.compiler=ARM_Cpp
%Release%Compilation.generate_debug=disabled
%Release%Optimization.debug_optimize=full
%DebugRel%Optimization.debug_optimize=partial
Preprocessor.include=""..\..\..\brewsdk\active\inc\""
Sources.files=""BrewBitmap.cpp""
Compilation.ELF_section_per_fn=enabled
Compilation.Checking.data_flow=enabled
Compilation.APCS.interworking=enabled
Compilation.APCS.ropi=enabled
Compilation.APCS.rwpi=disabled
Compilation.Alignment.struct_align=4
Optimization.cpu=ARM7TDMI
...
(irrelevant thumb and assembly stuff here)
...
[BUILD]
application=""breweng.axf""
makefile=""breweng.mk""
Link_Advanced.ropi=enabled
Link_Advanced.rwpi=enabled
Link_Advanced.first=""AEEMod_Load""
The settings above produce a .AXF file which (once I fromElf -bin -o breweng.mod breweng.axf) produces a .MOD that runs on my Kyocera KZ850 (only handset I've tested on so far, but it should work fine on all of them)
The compiler and linker command lines that results from those settings are as follows:
(example C module)
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c AEEAppGen.c -I..\..\..\brewsdk\active\inc\ -g+ -dwarf2 -zo -fa --apcs /interwork --apcs /ropi --apcs /norwpi -Ospace --cpu ARM7TDMI -o Debug\AEEAppGen.o
(example C++ module)
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c BrewEng.cpp -I..\..\..\brewsdk\active\inc\ --cpp -g+ -dwarf2 -zo -fa --apcs /interwork --apcs /ropi --apcs /norwpi --cpu ARM7TDMI -o Debug\BrewEng.o
(example link that links two C++ modules, breweng and brewbitmap, with the standard aeemodgen and aeeappgen)
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armlink -ropi -rwpi --first AEEMod_Load -locals Debug\AEEModGen.o Debug\AEEAppGen.o Debug\BrewEng.o Debug\BrewBitmap.o
I haven't double-checked to see whether there are still some settings that I missed when comparing against the old ADS makefile, but these settings produce code that runs on a handset.
Whether you use makefiles and the command line, or the Realview Debugger, the above should get you up-and-running.
I hope this information saves any fellow BREW newbs some time in the future :)
Matt
p.s. Tom, thanks for the replies and links. I've not encountered any size limitations with the trial version of RVCT 2.0 (which you can get ARM dealers to send you on CD, by the way, but you can't download it) But I've only been working with small test projects so far. I've also been compiling using the BREW 2.0 SDK without a problem, so the ADS1.2 issues must have been fixed for RVCT."

IT'S WORKING!!!
Firstly, thanks very much Murray. Changing from 'entry' to 'first' was part of the solution.
I'd also missed a few other settings. I'd been working through a sample make file for ADS 1.0.1 and changing the appropriate settings in the Realview Debugger Project Properties, but managed to miss the APCS options (interwork/ropi/norwpi)
[I changed both these things at the same time, so I'm not sure whether both would cause the crash I was seeing]
To help out anyone else using the RVCT 2.0 Realview Debugger to compile projects, here are the appropriate extracts from my working project file (NOTE: uses both C and C++ modules). The key names match directly to the section names in the Project Properties, so just set them as shown below and you should be fine:
...
type_=Standard
processor_=ARM-C2
description="Standard project"
[SETTINGS]
[CONFIGURATION]
config=Debug
config=Release
config=DebugRel
[COMPILE=arm]
%Release%Compilation.generate_debug=disabled
%Release%Optimization.debug_optimize=full
%DebugRel%Optimization.debug_optimize=partial
Preprocessor.include="..\..\..\brewsdk\active\inc\"
Compilation.ELF_section_per_fn=enabled
Compilation.APCS.interworking=enabled
Compilation.APCS.ropi=enabled
Compilation.APCS.rwpi=disabled
Compilation.Alignment.struct_align=4
Optimization.speed_vs_space=space
Sources.files=""AEEModGen.c""
Sources.files=""AEEAppGen.c""
Compilation.Checking.data_flow=enabled
Optimization.cpu=ARM7TDMI
[COMPILE=arm_cpp]
Sources.files=""BrewEng.cpp""
Compilation.compiler=ARM_Cpp
%Release%Compilation.generate_debug=disabled
%Release%Optimization.debug_optimize=full
%DebugRel%Optimization.debug_optimize=partial
Preprocessor.include=""..\..\..\brewsdk\active\inc\""
Sources.files=""BrewBitmap.cpp""
Compilation.ELF_section_per_fn=enabled
Compilation.Checking.data_flow=enabled
Compilation.APCS.interworking=enabled
Compilation.APCS.ropi=enabled
Compilation.APCS.rwpi=disabled
Compilation.Alignment.struct_align=4
Optimization.cpu=ARM7TDMI
...
(irrelevant thumb and assembly stuff here)
...
[BUILD]
application=""breweng.axf""
makefile=""breweng.mk""
Link_Advanced.ropi=enabled
Link_Advanced.rwpi=enabled
Link_Advanced.first=""AEEMod_Load""
The settings above produce a .AXF file which (once I fromElf -bin -o breweng.mod breweng.axf) produces a .MOD that runs on my Kyocera KZ850 (only handset I've tested on so far, but it should work fine on all of them)
The compiler and linker command lines that results from those settings are as follows:
(example C module)
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c AEEAppGen.c -I..\..\..\brewsdk\active\inc\ -g+ -dwarf2 -zo -fa --apcs /interwork --apcs /ropi --apcs /norwpi -Ospace --cpu ARM7TDMI -o Debug\AEEAppGen.o
(example C++ module)
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armcc -c BrewEng.cpp -I..\..\..\brewsdk\active\inc\ --cpp -g+ -dwarf2 -zo -fa --apcs /interwork --apcs /ropi --apcs /norwpi --cpu ARM7TDMI -o Debug\BrewEng.o
(example link that links two C++ modules, breweng and brewbitmap, with the standard aeemodgen and aeeappgen)
C:\ARM\RVCT\Programs\2.0.1\228\eval1-sc\win_32-pentium\armlink -ropi -rwpi --first AEEMod_Load -locals Debug\AEEModGen.o Debug\AEEAppGen.o Debug\BrewEng.o Debug\BrewBitmap.o
I haven't double-checked to see whether there are still some settings that I missed when comparing against the old ADS makefile, but these settings produce code that runs on a handset.
Whether you use makefiles and the command line, or the Realview Debugger, the above should get you up-and-running.
I hope this information saves any fellow BREW newbs some time in the future :)
Matt
p.s. Tom, thanks for the replies and links. I've not encountered any size limitations with the trial version of RVCT 2.0 (which you can get ARM dealers to send you on CD, by the way, but you can't download it) But I've only been working with small test projects so far. I've also been compiling using the BREW 2.0 SDK without a problem, so the ADS1.2 issues must have been fixed for RVCT."

fromElf? Is that something that comes with BREW SDK or the ARM Compiler?
I used to use ARM 1.2 without problem but all of a sudden a new project refused to link. Ie. the entire Metrowerk IDE/ARM stuff just hung trying to make the .axf file.

fromElf? Is that something that comes with BREW SDK or the ARM Compiler?
I used to use ARM 1.2 without problem but all of a sudden a new project refused to link. Ie. the entire Metrowerk IDE/ARM stuff just hung trying to make the .axf file.

FromElf came with RVCT 2.0
It's the utility that converts the AXF file into a MOD for upload onto the handset.

FromElf came with RVCT 2.0
It's the utility that converts the AXF file into a MOD for upload onto the handset.

Yeah, it is staring right at me...talk about needed new glasses.
Anyway, anyone got their ADS 1.2 to hang on Windows 2000 or XP while making the .axf?
On the XP machine, it totally crashed, on the 2000, it worked a couple of times, but I see no MOD file, why why? DARN...this used to work, and I must have mucked something up...
Now, even on the 2000 I cannot link the axf...the machine / compiler / linker just hung...anyone knows if there is a bad settings that one should avoid?
Thanks...
Quote:Originally posted by coder
fromElf? Is that something that comes with BREW SDK or the ARM Compiler?
I used to use ARM 1.2 without problem but all of a sudden a new project refused to link. Ie. the entire Metrowerk IDE/ARM stuff just hung trying to make the .axf file.

Yeah, it is staring right at me...talk about needed new glasses.
Anyway, anyone got their ADS 1.2 to hang on Windows 2000 or XP while making the .axf?
On the XP machine, it totally crashed, on the 2000, it worked a couple of times, but I see no MOD file, why why? DARN...this used to work, and I must have mucked something up...
Now, even on the 2000 I cannot link the axf...the machine / compiler / linker just hung...anyone knows if there is a bad settings that one should avoid?
Thanks...
Quote:Originally posted by coder
fromElf? Is that something that comes with BREW SDK or the ARM Compiler?
I used to use ARM 1.2 without problem but all of a sudden a new project refused to link. Ie. the entire Metrowerk IDE/ARM stuff just hung trying to make the .axf file.

Ok...I blew away the "project" and restarted and ADS 1.2 is linking again, but I just cannot get a .mod file. I set the fromElf to plain binary and set a path with a filename, but alas, no .mod file.
This is all done from the Metrowerk IDE. I can see the .axf and the output messages indicate everything is alright, but I can't find my .mod file...
Heelpp...thanks...
Quote:Originally posted by coder
Yeah, it is staring right at me...talk about needed new glasses.
Anyway, anyone got their ADS 1.2 to hang on Windows 2000 or XP while making the .axf?
On the XP machine, it totally crashed, on the 2000, it worked a couple of times, but I see no MOD file, why why? DARN...this used to work, and I must have mucked something up...
Now, even on the 2000 I cannot link the axf...the machine / compiler / linker just hung...anyone knows if there is a bad settings that one should avoid?
Thanks...

Ok...I blew away the "project" and restarted and ADS 1.2 is linking again, but I just cannot get a .mod file. I set the fromElf to plain binary and set a path with a filename, but alas, no .mod file.
This is all done from the Metrowerk IDE. I can see the .axf and the output messages indicate everything is alright, but I can't find my .mod file...
Heelpp...thanks...
Quote:Originally posted by coder
Yeah, it is staring right at me...talk about needed new glasses.
Anyway, anyone got their ADS 1.2 to hang on Windows 2000 or XP while making the .axf?
On the XP machine, it totally crashed, on the 2000, it worked a couple of times, but I see no MOD file, why why? DARN...this used to work, and I must have mucked something up...
Now, even on the 2000 I cannot link the axf...the machine / compiler / linker just hung...anyone knows if there is a bad settings that one should avoid?
Thanks...

Ok...just replying to myself today in case it benefits someone:-)
In the IDE, there is a post linker config, and this one has to be set to fromElf in order to automatically create .mod...
However, I am still tearing my hair out...My mod keeps crashing on the T720 and we are talking about a recompilation of the RoadWarrior using 1.1.0.18...
Anyone has an authoritative list of options for the compiler and linker for ADS 1.2?
I must have tried most combo of ropi/rwpi/first/entry/blabla...
By the way, what's the "RO Base Address"? Should that stay at 0x8000 or reset to 0?
Thanks...

Ok...just replying to myself today in case it benefits someone:-)
In the IDE, there is a post linker config, and this one has to be set to fromElf in order to automatically create .mod...
However, I am still tearing my hair out...My mod keeps crashing on the T720 and we are talking about a recompilation of the RoadWarrior using 1.1.0.18...
Anyone has an authoritative list of options for the compiler and linker for ADS 1.2?
I must have tried most combo of ropi/rwpi/first/entry/blabla...
By the way, what's the "RO Base Address"? Should that stay at 0x8000 or reset to 0?
Thanks...

In case someone wonders, RoadWarrior crashes immediately...just a black restart screen and nothing else.
When I used the pre-built .mod, it worked great.

In case someone wonders, RoadWarrior crashes immediately...just a black restart screen and nothing else.
When I used the pre-built .mod, it worked great.

Here are my settings (2 apps passed TBT):
Compiler Equivalent Command Line (ARM C++ Compiler)
-embeddedcplusplus -O2 -apcs /interwork/ropi -Wa -Ef -DDYNAMIC_APP
Compiler Equivalent Command Line (Thumb C++ Compiler)
-embeddedcplusplus -O2 -apcs /interwork/ropi -Wabx -DDYNAMIC_APP
Linker Equivalent Command Line:
-remove (dbg) -info totals -map -verbose -first AEEMod_Load -rwpi -nodebug -info sizes -ropi
Just copy these command lines into the space provided in the Settings dialog in CodeWarrior.

Here are my settings (2 apps passed TBT):
Compiler Equivalent Command Line (ARM C++ Compiler)
-embeddedcplusplus -O2 -apcs /interwork/ropi -Wa -Ef -DDYNAMIC_APP
Compiler Equivalent Command Line (Thumb C++ Compiler)
-embeddedcplusplus -O2 -apcs /interwork/ropi -Wabx -DDYNAMIC_APP
Linker Equivalent Command Line:
-remove (dbg) -info totals -map -verbose -first AEEMod_Load -rwpi -nodebug -info sizes -ropi
Just copy these command lines into the space provided in the Settings dialog in CodeWarrior.

I got my installation working by going through the sample CppAppTemplate.mak file (found in the src folder of the BREW SDK) This shows all the settings required for compiling and linking a C++ app and each line is commented.
The sample mak is aimed at ADS 1.0.1. so I imagine they will be very similar, if not identical, to the options you need to use.
I can't help with the RO Base Address question. Not sure what it is or does. But I can tell you that I didn't make any changes to it.
I feel your pain - I was in a similar situation trying to get RVCT working. Hope you sort it out soon!

I got my installation working by going through the sample CppAppTemplate.mak file (found in the src folder of the BREW SDK) This shows all the settings required for compiling and linking a C++ app and each line is commented.
The sample mak is aimed at ADS 1.0.1. so I imagine they will be very similar, if not identical, to the options you need to use.
I can't help with the RO Base Address question. Not sure what it is or does. But I can tell you that I didn't make any changes to it.
I feel your pain - I was in a similar situation trying to get RVCT working. Hope you sort it out soon!

What makes it more painful is that I had a setup that worked perfectly, even for the 3586i and its big endian...now, nothing works and the ADS keep hanging on the .axf linking part...pheew...
I am going to give it another run tomorrow and I'll post what I find.
I mean, my app runs, I know that because I also use G++ and it works great.
Maybe it's time to go for the RVT 2.0. You got a good link / number to a reliable dealer?
Thanks...
Quote:Originally posted by MattJ
I got my installation working by going through the sample CppAppTemplate.mak file (found in the src folder of the BREW SDK) This shows all the settings required for compiling and linking a C++ app and each line is commented.
The sample mak is aimed at ADS 1.0.1. so I imagine they will be very similar, if not identical, to the options you need to use.
I can't help with the RO Base Address question. Not sure what it is or does. But I can tell you that I didn't make any changes to it.
I feel your pain - I was in a similar situation trying to get RVCT working. Hope you sort it out soon!

What makes it more painful is that I had a setup that worked perfectly, even for the 3586i and its big endian...now, nothing works and the ADS keep hanging on the .axf linking part...pheew...
I am going to give it another run tomorrow and I'll post what I find.
I mean, my app runs, I know that because I also use G++ and it works great.
Maybe it's time to go for the RVT 2.0. You got a good link / number to a reliable dealer?
Thanks...
Quote:Originally posted by MattJ
I got my installation working by going through the sample CppAppTemplate.mak file (found in the src folder of the BREW SDK) This shows all the settings required for compiling and linking a C++ app and each line is commented.
The sample mak is aimed at ADS 1.0.1. so I imagine they will be very similar, if not identical, to the options you need to use.
I can't help with the RO Base Address question. Not sure what it is or does. But I can tell you that I didn't make any changes to it.
I feel your pain - I was in a similar situation trying to get RVCT working. Hope you sort it out soon!

Well I'm in Australia and ordered the 45-day trial CD from a New Zealand company called Bluewater Systems. It arrived in about 2 days and the staff were helpful, so I'd recommend them if you're over in this part of the world.

Well I'm in Australia and ordered the 45-day trial CD from a New Zealand company called Bluewater Systems. It arrived in about 2 days and the staff were helpful, so I'd recommend them if you're over in this part of the world.