board.chcfg for mcu default reset state

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

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

board.chcfg for mcu default reset state

Postby russm » Sun Aug 19, 2018 11:58 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: board.chcfg for mcu default reset state

Postby Giovanni » Mon Aug 20, 2018 5:12 am

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

Postby russm » Mon Aug 20, 2018 5:26 am

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!


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 16 guests