Closed
Description
Describe the set-up
- The board: A custom STM32F105RCT6 development board from Taobao. board description (website in Chinese): https://item.taobao.com/item.htm?id=556036697936 . I can upload the schematic here if necessary, but any board should be okay to reproduce.
- IDE: VSCode + PlatformIO (Core 5.1.0)
- Platform pack: ststm32 + my own support of STM32F105 series https://github.com/ttimasdf/platform-ststm32/tree/add-generic-stm32f105x
- Arduino Core: stm32duino + my own support of STM32F105 series https://github.com/ttimasdf/Arduino_Core_STM32/tree/variant-generic-stm32f105x
Describe the bug
The premain()
function provided by stm32duino is not properly called for HAL initialization. I've submitted a PR here stm32duino/Arduino_Core_STM32#1310 and been advised to also post the fix here. The only I can see is that it called something generated by the compiler. I refer to the startup code from lines below and submit the aforementioned PR. I'd be happy if anyone explain a little bit about why these lines are necessary for things to work 🙏
How To Reproduce
TODO: I'll add more detailed tomorrow
Additional context
The patch is available at ttimasdf/Arduino_Core_STM32@acbd6cd