cancel
Showing results for 
Search instead for 
Did you mean: 

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

IC_DOC
Associate II

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.

8 REPLIES 8
AA1
Senior III

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_DOC
Associate II

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.

 

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.

 

IC_DOC
Associate II

AA1 (Senior III) posted a new reply in STM8 MCUs on 2024-11-01 07:30 AM:

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

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

C:Program Files(x86)\COSMIC\FSE_Compilers for CXSTM8, et al

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

I compiled and Build All Debug and the attempted Release feature

The zip setup.exe file loaded all of the COSMIC files to C:Program Files (x86)COSMIC

Like as: CXSTM8, CXSTM32,  0x0409/ini, data1.cab, data1.hdr, ISSetup.dll, layout.bin, setup.ilg, setup.ini and setup.isn

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

I unzipped en.stsw-stm8009.zip to C:Discovery and then created a Desktop folder STM8L Discovery with all of the project files in it, but not what got sent to Program Files (x86)

C:Discovery Project has: inc, Libraries, src and STVD. When I Open Workspace from this directory STVD fails to find the Standard Peripheral Driver files. How should the project files be loaded to C:Discovery and to Program Files (x86)?

I don't know the LCD module model.

OK, thanks

 

What to do now, please?

 

Read UM0036 - STVD manual, section "General settings for Cosmic toolset". Page 105, figure 69 shows how to set "Additional include directories".

 

IC_DOC
Associate II

I have Discovery Debug working but cannot get Release to work. I get the following error message:

Compiling ..\..\..\..\libraries\stm8l15x_stdperiph_driver\src\stm8l15x_adc.c...
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
#error cpstm8 ..\..\..\..\libraries\stm8l15x_stdperiph_driver\inc\stm8l15x.h:53 "Please select first the target STM8L device used in your application (in stm8l15x.h file)"
..\..\..\..\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)

 

Any idea why this is happening and how to fix? Thanks for any help to get further with this project.

 

BillAinCT
Associate II

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!).

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.