This problem has been solved, just configure the path to compile successfully!
Here’s what I configured:
[env:disco_l152rb]
platform = ststm32
board = disco_l152rb
framework = stm32cube; change microcontroller
board_build.mcu = stm32l151rbt6; change MCU frequency
board_build.f_cpu = 32000000Lupload_protocol = jlink ; SWD interface
debug_tool=jlinkbuild_flags = -DL1
-Isrc/Core/Inc