[En-Nut-Discussion] Hardware init

Henrik Maier hmlists at focus-sw.com
Thu Jun 2 07:50:16 CEST 2005


Hello,

I like to incorporate some hardware specific initialisation into Nut/OS 
projects to support our Ethernut compatible XNUT hardware module. In 
particular I/O pin defaults.

There are several options how this can be accomplished:

a) Modify the Makefiles and add an additional object file with a .init1 
section. This is how I am currently doing it. Disadvantage: All standard 
Nut/OS apps makefiles need to be changed. Works only with gcc not icc.

b) Adding some lines of code within an #ifdef to nutinit.c. This is how 
arthernet does it. Disadvantage: Source code will get polluted over time 
with custom init code. Code maintenance issues.

c) Moving the hardware specific code into a device driver.
Disadvantage: Source files need to be modified to load a driver in main().

d) Using nutconf to add the custom hardware init code based on 
information in the .conf files to nutinit.o or Makefiles.

e) Creating a generic AVR I/O pin init module which configures all DDR 
and PORT registers based on nutconf settings

f) Other suggestions?

I like to discuss which method should be the preferred one and used in 
the future.

Cheers

Henrik

-- 
proconX - Protocol Converter, Device Server and Industrial Gateways
http://www.proconx.com  Tel: +61-402 970 933   Fax: +61-7-3009 0399



More information about the En-Nut-Discussion mailing list