SDCC devel mailing list 2022-11-12:
Hello,
I would like to implement a RAM check for the STM8 during startup.
According to the manual, SDCC calls "_sdcc_external_startup()" before jumping to main(). But it seems like - at least for STM8 - this is not the case. The below bare-metal example should remain in a reset cycle, because _sdcc_external_startup() triggers a SW reset. I checked that the SW reset works, so the fact that the LED blinks indicated that _sdcc_external_startup() is not called. What am I missing?
I build the hexfile with
CFLAGS = -mstm8 --std-sdcc99 --std-c99 LFLAGS = -mstm8 -lstm8 --out-fmt-ihxFor your help thanks a lot in advance and have a great day!
Georg
Looking at the starup code, apparently this feature never got implemented for stm8. And since you are the first to report the issue, I guess no one was missing it much so far (after all the main use of the external startup function is to disable a watchdog before it bites during initalization of global variables and the stm8 has no watchdog that is active on reset).
Since there is a difference between what the manual says and what sdcc does I suggest to file a bug report.
Philipp
Fixed in [r13762].
Related
Commit: [r13762]