[En-Nut-Discussion] How do I generate Ethernut (Net & OS) withsymbols?

Chuck Hackett egroupscdh at up844.us
Mon Jan 30 09:20:18 CET 2006


Well, replying to myself again :-)

Well, after doing some more digging, specifically reading "Playing the Nut/OS
Configuration Game":

http://www.ethernut.de/en/documents/ntn-5_config.html

and noting 2 paragraphs above "Nut/OS Options" (about 1/2 way down) it describes
how the Configurator searches for "Makedefs.xxx" and "Makerules.xxx" and adds
any extensions it finds to the configurator's platform list.

(BTW: is there a reason why all the relevant documentation like this isn't
collected into the Software Manual?) 

So, under the C:\ethernut-4.0.1\nut folder, I copied:

Makedefs.avr-gcc to Makedefs.avr-gcc-debug and
Makerules.avr-gcc to Makerules.avr-gcc-debug

I then modified the new Makedefs to use "-O0 -g3 -gdwarf-2" in place of "-Os" in
CPFLAGS and CXXFLAGS.

No changes to Makerules.avr-gcc-debug, it's just a copy of the original

Then, under the C:\ethernut-4.0.1\nut\app folder, I again copied:

Makedefs.avr-gcc to Makedefs.avr-gcc-debug and
Makerules.avr-gcc to Makerules.avr-gcc-debug

I modified the new Makedefs to use "-O0 -g3 -gdwarf-2" in place of "-Os" in
CPFLAGS.  I also changed the "include" reference of "Makedefs.avr-gcc"  to
"Makedefs.avr-gcc-debug".

In Makerules.avr-gcc-debug I just changed the "include" reference of
"Makerules.avr-gcc" to "Makerules.avr-gcc-debug".

I then recreated the build tree and the app sample tree.

In the HTTPD sample I deleted the debug directives I had added before as well as
the 'elf' make rule.  I did a "make clean" followed by a "make all" and Ulrika!
Httpdserv.elf was there (and much larger).  I fired up AVRStudio and, after a
much longer simulator load time, it loaded with symbols for all modules.

One problem remained: After it had processed symbols it displayed several (5 or
6?) "file open" dialog boxes which I canceled because I had no idea what file it
was looking for.  It then brought up the disassembler window and, where there
should have been source lines there were "not found" errors:

---- C:\ethernut-4.0.1\NutBuild\net\C:\ethernut-4.0.1\nut\net\tcpsm.c (not
found) -----------------
1178: Error: File not found
+000037CF:   4E20        SBCI    R18,0xE0         Subtract immediate with carry
---- No Source
--------------------------------------------------------------------------------
----
+000037D0:   746F        ANDI    R22,0x4F         Logical AND with immediate
+000037D1:   6620        ORI     R18,0x60         Logical OR with immediate
+000037D2:   756F        ANDI    R22,0x5F         Logical AND with immediate
---- C:\ethernut-4.0.1\NutBuild\net\C:\ethernut-4.0.1\nut\net\tcpsm.c (not
found) -----------------
1182: Error: File not found
+000037D3:   646E        ORI     R22,0x4E         Logical OR with immediate
---- No Source
--------------------------------------------------------------------------------
----
+000037D4:   203A        AND     R3,R10           Logical AND
+000037D5:   7325        ANDI    R18,0x35         Logical AND with immediate
+000037D6:   000A        ???                      Data or unknown opcode
@000037D7: NutInitXRAM
----
C:\ethernut-4.0.1\NutBuild\os\C:\ethernut-4.0.1\nut\os\..\arch\avr\os\nutinit.c
(not found) --
280: Error: File not found

Note that the file names appear to be to be two paths concatenated as in:

C:\ethernut-4.0.1\NutBuild\net\C:\ethernut-4.0.1\nut\net\tcpsm.c

Does anyone know why this would happen? (BTW: AVRStudio 4.10.356)

So, Is the creation of the Makedefs.avr-gcc-debug & Makerules.avr-gcc-debug the
way this should be done?

The way I have things setup at the moment symbols are generated for everything
(.avr-gcc-debug) or nothing (.avr-gcc) but another set could be created to only
generate symbols for the application which would be a more common case (after I
become more familiar with Ethernut).

If anyone would like a copy of the files, let me know and I'll email them to
you.

Other outstanding questions:

1) When should elf be used as opposed to cof and vice-versa?  Why?

2) Why are the source filenames mangled when AVRStudio gets them?

Well, it's 2:00 AM here and I'm to old for these late nights (I'm 56) :-)

Cheers,

Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck






More information about the En-Nut-Discussion mailing list