[En-Nut-Discussion] "US_PIOA_PINS_A" redefined

José Vallet jose.vallet at hut.fi
Mon Oct 5 17:59:51 CEST 2009


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é




More information about the En-Nut-Discussion mailing list