ARM Development Studio sometime fails to load symbols from IAR ELF - arm

I am building an ELF using IAR 9.40. (although I have had the same problem with earlier versions of IAR). I am debugging using ARM Development Studio and an ARM DStream. The target is a Cortex-R7.
The problem is that sometime when I build, the debugger works fine and other times I get the following error:
ERROR(CMD685-COR11-IMG55):
! Failed to load symbols for "MyIARApp.elf"
! Failed to read the symbols from C:\Data\MyIARApp.elf
! Failed while reading from the file {0}
I have spent ages trying to resolve the issue, bit it looks like IAR sometimes creates an ELF in a format that ARM Development Studio cannot work with. I have tried building with no --no_dwarf4 but it makes no difference.
Any ideas? Thanks.

Related

Configure GDB to accept Cross-Compiled executables?

I'm still a newbie to assembly language and cross-compiling etc. I've already googled the problem I'm having and seen a few similar posts but none of them solved my problem unfortunately.
We're learning ARM32 Syntax at the university and playing around with assembly code on AARCH64 machines on a uni server. So we need to cross-compile the .s files to be able to run them.
We use the command arm-linuxgnueabihf-gcc to cross-compile.
Now the system (the loader I guess) is configured properly to execute these 32-bit cross executables. When I tried to debug a 32b exec however GDB crashes with error: selected architecture armv7 is not compatible with reported target architecture aarch64
There are screenshots below that illustrate the problem. Thanks for any help!
System infos:
System info
No error with native compiler:
No error with native compiler
Error with cross-compilation:
Error with cross-compilation

Building and debugging ARMV8 assembler applications on Windows

