Skip to main content
Visitor II
October 26, 2024
Question

Using STVD and STVP for STM8L-Discovery board--Build Debug & Release

  • October 26, 2024
  • 5 replies
  • 3073 views

Building Discovery Debug and Release errors

STM8L152C6 MPU

  1. How to set full path when building to show details?

  2. I read somewhere that there is a selection for building a lengthy display. Where is this explained, please? Where is the COSMIC C compiler list option entered to get listing outputs? Any other flags or entries to get full listings shown and saved?

  3. Error building the Release:  ..\..\..\..\libraries\stm8l15x_stdperiph_driver\src\stm8l15x_adc.c:

The command: "cxstm8 -i..\..\..\..\libraries\stm8l15x_stdperiph_driver\inc -i..\..\inc -i..\..\..\..\librairies\stm8l15x_stdperiph_driver\inc +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clRelease\ -coRelease\ ..\..\..\..\libraries\stm8l15x_stdperiph_driver\src\stm8l15x_adc.c " has failed, the returned value is: 1

exit code=1.

discover.elf - 2 error(s), 0 warning(s)

 

No errors for Debug Build

           How to see what the Release Build error was and where? How to fix?

  1. Does the C compiler, linker, etc., determine what goes to EEPROM and Flash? How is this assigned? Is this designer-coded or partitioned?

  2. Why can’t EEPROM and Option Bytes be read via STVP?

  3. Where can I find the Bootloader code? Cannot read Bootloader 0x6000 onward. Is this just requiring a following of the Bootloader logic flow diagram?

  4. I read somewhere that there is a selection for building a lengthy display. Where is this explained, please? Where is the COSMIC C compiler list option entered to get listing outputs? Any other flags or entries to get full listings shown and saved?
  5.  

Cannot Read STM8L152C6T6:

0x00 1000-0x00 10FF

0x00 1100-0x00 11FF

0x00 1200-0x00 12FF

…………

0x00 1700-0x00 17FF

Option bytes 0 0x00 4800-0x00 487F

All feedback is most welcome! Thanks.

    This topic has been closed for replies.

    5 replies

    Visitor II
    October 26, 2024

    Where is the COSMIC C compiler list option entered to get listing outputs?

    You should read Cosmic manual in special chapter 2.

    The include path ..\..\..\..\libraries\stm8l15x_stdperiph_driver\inc is "repeated". The second have a typo in librairies.

    When the compiler detects an error, it prints the error and the line in source file where the error occurs. I don't see the error. If there are errors in release build but not in debug build, verify what is different.

    You should verify if compiler is in Windows system path.

    EEPROM and Flash are distinguished by its address. Flash stars at address 0x8000 and EEPROM at address 0x1000. In the linker script you put the address of each section.

    If you can't read EEPROM and Option Bytes be read via STVP, maybe the MCU selection is wrong. And you didn't show the error.

    Why do you need the Bootloader code?

     

    IC_DOCAuthor
    Visitor II
    October 30, 2024

    I am trying to build the original STM8L-Discovery—Debug and Release before doing anything else. I want a stable baseline environment. It’s not there yet.

    The error printout listing is all that is produced after Build All command.

    There is no Discovery.stp in the distribution or Setup install.

    I need to create the stock hierarchical paths. Where do all of the dependencies go for a Windows 10 STM8L-Discovery project? Is it on C:Program Files(x86) or a local project directory?  I’d appreciate some help with this initial setup to be able to move onward.

    I have printed and read the Special Chapter 2.

    What is the make, model and part number for the Discovery LCD module?

    I don’t need the Bootloader code. I see to use the flow chart in the documentation.

    Thank you.

     

    Visitor II
    November 1, 2024

    I said: You should verify if compiler is in Windows system path. What is the response?

    As you are only compiling stm8l15x_adc.c, open a command prompt and execute there the compiler and see the error.

    STM8L-Discovery project is a zip file. You can unzip it to the folder you want.

    I don't know the LCD module model.

     

    Graduate II
    November 27, 2024

    In stm8s.h one of the #defines for the processor must be commented out. If debug builds then it has one uncommented so release should work too. Unless you have different stm8s.h for each build (not recommended!).

    IC_DOCAuthor
    Visitor II
    December 2, 2024

    Thank you for your feedback. I think that your reference to STM8S.h is
    for a different Discovery board.
    We are using MB915B Discovery for the STM8L152C6 and has an LCD display module.


    I changed STM8l15x.h line 32 to:
    #define STM8L15X_MD /*!< STM8L15X_MD: STM8L15x Medium density devices */
    /* #define STM8L15X_MDP */ /*!< STM8L15X_MDP: STM8L15x Medium density plus devices */
    /* #define STM8L15X_HD */ /*!< STM8L15X_HD: STM8L15x/16x High density devices */

    Makes no difference. And the line 33, then 34.

    Errors now for Release are:

    Running Linker
    clnk -l"C:\Program Files\COSMIC\CXSTM8_32K\Lib" -o Release\discover.sm8 Release\discover.lkf
    #error clnk Release\discover.lkf:1 no default placement for segment .dataeeprom
    #error clnk Release\discover.lkf:1 no default placement for segment .LPRUN
    The command: "clnk -l"C:\Program Files\COSMIC\CXSTM8_32K\Lib" -o Release\discover.sm8 Release\discover.lkf " has failed, the returned value is: 1
    exit code=1.

    discover.elf - 4 error(s), 0 warning(s)


    clnk references to Program Files\COSMIC which does not exist.

    Cosmic C is in Program Files (x86). So are CXSTM8 and Hstm8.
    Any idea about what is going on here? I'm more confused.

     

    Graduate II
    December 3, 2024

    These errors are complaining about the linker input file Release\discover.lkf. How does it compare to the debug version of the same file? Mine are identical except for the paths containing debug or release.

    Also try a rebuild for the release version which recreates these files.

    IC_DOCAuthor
    Visitor II
    December 12, 2024

    I had this working now for Debug and Release but have a new problem using STVD. When I bring up STVD and Discovery.stw, the upper right area windows that used to show Debug and Release is missing. It should look more like UM0991 pg 33/52 Figure 26 where there are two boxes that in this particular intro example case show stvd_project and Debug where it should show Debug and Release options for this Discovery project. I tried to attach a screen capture file but that does not work with Reply..

    I also get discover.wed errors with access permission failure but ignoring this still worked for Buildings.

     

    Any ideas why the problem and a fix? Thanks.

     

    Graduate II
    December 12, 2024

    Right click in the toolbar area and be sure that project is checked.

    IC_DOCAuthor
    Visitor II
    December 13, 2024

    Yes, it is selected.

     

    Graduate II
    December 13, 2024

    Delete the WDB and WED files that have the same name as the workspace.This solved my missing top level menu problem as well as messed up toolbars showing up in places that I couldn't move or delete.

    IC_DOCAuthor
    Visitor II
    December 13, 2024

    Wow! This worked. Amazing that you found this glitch. I renamed the files to a leading underscore that they will remain in existence but not accessed by the Build. The Build still tries to modify the discovery.lkf file but I write protected it and that seems to be OK. On starting STVD, I do get an access issue to discovery.wed but ignore it.

    Thanks very much.