Running STM32L0538-DISCO sample project
Hello. I have recently purchased STM32L0538-DISCO board and I want to play a bit with the E-paper display. After struggling for a couple of hours trying to find some sample code or projects to run on STM32CubeIDE, I have found somewhat relevant thread here:
I have located STM32_Cube_FW_L0_V1.12.2 on my PC and tried to follow the migration guide UM2579.
Unfortunately, I have not been able to migrate the project to STM32CubeIDE as I think the instructions are not fully clear.
My questions regarding migrating the project:
1. The first step in the guide mentions that I need to make a copy of the project and copy that inside the workspace currently being used in STM32CubeIDE. I cannot understand how to properly do that. First of all, when it refers to "make a copy of the project" which directory does it refer to exactly?

Does it refer to whole Demonstrations directory?
C:\Users\petrikas.lu\STM32Cube\Repository\STM32Cube_FW_L0_V1.12.2\Projects\32L0538DISCOVERY\Demonstrations\SW4STM32\STM32L0538-Discovery
Does it refer to SW4STM32 directory?
C:\Users\petrikas.lu\STM32Cube\Repository\STM32Cube_FW_L0_V1.12.2\Projects\32L0538DISCOVERY\Demonstrations\SW4STM32
Or STM32L0538-Discovery directory?
C:\Users\petrikas.lu\STM32Cube\Repository\STM32Cube_FW_L0_V1.12.2\Projects\32L0538DISCOVERY\Demonstrations\SW4STM32\STM32L0538-Discovery
Additionally, which files exactly do I need to copy?
2. It also mentions that I need to copy those files to already open workspace. Does it mean that I need to create a blank project for the STM32L053? I do not get how can I have workspace already open prior to creating a project?
3. Perhaps there is an easier way to get the most basic E-Paper example running on STM32L0538-Discovery board? I am not interested in the touch bar or anything else. I just want to display some text on the e-paper for example "Hello World" before moving to more complex tasks.
I have tried to simply create a blank project for the STM32L0538 and download the following:
https://www.st.com/en/embedded-software/stsw-stm32152.html
I simply pasted the BSP directory from the
C:\Users\petrikas.lu\Downloads\en.stsw-stm32152\Drivers\BSP
to my project directory. that BSP directory contains gde021a1 and files for stm32l0538_discovery board:

However, since I created a blank project using stm32CubeMX, I cannot build the project perhaps I am missing some configuration:
make -j16 all
arm-none-eabi-gcc "../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L053xx -c -I../Core/Inc -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.d" -MT"Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.o"
In file included from ../Core/Inc/stm32l0xx_hal_conf.h:188,
from ../Drivers/STM32L0xx_HAL_Driver/Inc/stm32l0xx_hal.h:29,
from ../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.h:48,
from ../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.c:40:
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.c: In function 'BSP_LED_Init':
../Drivers/STM32L0xx_HAL_Driver/Inc/stm32l0xx_hal_rcc.h:724:40: error: expected expression before 'do'
724 | #define __HAL_RCC_GPIOB_CLK_ENABLE() do { \
| ^~
../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:2829:28: note: in expansion of macro '__HAL_RCC_GPIOB_CLK_ENABLE'
2829 | #define __GPIOB_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.h:104:49: note: in expansion of macro '__GPIOB_CLK_ENABLE'
104 | #define LED3_GPIO_CLK_ENABLE() __GPIOB_CLK_ENABLE()
| ^~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.h:112:71: note: in expansion of macro 'LED3_GPIO_CLK_ENABLE'
112 | #define LEDx_GPIO_CLK_ENABLE(__INDEX__) (((__INDEX__) == 0) ? LED3_GPIO_CLK_ENABLE() : LED4_GPIO_CLK_ENABLE())
| ^~~~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.c:154:3: note: in expansion of macro 'LEDx_GPIO_CLK_ENABLE'
154 | LEDx_GPIO_CLK_ENABLE(Led);
| ^~~~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.c: In function 'BSP_PB_Init':
../Drivers/STM32L0xx_HAL_Driver/Inc/stm32l0xx_hal_rcc.h:716:40: error: expected expression before 'do'
716 | #define __HAL_RCC_GPIOA_CLK_ENABLE() do { \
| ^~
../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h:2823:28: note: in expansion of macro '__HAL_RCC_GPIOA_CLK_ENABLE'
2823 | #define __GPIOA_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.h:128:49: note: in expansion of macro '__GPIOA_CLK_ENABLE'
128 | #define KEY_BUTTON_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
| ^~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.h:133:50: note: in expansion of macro 'KEY_BUTTON_GPIO_CLK_ENABLE'
133 | #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) (KEY_BUTTON_GPIO_CLK_ENABLE())
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.c:222:3: note: in expansion of macro 'BUTTONx_GPIO_CLK_ENABLE'
222 | BUTTONx_GPIO_CLK_ENABLE(Button);
| ^~~~~~~~~~~~~~~~~~~~~~~
make: *** [Drivers/BSP/STM32L0538-Discovery/subdir.mk:34: Drivers/BSP/STM32L0538-Discovery/stm32l0538_discovery.o] Error 1
"make -j16 all" terminated with exit code 2. Build might be incomplete.
11:42:20 Build Failed. 3 errors, 0 warnings. (took 362ms)
It is quite strange why I am getting errors such as this after adding BSP inside my Drivers folder:

I appreciate all the help in advance!
