[En-Nut-Discussion] "US_PIOA_PINS_A" redefined

0 views
Skip to first unread message

José Vallet

unread,
Oct 5, 2009, 6:32:56 AM10/5/09
to Ethernut mail list
Hello.

I am trying to compile NutOS 4.8.4 in kubuntu 8.10. The compilation
process complains about redefinition of "US_PIOA_PINS_A" as follows.

12:20:04 PM: ----- Running 'make all' -----
/home/jose/ethernut/ethernut-4.8.4/arch/arm/dev/usart0at91.c:229:1:
error: "US_PIOA_PINS_A" redefined
/home/jose/ethernut/ethernut-4.8.4/arch/arm/dev/usart0at91.c:215:1:
error: this is the location of the previous definition
make[1]: *** [arm/dev/usart0at91.o] Error 1
make: *** [all] Error 2
12:20:05 PM: ----- 'make all' failed with error 2 -----

Any suggestions?

Thanks
José
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Marcus Jansson

unread,
Oct 5, 2009, 8:22:29 AM10/5/09
to en-nut-d...@egnite.de
Jose wrote:
> The compilation process complains about redefinition of "US_PIOA_PINS_A"

Hi Jose,

Somehow your MCU seem to not have been defined properly at this point of the compilation. In fact, you seem to have
multiple MCUs defined.
I dont know if this work well, but you could try to manually add a #define MCU_AT91SAM7S (or whatever MCU you have) and
#undef other MCUs at the top of /arch/arm/dev/usart0at91.c to temporarily solve your problems.

Also, usart0at91.c in NutOS 4.8.4 have the #define NUT_DEPRECATED.
NutOS 4.9.6 seem to be slightly different for at91 USART, so maybe you could try that as well.

/M

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

José Vallet

unread,
Oct 5, 2009, 11:59:51 AM10/5/09
to Ethernut User Chat (English)
Hello Marcus.

Marcus Jansson wrote:
> Jose wrote:
> > The compilation process complains about redefinition of "US_PIOA_PINS_A"
>
> Hi Jose,
>
> Somehow your MCU seem to not have been defined properly at this point of the compilation. In fact, you seem to have
> multiple MCUs defined.
> I dont know if this work well, but you could try to manually add a #define MCU_AT91SAM7S (or whatever MCU you have) and
> #undef other MCUs at the top of /arch/arm/dev/usart0at91.c to temporarily solve your problems.

That made it, thanks. I had to gently add

#undef MCU_AT91SAM9260
#undef MCU_AT91SAM9XE
#undef MCU_AT91SAM7S
#undef MCU_AT91SAM7SE
#undef MCU_AT91SAM7X
#undef MCU_AT91SAM7X256
#define MCU_AT91R40008

it in the following files:
/arch/arm/dev/usart0at91.c
/arch/arm/dev/usart1at91.c
/arch/arm/os/nutinit.c

after this I could compile NutOS and the applications.

The question is why this happened. I simply downloaded a fresh
ethernut-4.8.4.tar.bz2 and choose the ethernut30e.conf that comes by
default as the configuration file (just as I do with 4.6.4). Then I make
sure that the CPU selected is the AT91R40008, and only that one.

So, the question is, am I missing something or is this somehow a bug?

>
> Also, usart0at91.c in NutOS 4.8.4 have the #define NUT_DEPRECATED.
> NutOS 4.9.6 seem to be slightly different for at91 USART, so maybe you could try that as well.
>

Well, 4.9.6 does not compile for me either, with problems that I think
are also related to unproper definition of the MCU. At least this one is
solved by undefining MCUs

/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/ostimer_at91.c: In
function 'NutRegisterTimer':
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/ostimer_at91.c:200:
error: 'PMC_PCER' undeclared (first use in this function)
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/ostimer_at91.c:200:
error: (Each undeclared identifier is reported only once
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/ostimer_at91.c:200:
error: for each function it appears in.)
make[1]: *** [arm/dev/ostimer_at91.o] Error 1

but after solving this new ones appear...

In file included from
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usart0at91.c:315:
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c: In
function 'At91UsartInit':
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c:1384:
error: 'PIOB_ASR' undeclared (first use in this function)
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c:1384:
error: (Each undeclared identifier is reported only once
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c:1384:
error: for each function it appears in.)
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c:1384:
error: 'PB5_RXD0_A' undeclared (first use in this function)
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c:1384:
error: 'PB4_TXD0_A' undeclared (first use in this function)
/home/jose/ethernut2/ethernut-4.9.6/nut/arch/arm/dev/usartat91.c:1384:
error: 'PIOB_PDR' undeclared (first use in this function)


make[1]: *** [arm/dev/usart0at91.o] Error 1

So, am I missing something or is there any issue around?

Regards!
José

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

José Vallet

unread,
Nov 4, 2009, 8:07:25 AM11/4/09
to Ethernut User Chat (English)
Hello all.

I am still struggling to compile a fresh ethernut-4.8.* in my linux.

The previous short thread can be found at
http://groups.google.com/group/osdeve_mirror_rtos_en-nut-discussion/browse_frm/thread/20c243fe22b49b5b/f36336950173ab7e?hl=en&lnk=gst&q=%22US_PIOA_PINS_A%22+redefined#f36336950173ab7e

This time I tried 4.8.5, with the same result:
-------
/home/jose/ethernut2/ethernut-4.8.5/arch/arm/dev/usart0at91.c:229:1:
error: "US_PIOA_PINS_A" redefined
/home/jose/ethernut2/ethernut-4.8.5/arch/arm/dev/usart0at91.c:215:1:

error: this is the location of the previous definition

-------

As Marcus Jansson kindly pointed, it seems to be due to having multiple
MCUs defined. Let me recall that I have not modified the sources, I am
using a fresh downloaded ethernut-4.8.5 package.

Trying to dig into this I noticed that the automatically generated
nut-bld/include/cfg/arch.h has, among PLATFORM and ARM_GCC, the
following MCUs defined: MCU_AT91R40008, MCU_AT91, MCU_AT91SAM7S,
MCU_AT91SAM7SE, MCU_AT91SAM7X and MCU_AT91SAM9XE. The same file, when
generated automatically from a Windows installation defines only
MCU_AT91R40008 and MCU_AT91.

I have also noticed other disparities between the build trees generated
in Linux and Windows. Is this normal? Shouldn't they be the same? If
not, why?

As a side note, I can compile the build tree generated from Windows in
my linux machine

Just in case it is useful, I have noticed differences also in the
following automatically generated files:
nut-bld/include/cfg/ahdlc.h
nut-bld/include/cfg/audio.h
nut-bld/include/cfg/audio.h
nut-bld/include/cfg/eeprom.h
nut-bld/include/cfg/memory.h

So, as usual, am I missing something?

Thanks in advance!

José
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

José Vallet

unread,
Nov 5, 2009, 7:40:35 AM11/5/09
to Ethernut User Chat (English)
OK, going forward.

The problem seems to the version of nutconf that I was using. It seems
that somehow version 1.4.3 was generating the build tree wrongly for me.
I have tried now with versions 2.0.5 and 2.0.9, and they both work.

I am still surprised. Has there been any significant changes between
versions so that this can happen? Does this mean that something has
changed in the .nut and .conf files so that they require nutconf version 2?

Regards
José

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Reply all
Reply to author
Forward
0 new messages