Page 1 of 2

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

Posted: Fri Jan 28, 2022 3:45 pm
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.

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

Posted: Fri Jan 28, 2022 4:02 pm
by Giovanni
Hi,

Exactly which device is failing?

Giovanni

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

Posted: Fri Jan 28, 2022 5:28 pm
by JSStabl
For example the STM32L496Vx Series, with the LQFO100 footprint. Whereas the STM32L496Ax series with UFBGA169 would work.

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

Posted: Sat Jan 29, 2022 12:42 pm
by Giovanni
Hi,

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

Giovanni

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

Posted: Sun Jan 30, 2022 12:09 pm
by Giovanni
Hi,

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

Giovanni

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

Posted: Mon Jan 31, 2022 1:50 pm
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.

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

Posted: Mon Jan 31, 2022 6:23 pm
by Giovanni
Hi,

Re-generating board files should fix it.

Giovanni

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

Posted: Mon Jan 31, 2022 9:20 pm
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 ..

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

Posted: Thu Feb 03, 2022 10:51 am
by JSStabl
Can you elaborate on how to generate the board files as part of the build? :)

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

Posted: Thu Feb 03, 2022 6:12 pm
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