Page 1 of 1

Problems with new custom variant

Posted: Fri Sep 18, 2020 3:30 am
by toogooda
I am trying to create a Generic L151C8xxA Variant and followed the instructions for the Wiki https://github.com/stm32duino/wiki/wiki ... nt-(board) Instructions

While testing blink example I found the following issue:
1) stm32l1xx.h:167:3: error: #error "Please select first the target STM32L1xx device used in your application (in stm32l1xx.h file)"

This seems to relate to a missing definition in compiler preprocessor as when I read through the listed file about it has the comment
/* Tip: To avoid modifying this file each time you need to switch between these
devices, you can define the device in your toolchain compiler preprocessor.
*/
I have reviewed the instructions and don't see any information adding this definition anywhere.

Adding #define STM32L151xBA to both stm32l1xx.h and stm32_def_build.h gets it to compile but I have hard coded it for this board, anyone know how to set it correctly for a variant?

Re: Problems with new custom variant

Posted: Fri Sep 18, 2020 4:44 am
by toogooda
It is set in board.txt
.build.product_line=STM32L151xBA
I had set it to the actual chip STM32L151x8A but you have to select a valid group.

Re: Problems with new custom variant

Posted: Fri Sep 18, 2020 8:29 am
by fpiSTM
Hi,

you have to use this one

Code: Select all

STM32L151xB 
:
https://github.com/stm32duino/Arduino_C ... ild.h#L293

This file provides all possible value.

Re: Problems with new custom variant

Posted: Wed Sep 30, 2020 8:51 pm
by toogooda
fpiSTM wrote: Fri Sep 18, 2020 8:29 am Hi,

you have to use this one

Code: Select all

STM32L151xB 
:
https://github.com/stm32duino/Arduino_C ... ild.h#L293

This file provides all possible value.
Actually I needed the

Code: Select all

STM32L151xBA 
one thanks