I'm trying to learn ARMV8 assembler, and am trying to build a test application on Windows. I've installed ARM DS-5 Community Edition, version 5.26.2. After much hair pulling trying to install toolchains, I finally installed the "mingw32" toolchain here: here. This seems to work - I am now able to compile and link my application (which consists of a single c file and a .s assembly file. The target created is a ".axf" file.
But I am unable to debug. I have my debugger set to "\gcc-linaro-6.3.1-2017.02-i686-mingw32_aarch64-linux-gnu\bin\aarch64-linux-gnu-gdb.exe", out of the directory where I downloaded the toolchain. gdb starts up, but I get the error below:
Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Don't know how to run. Try "help target".
Don't know how to run. Try "help target".
Any suggestions? Frankly, I don't really know what I'm doing here. I'm not sure I set up the toolchain properly. The problem is I can't find any documentation on how to do this in windows.
Thanks in advance!

Buildroot ARM Toolchain for arm7tdmi to compile SourceForge Archopen

I'm interested in compiling the sourceforge project https://svn.code.sf.net/p/archopen/code/ArchOpen/trunk/, and more especifically the app AOnes, which is a NES emulator for Archos Gmini 400 (Inactive old project)
Analyzing the source code, I saw that the Gmini400 is an arm7tdmi device, no MMU and the toolchain used to compile was a buildroot one named arm-linux-nofpu.
I supposed (according to the buildroot-2009-02 menuconfig) that no-fpu means soft floating point, so i tried to build such a toolchain.
I build a toolchain with buildroot-2013-02 (both year 2009 and 2010 don't work for me) with the following options:
arm7tdmi
no MMU
Software Floating Point
Enable elf2flt support (i saw there were such a reference in the
Makefile of ArchOpen)
I let the other options as they were and made the build.
I made a checkout of ArchOpen, launch the configuration script to choose Gmini4XX as the target (and not Gmini 402 chich is quite different), selected to defaut.rules and edit the resulting Makefile.conf to adapt the tools paths and names (as my generated toolchain name is different)
First error:
[thread.o]
{standard input}: Assembler messages:
{standard input}:1236: Error: Rn must not overlap other operand -- swpb r0,r3,[r0]
Well, this code is supposed to be working, but i opened thread.h and corrected the source to pass through (adding a "&")
Second error:
undefined reference to __aeabi_idivmod and undefined reference to __aeabi_ldivmod
As google says, it seems to be a -lgcc missing problem.
I edited the wav folder makefile to add -lgcc and specified -L/lib_folder_of_my_toolchain_containing_libgcc.a
Third error:
in gcc/config/arm/lib1funcs.asm : multiple definition of __divsi3
in gcc/config/arm/lib1funcs.asm : undefined reference to raise
in libgcc.a (some .o inside) : undefined reference to __aeabi_unwind_cpp_pr0
I've no idea to solve this...
Does anyone have an idea? Does anyone can help me to get a working arm7 toolchain compatible with this archopen code?
Thanks!
Well, in this particular case, back to 2005 was a good solution...
With a ubuntu 5.04, buildroot has been built with the defaut generic ARM (little endian) configuration, except for the following options:
GCC 3.3.5
No use the daily uClibc snapshot
The processor has no MMU
No support large file
Use softfloat by default
No install busybox (as I only wanted the toolchain)
No create an Ext2 filesystem (same reason than above)
The build fail just after having compiled the last GCC phase. At this point, add the buildroot/build_arm_nofpu/staging_dir/bin in the PATH env. variable, download the libfloat source (libfloat-990616.orig.tar.bz2) tarball, edit the Makefile changing gcc, ld and as repectively by arm-linux-uclibc-gcc, arm-linux-uclibc-ld and arm-linux-uclibc-as and build libfloat (make clean & make). Copy libfloat.a into buildroot/build_arm_nofpu/staging_dir/lib and run the buildroot make again (without cleaning). The build should end successfully. With this toolchain, mediOS will compile without any warning.

Compiling specific apache module in VS2010

Over the last few days I've been tinkering with mod_pLua on Windows (https://sourceforge.net/projects/modplua/ or https://github.com/Humbedooh/mod_pLua).
The pre-built Windows binary works a treat, except it doesn't seem to have been compiled with mod_dbd support for database connectivity. The documentation suggests that to enable this feature you must compile with a certain tag, so I've been trying to compile the module in VS2010 - hoping that I'll be able to get mod_dbd support working at some point - but I've run in to a snag. It just will not compile.
What I've done so far:
Included apache/include and apache/lib, which got rid of a lot of
errors
Included lauxlib.h, lua.h, luaconf.h and lualib.h from Lua 5.2, which got rid of a lot of errors
Compiled a .lib file from Lua 5.2 sources and included it, which fixed a few errors
The errors I'm getting at the moment are:
error LNK2019: unresolved external symbol _luaL_openlib referenced in function _lua_dbopen C:\Users\Michael\Desktop\Projects\C\mod_plua\mod_plua.obj
And a plethora like this:
IntelliSense: a value of type "const char ()(cmd_parms *cmd, void *cfg, const char *arg)" cannot be used to initialize an entity of type "cmd_func" c:\users\michael\desktop\projects\c\mod_plua\mod_plua.h 394 5
As I'm not a C/C++ native, I only have a vague idea of what's wrong, and have likely done something wrong in my attempts to fix the issue. If someone could guide me in the right direction (or better yet, write a little instructional on how to compile the module from start to finish) I would be so happy.
I've uploaded my VS2010 project files and source here: https://dl.dropboxusercontent.com/u/51243175/mod_plua_vs2010.7z
Self-answer:
The primary reason for the failure to compile was the Lua .lib file. The Microsoft compiler does strange things when dealing with C code, so I got an appropriately compiled version of the .lib from the LuaBinaries SourceForge repository (http://sourceforge.net/projects/luabinaries/) - specifically, 5.2.3/Windows Libraries/Dynamic/lua-5.2.3_Win32_dll10_lib.zip (which is compiled for VS2010).
This didn't enable mod_dbd support, which requires headers and sources from the Apache APR project, but it did allow successful compilation.
You should not be using mod_pLua really, I haven't worked on that for nearly 3 years ;) You should use mod_lua instead, which comes bundled with httpd and works pretty much the same way (although it does not support the php-like scripting that mod_pLua does)
For DBD specific setups (especially how to use it on Windows), see http://modlua.org/api/database

Eclipse mac osx: Launch failed, binary not found

Just installed eclipse on my mac cannot run my projects when i build and run i get the following message: launch failed, binary not found.
I've set on project setting \macosx gcc\ and linker\miscellaneus\flags -arch i686
doesnt work, i am pretty stuck.
Hi I ran into a similar problem. I am using the following build :
Eclipse IDE for C/C++ Developers
Version: Juno Service Release 2
The fix go into Project > Properties > C/C++ Build > Settings > Binary Parsers : Make sure "Mach-O 64 Parser is selected"
This thread helped me out: "Launch Failed. Binary Not Found." Snow Leopard and Eclipse C/C++ IDE issue
"THE PROBLEM: is that GCC 4.2 (the GNU Compiler Collection) that comes with Snow Leopard compiles binaries in 64-bit by default. Unfortunately, the linker that Eclipse uses does not understand 64-bit binaries; it reads 32-bit binaries. There may be other issues here, but in short, they culminate in no binary being generated, at least not one that Eclipse can read, which translates into Eclipse not finding the binaries. Hence the error."
The fix go into Project > Properties > C/C++ Build > Settings > Binary >Parsers : Make sure "Mach-O 64 Parser is selected"
I made sure this was correct, and still recieved an error, so I would say the best solution is to do this step...then, BUILD the project, then press the "play" button and it should work (that is what fixed my problem)
You must build it first, then click run. It will be fine then.
You need to select the proper binary parser so Eclipse can recognize the executable :
Select the project, then
Project->Properties->C/C++ Build->Settings->Binary Parsers
For the mac select Mach-O Parser.
I wish CDT just came with these selected, it’d be a simple plug-n-play setup. If nothing else they could add a hint in the error text.
I had the same issue,
although i changed the parser as above mentioned it didn't work and i got the same error.
In addition, building the project via the menu solved the problem:
Project>Build All
I guess the very first code execution with eclipse makes it necessary to build the code separately before pressing the green run button (as i supposed this at least compiles the code).

Resources