#1198 breaks compilation for all STM496 with less than 169 pins Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
JSStabl
Posts: 78
Joined: Tue Feb 25, 2020 4:06 pm
Has thanked: 3 times
Been thanked: 2 times

#1198 breaks compilation for all STM496 with less than 169 pins

Post by JSStabl »

We're using 20.3.x, refer to this topic: viewtopic.php?f=35&t=5946

Basically the STM32_HAS_GPIOI flag was set to true for all STM496, but there are some packages that don't have a GPIOI.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by Giovanni »

Hi,

Exactly which device is failing?

Giovanni
JSStabl
Posts: 78
Joined: Tue Feb 25, 2020 4:06 pm
Has thanked: 3 times
Been thanked: 2 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by JSStabl »

For example the STM32L496Vx Series, with the LQFO100 footprint. Whereas the STM32L496Ax series with UFBGA169 would work.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by Giovanni »

Hi,

Not sure how to handle this, headers do not make differences among packages, GPIOI is always defined, any idea?

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by Giovanni »

Hi,

Question, is the device actually crashing on GPIOI initialization or it is simply doing a useless initialization? Compilation is fine.

Giovanni
JSStabl
Posts: 78
Joined: Tue Feb 25, 2020 4:06 pm
Has thanked: 3 times
Been thanked: 2 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by JSStabl »

Yeah we had this part in our board.c

Code: Select all

#if STM32_HAS_GPIOI
  {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
   VAL_GPIOI_ODR,   VAL_GPIOI_AFRL,   VAL_GPIOI_AFRH,    VAL_GPIOI_ASCR,
   VAL_GPIOI_LOCKR},
#endif


Which wasn't defined in the board.h, maybe we need to figure out how to fix that on our side.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by Giovanni »

Hi,

Re-generating board files should fix it.

Giovanni
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by faisal »

JSStabl wrote:Yeah we had this part in our board.c

Code: Select all

#if STM32_HAS_GPIOI
  {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
   VAL_GPIOI_ODR,   VAL_GPIOI_AFRL,   VAL_GPIOI_AFRH,    VAL_GPIOI_ASCR,
   VAL_GPIOI_LOCKR},
#endif


Which wasn't defined in the board.h, maybe we need to figure out how to fix that on our side.


The solution is not to keep generated board files in your repo. Generate them as part of your build. Giovanni, I would encourage you to do the same. But that would require your users to install fmpp ..
JSStabl
Posts: 78
Joined: Tue Feb 25, 2020 4:06 pm
Has thanked: 3 times
Been thanked: 2 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by JSStabl »

Can you elaborate on how to generate the board files as part of the build? :)
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Re: #1198 breaks compilation for all STM496 with less than 169 pins

Post by faisal »

JSStabl wrote:Can you elaborate on how to generate the board files as part of the build? :)


Sure, add this to your makefile:

Code: Select all

BOARD_GEN_FILES = $(BOARDDIR)/board.c $(BOARDDIR)/board.h $(BOARDDIR)/board.mk
BOARD_TEMPLATE_FILES = $(BOARDDIR)/cfg/board.chcfg $(BOARDDIR)/cfg/board.fmpp

.PHONY: PRE_MAKE_ALL_RULE_HOOK
PRE_MAKE_ALL_RULE_HOOK: $(BOARD_GEN_FILES)

$(BOARD_GEN_FILES) &: $(BOARD_TEMPLATE_FILES)
   @echo "Rebuilding board files"
   @echo
   @fmpp -C $(BOARDDIR)/cfg/board.fmpp -O $(BOARDDIR)/

.PHONY: CLEAN_RULE_HOOK
CLEAN_RULE_HOOK:
   @echo CLEAN_RULE_HOOK
   @echo - $(BOARDDIR)/{board.h board.c board.mk}
   @rm -f $(BOARDDIR)/board.c $(BOARDDIR)/board.h $(BOARDDIR)/board.mk 2>/dev/null
Post Reply