board.chcfg for mcu default reset state

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

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
russm
Posts: 2
Joined: Wed Aug 15, 2018 12:20 pm

board.chcfg for mcu default reset state

Post by russm »

I'm looking at porting an STM32F042 application (originally written directly against STM32F0xx_StdPeriph_Driver) to ChibiOS.

It looks like the board config unconditionally expects to configure all pins - is there any way to generate a board config for an MCU in default reset state (other than just going through the datasheet pin by pin), or tell the board config to just leave pins as they are on reset?

I've cloned the ST_NUCLEO32_F042K6 board, but of course it's set up for the various external items on the Nucleo board - LED, crystal, etc. If I remove all the ports from board.chcfg and regenerate board.{c,h} all the #define's are dropped from board.h (as expected) but board.c still expects to find them to configure the pins on reset instead of leaving them in their default state.

I'm assuming the answer is "just make a board.chcfg that reflects the state you want", but thought it was worth asking as a dumb beginner question.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: board.chcfg for mcu default reset state

Post by Giovanni »

Hi,

You need to specify the state of all ports, it is designed this way. In Chibistudio, If you remove ports and then add those again all pins will have the default state thanks to the XML schena.

Giovanni
russm
Posts: 2
Joined: Wed Aug 15, 2018 12:20 pm

Re: board.chcfg for mcu default reset state

Post by russm »

OK, I assumed that might be the case.

Giovanni wrote:In Chibistudio, If you remove ports and then add those again all pins will have the default state thanks to the XML schena.


This doesn't cover pins that don't have the "normal" reset state (eg: PA13/PA14 as SWDIO/SWCLK with active pullup/pulldown), but that's easy enough to fix.

Thanks!
Post Reply