platform-ststm8 icon indicating copy to clipboard operation
platform-ststm8 copied to clipboard

ASlink-Warning-Undefined Global '_assert_failed'

Open bogdan2011 opened this issue 4 years ago • 1 comments

I get an error during the build process:

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_adc1'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_awu'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_beep'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_clk'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_exti'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_flash'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_gpio'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_i2c'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_itc'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_iwdg'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_rst'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_spi'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_tim1'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_tim2'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_tim4'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_uart1'

?ASlink-Warning-Undefined Global '_assert_failed' referenced by module 'stm8s_wwdg'
*** [.pio/build/stm8sblue/firmware.elf] Error 1

And the build process fails completely. Might be due to the missing library (.lib) or .rel files not being linked properly. Source code is basic:

#include <stm8s.h>

int main(void) {
    return 0;
}

platformio.ini file:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:stm8sblue]
platform = ststm8
board = stm8sblue
framework = spl

bogdan2011 avatar May 28 '20 06:05 bogdan2011

take a look at the SPL examples, all of them define this method in main.c void assert_failed(uint8_t* file, uint32_t line)

its needed to compile.

boeckhoff avatar Nov 25 '20 22:11 boeckhoff