Re: [Fx2lib-devel] fix linker and example build errors.
Status: Beta
Brought to you by:
mulicheng
From: Dennis M. <de...@ub...> - 2009-11-25 16:29:18
|
Hi Steve, I'd rather leave lights, serial, and a couple of the examples very simple projects that don't include the usb jump table, and require re-enumeration to use. Those are concepts that take a bit to get your head around and I want fx2lib to be approachable for someone who is just beginning to learn to develop firmware. I've been in the process of porting the examples to a new common Makefile, but haven't finished that completely yet, hence the build warning. A couple of the more complex examples (bulkloop, eeprom, et al) build correctly with the Makefile already, I just haven't modified the Makefile to exclude the portions the more simple examples don't need. All that is needed really, is to not add the DSCR_AREA AND INT2JT defines to the linker arguments in the Makefile. Perhaps I'll make the modification and push that change. -Dennis Steve Calfee wrote: > Hi Dennis, > > I don't really know how to do this. I am sure Yahoo will mess up the patch file, so I will both include it in this message and attach it. > > Note, I don't have hardware to test this, I have built the example light program to test my hypothetical build fixes. > > If you don't want to adopt this fine, or if you want me to change things let me know. Eventually I would like to submit ezusb/fx1 code to this library. > > ==================================== > >From b09aaa448599e5acca0bec5fbf465f05bb7adade Mon Sep 17 00:00:00 2001 > From: Steve Calfee <nos...@ya...> > Date: Tue, 24 Nov 2009 21:03:08 -0800 > Subject: [PATCH] Simplify examples to fix link errors and provide default interrupt routines > > A linker first resolves the symbols in the project objects and then looks in > libraries for unresolved symbols. A good linker only adds functions that are > referenced, the as51 linker includes the entire object module that contains > a referenced function. So every default routine should be in its own > source module. I only did the most commonly used modules, as an example. > A program that wants to use any symbol defined in def_ints.c must define > all the entries their or multiple definition errors will happen. > > However, a simple example that does not use interrupts will not need to > include them in the example source code. I show this in lights.c where > a few interrupt routines are used, but most are not, and the defaults > from the library are used. > > |