mcuconf.h

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tinker
Posts: 14
Joined: Tue Feb 28, 2012 6:55 pm

mcuconf.h

Post by Tinker »

I noticed that the mcuconf.h for the M4's is pretty different from the Cortex-M3's. Is there a way of creating one that works for both or should I just stick with using 2?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: mcuconf.h

Post by Giovanni »

Hi,

mcuconf.h does not depend on the CPU type, it contains peripheral settings, the STM32F1xx and STM32F4xx have different clock settings and defaults so the file has to be different in that section.

If you want a single file you may use #ifdefs checking the MCU type defined in board.h.

Giovanni
Tinker
Posts: 14
Joined: Tue Feb 28, 2012 6:55 pm

Re: mcuconf.h

Post by Tinker »

How about STM32-F4 statements like these?

#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)

Are these ignored by the Cortex-M3 initialization?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: mcuconf.h

Post by Giovanni »

Those would generate a warning because that macro is also defined inside the various drivers.

Giovanni
Post Reply