Why are my objects' constructors not working outside the main function?

Hi, I manage to add SPL support for Nucleo L152RE, creating a new framework. Everything seemed to work fine, but yesterday, I tried to use a c++ library, and I realized that this code compiles but when I upload it to the board, it doesn’t do anything:

But this code works fine:

What should be the problem?
Thanks.
Greetings,
Pablo Fuentes

Hi @FPablo! It’s hard to guess a reason without a project. Which linker script do you use?

Hi, thanks for your reply, I used the linker script that STM32CubeMX generated:

The new framework (called “dev”) that I made is a simply copy of the SPL framework with the difference that I put extra libraries, and a startup for stm32l152ret6.
This is my board .json:
https://github.com/FPablo10/Platformio/blob/master/boards/stm32l152ret6-dev.json
Framework-dev:
https://github.com/FPablo10/Platformio/tree/master/framework-dev
The framework’s builder:
https://github.com/FPablo10/Platformio/blob/master/builder-dev/dev.py

Greetings.

@FPablo Have you modified build or linker flags? Have you tried to use stlink debug interface? I could not find file dgpio.h in your repo.

No, I didn’t modify nothing, I only add the files you see above to the ststm32 platform, here is my project:
https://github.com/FPablo10/Platformio/tree/master/test_project
How may I use the stlink debug interface in Platformio IDE?