cancel
Showing results for 
Search instead for 
Did you mean: 

STVD First Project help

drebbe
Associate II
Posted on November 16, 2011 at 05:48

I just received my stm8s-discovery and I'm trying to follow this:

http://benryves.com/journal/3567231

I keep on getting the following error even though I see this function defined in stm8s_conf.h:

#error clnk Debug\project.lkf:1 symbol _assert_failed not defined (Debug\stm8s_gpio.o )

I'm clueless on why _assert_failed() isn't being defined in the object file...

EDIT: If I don't #include ''stm8s.h'' it compiles just fine.
3 REPLIES 3
singamicro
Associate II
Posted on November 23, 2011 at 05:48

Edit stm8s_conf.h to comment out  #define USE_FULL_ASSERT    (1)

which is about 23 lines from the bottom.

I had a same or similar problem with STVD and solved it with the above.

I had since then use IAR.

 

http://singamicro-30-stm8s105.blogspot.com/

ffred
Associate II
Posted on November 11, 2013 at 18:18

Hello,

I know it's an old post, but since I got the same problem, following the same tutorial, I think I could reply and maybe it could help the next beginner to start with the STM8..

so you simply need to declare the assert_failed function in your main.c.

just have a look in the STM8S Peripheral Library, look in any example at the end of a main.c file, you got :

#ifdef USE_FULL_ASSERT

/**

  * @brief  Reports the name of the source file and the source line number

  *   where the assert_param error has occurred.

  * @param file: pointer to the source file name

  * @param line: assert_param error line source number

  * @retval None

  */

void assert_failed(uint8_t* file, uint32_t line)

{

  /* User can add his own implementation to report the file name and line number,

     ex: printf(''Wrong parameters value: file %s on line %d\r\n'', file, line) */

  /* Infinite loop */

  while (1)

  {

  }

}

#endif

and it's also probably possible if you don't want to add this code to undefine USE_FULL_ASSERT, since it's here in an #ifdef.

but I didn't look yet where in the library you can set that.....

ffred

singhd3
Associate II
Posted on January 25, 2014 at 20:40

Hi, I am new here and got the same problem, luckily, I didn't had to break my head and I found this post quickly.

Does anyone know how to load this code into the discovery board (step by step)? I tried using STVP but nothing is happening. Not sure if I have the right settings. I am really struggling with that. Thanks