Error creating process for executable cxstm8

Описывается решение проблемы ошибки лицензии для компилятора Cosmic.

Иногда возникает странная ошибка при компиляции в IDE STVD компилятором COSMIC.  Виной этому ошибка сервера лицензий от Cosmic. 

Если вы увидели такую ошибку:

#error cpstm8 C:Program Files (x86)COSMICFSE_CompilersCXSTM8Hstm8mods0.h:1 FlexLM No such feature exists.

значит у вас слетела бесплатная лицензия.

Если просто удалить компилятор и заново поставить, то компилятор не будет требовать лицензионный файл. Ошибка компиляции не исчезнет.

Есть два решения: 

  1. Переустановить Windows 
  2. Почистить регистр от старой лицензии Cosmic

Рассмотрим 2 вариант.

1. Перед чисткой реестра необходимо удалить компилятор Cosmic. 

2. Для того, чтобы почистить регистр в начале надо открыть программу для чистки регистра: Стандартные=>Выполнить. Затем ввести в поле: regedit.

3. Затем вам надо в поиске Правка=>Найти ввести COSMIC или FLEXlm License Manager. После чего удалить папку FLEXlm License Manager. 

4. Осталось только заново установить компилятор и зарегистрировать его.

Теги:


Вознаградить

Я собрал
0

0

x

Оценить статью

  • Техническая грамотность
  • Актуальность материала
  • Изложение материала
  • Полезность устройства
  • Повторяемость устройства
  • Орфография

0

Средний балл статьи: 0
Проголосовало: 0 чел.

The STM8 is a series of 8-bit Microcontrollers from STMicroelectronics that has become a common choice of Microcontroller for cost-sensitive product development. I have previously work with AVR, PIC, and a few other ARM Cortex Microcontrollers, but surely in some applications, they become overkill and increase the BOM cost considerably. Recently, after tearing down a few cheap Chinese products, I found that most of them had an STM8 microcontroller inside it. The IC is not only cheap but also packed it with lots of features and options making it suitable to be used in many different applications. For instance, the STM8S series of controllers (which we will learn in this tutorial series) is a general-purpose controller but there are other series like the STM8A for Automotive Designs and STM8L for Low Power battery-powered designs which extends the application of these controllers.

In this series of tutorials, we will learn how to program the STM8S microcontrollers, more specifically the STM8S103F3P6. The reason for getting started with this specific part number is just for its price to performance factor. Like!! just look at it just for 0.25$ (approx. 20 Rupees) we get an 8-bit microcontroller with 16Mhz Internal Oscillator, 8kB Flash, 10-bit ADC, UART, SPI, and I2C. Who would not be intrigued? Also, the STM8S103F3P6 is widely popular, and hence as a beginner, you will find enough support if you need help outside the tutorials. Starting from this, we will have a sequence of tutorials, similar to the PIC Programming Tutorials where we will learn how to program this controller from a basic blink to various display and sensor interfacing. You can also check out the STM32F103C8 Tutorial and projects if you are interested in 32-bit STM Microcontrollers.

Selecting the Hardware and Software Development Tools

Now that we have deicide the microcontroller, we will have to select hardware and software development tools to begin our learning process. There are many options, here I have selected the ones that are free to use and easily available to everyone.

STM8S103F3P6 Development

The official development board for ST’s 8-bit Microcontroller is called the STM8 Discovery kit, but we will use another low-cost development board that you can easily find with a local supplier or on online store. The image of the STM8S103F3P6 Development board that we will use in this tutorial is shown below.

STM8S103F3P6 Development Board

The board only consists of the bare minimum components that are required to begin development. It is breadboard friendly and suitable for compact applications. The internal circuit diagram for the development board is shown below.

STM8S103F3P6 Development Board Circuit Diagram

Taking a closer look, you will notice, apart from the STM8S103F3p6 controller, we have a reset button to reset the controller. A power led and a test led connected to PB5 (Port B pin 5) and an AMS1117 Voltage regulator that converts the 5V from a USB port to 3.3V for the controller. The controller can also be made to operate on 5V if required. The different parts on the controller are marked below. We also have 4 programmer pins namely 3.3V, GND, SWIM, and NRST which can be used to easily program and debug our microcontroller.

STM8S103F3P6 Development Board Overview

STM8S103F3P6 Programmer

For programming our controller, we will be using the ST-LINK v2 which is cheap and easily available online. There are many variants (metal, plastic, gold, pink, bare board) of this ST-LINK v2 board and all serve the same purpose. Mine is shown below but you can use any type of ST-LINK programmer, the pinout will differ, so just make sure you read the pinouts on the casing correctly. There is also ST-LINK V3 from ST-Microelectronics itself which can be used for some serious debugging. We won’t be using that for now since it’s a bit expensive, we will save it for the future.

ST-LINK V2 Board

STM8S103F3P6 IDE and Compiler

Selecting the right IDE and Compiler for STM8S103F3P6 is perplexing, simply because there are a lot of options to choose from. The official tools that are available for the STM8 Microcontroller are shown in the below image.

STM8S103F3P6 IDE and Compiler

On the Configuration side, we have the STM8CubeMx, I tried the software and it was a complete let down for me. Unlike the STM32Cube, the STM8Cube cannot auto-generate code. It can only generate pin mapping for visualization purposes and might come in handy if you are porting your code from one controller to another. Other than that, I would not use it. So in this tutorial series, we won’t be using this.

For the IDE and Compiler, we have a lot of options to choose from. The top two options for IDE are IAR workbench and ST Visual Develop (STVD), both the software feels like they are from the 90s but after some time playing with it, I found the STVD is a good choice only because it is totally free. Similarly, for the Compiler, we will be using the Cosmic C Compiler, again only because it is totally free. Another reason for choosing this IDE and Compiler is that, once we get familiar with the environment, it should be easy to use any other 8-bit Microcontroller from ST without much effort. We will get into how to install and set-up STVD with Cosmic C compiler later in this article.

For Flashing, we will be using ST Visual Programmer (STVP), this tool will automatically get installed when we install STVD. It will be integrated in the IDE itself, helping us to quickly program and debug. The final software will be STMStudio which is an STM8 Monitoring software. The software can help with real-time debugging of STM8 and has some cool features like monitoring variable value, plotting graph, etc. I have not experimented enough with this software. And, at least for the first few tutorials, we won’t be using this software since we won’t need big debugging requirements.

STM8S Standard Peripheral Library: ST Microelectronics provides a set of libraries to make code development easier for the STM8S Microcontrollers, this library is called the “Standard Peripheral Library” or SPL in short. The library is cool except for that it is written by keeping in mind all the possible controllers in the STM8S/A 8-bit family and not just the STM8S103F3P6 controller which we will be using. Hence, we have to make some tweaks here and there to make it work (which I will share later). But still, I believe it worth giving it a try because it can make development very fast, and hence, we will be using it in our tutorial.

If you do not want to use the library, you have to directly access the Registers of the controller or do bare metal assembly programming. Both of these are fun, provided you have the time to learn and use it. My idea is to use the SPL library wherever it works well and then also work on register and assembly level if required. Let’s try not to re-invent the wheel!

STM8S with Arduino using Sduino

Discussing the software options will never be complete if I do not mention the Arduino IDE support STM8S. Yes, the same STM8S103F3P6 board can be programmed directly from Arduino IDE using Sduino, thanks to Michael Mayer. But, the project is still in the development stage and would likely take some time and community support for Sduino to provide complete platform support. However, just within a few minutes of playing with Sduino, I started to like it and hence decide to also do a separate article on how to program STM8S Microcontroller with Arduino. I will link the article here when it is ready. That article will discuss why and why not you should use the Arduino IDE for programming your STM8S Microcontrollers.

So, these are my choices for Software and Hardware, let me know in the comment section if you think some other software would have been a better choice and why. I would like to explore other options as well.

Downloading Required Software’s

Now that we have decided on the software will we use for this tutorial, let’s go ahead and download them using the following link. All the software is free to download and use, you would just have to register a free account on ST and Cosmic if you had not already.

  • ST Visual Develop (STVD)
  • Cosmic C Compiler
  • Standard Peripheral Library 
  • STM8Cube Mx (Optional)
  • STMStudio for STM8 (Optional)

Setting up the STVD and Cosmic C Compiler

After you have downloaded both the software, just follow the on-screen instructions to install them. I would recommend to leave them at the default directories to avoid later confusion. The STVD IDE will install without any effort. For the Cosmic C compiler, you have to get a free license key during the installation processes. You just have to provide company information with E-mail ID, if you are a student, just mention that. The processes of getting the license key are instantaneous and automatic, although the set-up instructions say that it might take a day or two, I received the license key automatically on my E-Mail ID as soon I submitted it, just make sure you check the SPAM. My Confirmation E-Mail is shown below.

Cosmic C Compiler

As per the E-mail instruction, just copy the license.lic file and paste in the “license” sub-folder in your installation folder. For me the path was “C:Program Files (x86)COSMICFSE_CompilersCXSTM8License”. Just paste the file in location as shown below.

Cosmic C Compiler License

Standard Peripheral Library for STM8S103F3P6

As told earlier, ST Microelectronics provides Libraries called SPL which can be used for all 8-bit STM8S/A Microcontrollers. You can either download the original SPL from ST Microelectronics and make the required changes or download my STM8S103F3P6 SPL libraries and use them as such. I would recommend the later.

Original SPL from ST Microelectronics

STM8S103F3P6 SPL

While you are there also ensure to download the SPL User Manual, which will be very handy when programming the controller.  

Compiling the First Program

Now that everything is ready, let’s try compiling our first program to check if the IDE, Compiler, and Library are all working the way they should. You can also check the video at the bottom of the page for detailed instructions.

Start by opening STVD and select File -> WorkSpace, in the pop-up, select “New Workspace” and enter the Project name and path where the program should be saved. I am naming my program BareMinimum and saving it in a folder on the desktop. Click OK and you will get the New Project dialog box as shown below.

Compiling IDE for STM8S103F3P6

I am naming the project as bareminimum again and under toolchain we have to specify the toolchain root to the path where the STM8 Cosmic compiler is installed. The default path address is “C:Program Files (x86)COSMICFSE_CompilersCXSTM8”. After that just click OK to get the “MCU Selection” window.

STM8S103F3P6 Compiling

Search for STM8S103F3P and select it and click OK. This will open a new project for STM8S103F3P on STVD, the windows should look like this when done.

Programming STM8S103F3P6

Right-click on “source file” and select “Add files to folder” to include all the c files from our SPL library, similarly right-click on Include files to include all the header files. If you have any questions, you can refer to the video below. Once all the files are added, click Build -> rebuild all and then Compile to check if the compiler and SPL are working as expected. If everything goes well, you should see the following screen with build result 0 error and 0 warning.

STM8S103F3P6 Programming

With this done, now we can be sure all our SPL libraries are working with Cosmic compiler and STVD. This is the standard procedure that we will follow for every new project. You can also include only the necessary header and source files that are needed for the project to reduce build time if required.

Uploading the Code from STVD to STM8S Development board using ST-Link V2

Connect the ST-Link V2 with the development board as shown below.

Interfacing STM8S Development board using ST-Link V2

The connections are pretty straight forward and the best part is you need no external components. My hardware setup for programming is shown below, I have just used the female header wires to make my connection. However, do note that the pinout of your ST-Link might differ from mine, make sure to follow the pinout on the device before making the connections.

STM8S Development board with ST-Link V2

Make the connection and connect the device to your computer, the driver installation should begin automatically. You can use the device manager to ensure if your computer has discovered ST-LINK V2 correctly. You will also notice the test LED on the board blinking if this is the first time powering the board. As soon as we have successfully compiled the code on STVD, we will get an “S19” Extention file under the debug directory of the project folder. My S19 file is shown below.

STVD S19 Extention File

This S19 is like the Hex file which should be uploaded to the controller. To upload the program, open ST Visual Programmer (STVP) which should have installed along with STVD. Then in the configuration window, select as shown in the below image and click OK.

STM8S Development Board Configuration

Then click on File->Open and navigate to the S19 file that we showed earlier. Then to flash the device, follow Program -> Current Tab. If the flashing was successful, you should see the following output.

STVD Output for LED Flashing

By default, when you purchase the STM8S, it will have a blin program that blinks the test LED. Now after uploading this blank code, the LED will no longer blink.

Important: I found that my ST-Link did not reset the board automatically after programming. I had to disconnect and reconnect it to check the output of my program. I am not sure if this is a problem for everyone, let me know in the comment section. Also, check out the video at the bottom which explains the solution to this.

With this, let’s wind up this tutorial, we have learned the basics of hardware, have set up the development environment and learned how to compile and upload code. We are now ready to progress and we will be using this in all our upcoming tutorials. If you have any questions, please post them on our forums and stay tuned for more!!

SETUP ST VISUAL DEVELOP WITH THE COSMIC STM8 COMPILER

setup-st-visual-develop-with-the-cosmic-stm8-compiler image

Step 1: Download the Cosmic Compiler and ST Microelectronics IDE (STVD) You will need to register on the ST.com site and the Cosmic.com site and download several programs from them. Additionally you need a license to use the …
From instructables.com


GETTING STARTED WITH STM8S USING STVD AND COSMIC C …

getting-started-with-stm8s-using-stvd-and-cosmic-c image

Jun 15, 2020 As per the E-mail instruction, just copy the license.lic file and paste in the “license” sub-folder in your installation folder. For me the path was “C:Program Files (x86)COSMICFSE_CompilersCXSTM8License”. Just …
From circuitdigest.com


FAANG THAI RESTAURANT & BAR | WARRENTON VA — FACEBOOK

Faang Thai Restaurant & Bar, Warrenton, Virginia. 828 likes · 4 talking about this · 3,131 were here. Take Out, Delivery, and Full Bar.
From facebook.com


THE 10 BEST WARRENTON FOOD DELIVERY & TAKEOUT — ORDER ONLINE …

Whether you’re in the mood for American Food delivery, Mexican Food delivery, or something else, find something to satisfy your cravings, from the places offering delivery in Warrenton, …
From ubereats.com


COMPILATION ERROR COSMIC · ISSUE #1 · GICKING/STM8_TEMPLATES

Dec 22, 2017 hi RandoSY, thanks a lot for pointing this out! However, lately I have been extending the functionality of the STM8_templates quite a bit, including SPL support, more …
From github.com


EL AGAVE – MEXICAN RESTAURANT

El Agave Mexican Restaurant has been serving the freshest, most authentic Mexican cuisine in and around Northern Virginia for years. Using the highest quality ingredients available, each …
From elagavemexrestaurant.com


FREE SOFTWARE TOOL FROM STMICROELECTRONICS ADDS ONE MORE …

Moreover, as project safety requirements increase, CXSTM8 field-proven reliability can be easily completed with Cosmic’s Unit Testing and RunTime Core Validation products.” Further …
From st.com


HOW TO FIX COSMIC COMPILE ERROR(FLEXLM NO SUCH FEATURE EXISTS)

Compiler was installed with the license received by Cosmic, and the license was copied to the License folder in the Cosmic Compiler installation path (C:Program Files …
From community.st.com


HOME — STMICROELECTRONICS

Home — STMicroelectronics
From st.com


DEVELOPING STM8 PROJECTS WITH VISUAL STUDIO – VISUALGDB TUTORIALS

Jan 26, 2022 Make sure you install it before proceeding with this tutorial. Once you have installed CXSTM8, follow the steps below to create, build and debug a basic project: Start …
From visualgdb.com


GETTING STARTED WITH STM8 MICROCONTROLLERS | CUSTOM | MAKER PRO

Jun 6, 2018 The first step in using STM8 devices is to download and install the IDE. Currently there are two IDEs that you can use: STVD and IAR. IAR is a more modern system that …
From maker.pro


MENU — FAANGTHAI.COM

MENU — faangthai.com
From faangthai.com


COSMIC SOFTWARE — DOWNLOAD STM8 FREE COMPILER

Register for the FREE stm8 Compiler Fill and submit the form below to download the free stm8 compiler. To use this product you must register with Cosmic Software (this page) and then get …
From cosmicsoftware.com


STM32 FULL DEVELOPMENT PACKAGE (COMPILER + DEBUGGER)

CXSTM32. STM32 Full Development Package (Compiler + Debugger) Cosmic’s toolchain for the STM32 family (M0, M0+, M3, M4 and M7) is part of a complete and uniform product line …
From st.com


ERROR CREATING PROCESS FOR EXECUTABLE CXSTM8 — ST …

Mar 19, 2019 Error creating process for executable cxstm8 I’m using the Cosmic Software 4.4.9.0 in ST Visual Develop 4.3.12 I can’t compile it.I try to install again but it showing same …
From community.st.com


COSMIC SOFTWARE — STM8 AND STLUX PRODUCTS

The Cosmic STM8 compiler generates highly efficient code for STM8 and STLUX families of microcontroller s including the STM8AF, STM8AL, STM8L, STM8S and STM8T Series. ANSI …
From cosmic-software.com


Форум РадиоКот • Просмотр темы — Программирование STM8

Сообщения без ответов | Активные темы

ПРЯМО СЕЙЧАС:

Автор Сообщение

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб окт 19, 2019 07:47:34 

Друг Кота
Аватар пользователя

Карма: 32

Рейтинг сообщений: 482

Зарегистрирован: Сб сен 10, 2011 17:46:25
Сообщений: 3832

Рейтинг сообщения: 0

nuisance писал(а):

Где вообще про них рассказывается?

Обычно в документации к компилятору. Но тут странная ошибка:

Цитата:

WIN execution failed

типа виндовс не может запустить exe файл компилятора (cxstm8.exe).
Cosmic установлен стандартным путем? Т.е. скачан с сайта, установлен, потом запрос лицензии, французы присылают бесплатную лицензию, которую надо указать…
Начать можно было бы с создания простого проекта — в STVD хороший визард создания проекта. Там нужно потом только добавить заголовочный файл от производителя.
Пример, вижу для stm8 touchsensing — вполне возможно надо скачать посвежее версию с родного сайта, у меня Cosmic эти оба примера нормально компилирует:
https://www.st.com/en/embedded-software … h-lib.html

Вернуться наверх
 

ПрофильПрофиль

 

Реклама

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб окт 19, 2019 13:13:55 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Отмечусь в теме чтобы не потерять.


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх
Реклама

nuisance

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вс окт 20, 2019 19:18:56 

Зарегистрирован: Чт апр 07, 2016 09:44:42
Сообщений: 5

Рейтинг сообщения: 0

Cosmic установлен стандартным путем? Т.е. скачан с сайта, установлен, потом запрос лицензии, французы присылают бесплатную лицензию, которую надо указать…

Скачан стандартно. С родного сайта. Лицензия и всё такое… Установлен, не по умолчанию, а по моему усмотрению (в смысле путей установки).
Новые воркспейсы и проекты (пустые) создаёт и компилирует без ошибок.
Но я подумал, что в процессе ковыряния своими кривыми руками (мозгами) обязательно что-нибудь сломаю :) и тогда захочется откатить как было. Вот и скачал с родного сайта демо прогу, которая поставляется с дискавери. Пытаюсь её откомпилировать, чтобы, по мере надобности залить обратно.
В ходе экспериментов понял, что сначала надо освоить рабочую среду. Почитал мануал на Космик, но про ошибку с кодом 2 ничего не нашёл. Понял, что надо копать глубже, а вот где копать не знаю :(
Спасибо за совет. Попробую скачать новую версию заливки. О результатах сообщу.
Но вопрос про теорию остаётся открытым.

Добавлено after 53 minutes 2 seconds:
Скачал. Там приложение для STM8S207K6, а у меня на дискавери стоит STM8S105C6.
Это принципиально?

Вернуться наверх

oleg110592

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Пн окт 21, 2019 07:30:07 

Друг Кота
Аватар пользователя

Карма: 32

Рейтинг сообщений: 482

Зарегистрирован: Сб сен 10, 2011 17:46:25
Сообщений: 3832

Рейтинг сообщения: 0

Скачал. Там приложение для STM8S207K6, а у меня на дискавери стоит STM8S105C6.
Это принципиально?

Работать скорее всего не будет, но для проверки правильности компиляции сгодится.
Скачал пример «Project discover» — Cosmic нормально компилирует, без ошибок. Если что, Cosmic установил в корень диска C: в папку C:COSMIC.

Вернуться наверх
Реклама

Выгодные LED-драйверы для решения любых задач

КОМПЭЛ представляет со склада и под заказ широкий выбор LED-драйверов производства MEAN WELL, MOSO, Snappy, Inventronics, EagleRise. Линейки LED-драйверов этих компаний, выполненные по технологии Tunable White и имеющие возможность непосредственного встраивания в систему умного дома (димминг по шине KNX), перекрывают практически полный спектр применений: от простых световых указателей и декоративной подсветки до диммируемых по различным протоколам светильников внутреннего и наружного освещения.

Подобрать LED-драйвер>>

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб окт 26, 2019 20:17:06 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Как при отладке в IAR в окне кода вывести зеленую стрелочку, указывающую, какая строка программы выполняется после каждого шага? В окошке дизассемблера стрелочка есть, а в окне кода нет.


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх
Реклама

Реклама

LIMF – источники питания High-End от MORNSUN со стандартным функционалом на DIN-рейку

На склад Компэл поступили ИП MORNSUN (крепление на DIN-рейку) с выходной мощностью 240 и 480 Вт. Данные источники питания обладают 150% перегрузочной способностью, активной схемой коррекции коэффициента мощности (ККМ; PFC), наличием сухого контакта реле для контроля работоспособности (DC OK) и возможностью подстройки выходного напряжения. Источники питания выполнены в металлическом корпусе, ПП с компонентами покрыта лаком с двух сторон, что делает ее устойчивой к соляному туману и пыли. Изделия соответствуют требованиям ANSI/ISA 71.04-2013 G3 на устойчивость к коррозии, а также нормам ATEX для взрывоопасных зон.

Подробнее>>

VladislavS

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб окт 26, 2019 20:50:30 

Поставщик валерьянки для Кота
Аватар пользователя

Карма: 13

Рейтинг сообщений: 362

Зарегистрирован: Вт май 01, 2018 19:44:47
Сообщений: 2300

Рейтинг сообщения: 1

Нужно скомпилировать с добавлением отладочной информации.

Вернуться наверх

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб окт 26, 2019 21:50:13 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Да, действительно, поставил в настройках проекта галку «Generate debug information» и стрелочка появилась :)

VladislavS, благодарю.


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вс окт 27, 2019 09:45:20 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Еще пара вопросов появились. Как я выяснил методом тыка, отладка в железе работает только в конфигурации «Release», а не «Debug», как казалось бы и должно быть. Для чего тогда Debug? Для отладки в симуляторе?

Второе. Пошаговая отладка в IAR работает нормально, программа-мигалка блинкает если прогонять программу по шагам нажатием кнопки «Step over». При нажатии на кнопку «Go» ничего не происходит, светодиод постоянно светиться и не мигает… Хотя, если много раз нажимать последовательно «Go» и «Break» видно, как стрелочка в окне кода останавливается на рандомных строчках программы в цикле while в блоке main, и светодиод после остановки программы либо светиться, либо нет, в зависимости от того на какой строчке произошла остановка.

И, светодиод во время выполнения отладки не мигает, но светиться как-то тускло, а когда останавливаешь зажигается немного ярче. Похоже что он мигает, но с очень большой частотой. Такое впечатление, что отладчик игнорирует задержки. Один раз мне удалось тыканьем в кнопки заставить светодиод мигать в режиме отладки, но не помню как я этого добился.

Микроконтроллер STM8S103F3P, код мигалки под спойлером взят из интернета.


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх

GARMIN

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вс окт 27, 2019 13:36:39 

Опытный кот
Аватар пользователя

Карма: 16

Рейтинг сообщений: 152

Зарегистрирован: Вс дек 02, 2012 16:58:33
Сообщений: 724
Откуда: Мать городов Русских

Рейтинг сообщения: 1

Проверьте настройки в обоих конфигурациях, они независимые. Отладка прекрасно работает в обоих случаях.
Задержки может игнорировать из-за оптимизации компилятора. Иои уберите оптимизацию, или используйте volatile переменную в функции задержки.

Вернуться наверх

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вс окт 27, 2019 17:26:56 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Квалификатор volatile не помог, а после настроек оптимизации задержки стали работать, а светодиодик моргать. На самом высоком уровне оптимизации МК отказывался отрабатывать задержки при оптимизации по скорости. Ну да ладно, работает при оптимизации по размеру, и хорошо. Для меня обычно важнее бывает утрамбовать прошивку по размеру, чем оптимизировать ее по скорости выполнения. GARMIN, спасибо.

P.S. кстати, задержки не только в отладке не работали. И без отладки прошивка не хотела работать как нужно.


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх

GARMIN

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Пн окт 28, 2019 20:50:58 

Опытный кот
Аватар пользователя

Карма: 16

Рейтинг сообщений: 152

Зарегистрирован: Вс дек 02, 2012 16:58:33
Сообщений: 724
Откуда: Мать городов Русских

Рейтинг сообщения: 0

Просто задержки делаются совсем по другому.
С миллисекундным таймером и без циклов ожидания.
Тогда другие функции будут работать во время ожидания таймера в одной.
А у вас полная блокировка процессора на время ожидания.

Вернуться наверх

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Пн окт 28, 2019 23:45:00 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Ну да, delay — несомненное зло. Но сейчас я курю stm8 с самого начала, и мне бы чего побыстрее, на скорую руку, чтобы освоиться со средой программирования, программатором, самим микроконтроллером и его начальной инициализацией. До таймеров когда еще доберусь. Кстати, оптимизация по скорости выполнения скорее всего устранила задержки решив, что они зря жрут машинные циклы :)))


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх

Eddy_Em

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вт окт 29, 2019 07:41:12 

Собутыльник Кота
Аватар пользователя

Карма: -12

Рейтинг сообщений: -18

Зарегистрирован: Пт июл 12, 2019 22:52:01
Сообщений: 2525

Рейтинг сообщения: 1

Asmodey, может поможет: куча моих сниппетов на STM8.


_________________
Linux rules! Windows must die. Здравомыслящий человек добровольно будет пользоваться мастдаем лишь в двух случаях: под дулом автомата или под влиянием анального зонда.
Я на гитхабе, в ЖЖ

Вернуться наверх

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Пт ноя 01, 2019 18:27:20 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

Eddy_Em, а можно чуть более подробную информацию по этому проекту https://github.com/eddyem/STM8_samples/ … r/Makefile ? Это генератор шума или генератор функций? Управляется по uart или можно кнопки, энкодеры и дисплей прикрутить. Контроллер как я понял STM8S105?


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх

Eddy_Em

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб ноя 02, 2019 07:39:57 

Собутыльник Кота
Аватар пользователя

Карма: -12

Рейтинг сообщений: -18

Зарегистрирован: Пт июл 12, 2019 22:52:01
Сообщений: 2525

Рейтинг сообщения: 0

Asmodey, это шим-генератор всяких разных сигналов. Я думал было игрушку сделать музыкальную, но забил.


_________________
Linux rules! Windows must die. Здравомыслящий человек добровольно будет пользоваться мастдаем лишь в двух случаях: под дулом автомата или под влиянием анального зонда.
Я на гитхабе, в ЖЖ

Вернуться наверх

Asmodey

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Сб ноя 02, 2019 13:12:09 

Говорящий с текстолитом
Аватар пользователя

Карма: 13

Рейтинг сообщений: 272

Зарегистрирован: Сб янв 28, 2006 22:47:24
Сообщений: 1641

Рейтинг сообщения: 0

А она умеет что-то делать в уже имеющемся виде? Хотелось бы разобрать какой-нибудь готовый проект для лучшего усваивания инфы по stm8, и вот этот Ваш приглянулся :)


_________________
Астролябия-сама меряет, было бы что мерять!!!

Вернуться наверх

nanocat

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вт ноя 05, 2019 09:38:35 

Зарегистрирован: Чт июн 16, 2016 03:10:05
Сообщений: 2

Рейтинг сообщения: 0

Кто-нибудь сталкивался с невозможностью прошивки STM8 с aliexpress?
Заказал с aliexpress 10 штук STM8S105K4T6. Запаял в плату и не прошивается. Программатор просто не может связаться с микрокнтроллером.
Запаял вместо него другой STM8S105K4T6, но приобретенный в ЧипДипе. И этот чип видится и перепрошивается. Запаял прежний и опять не работает!

Есть у меня еще китайская плата с тем же STM8S105K4T6. Решил с ней поработать. Подключился к ней — все работает. Выпаял из платы чип, запаял несколько из купленной партии с алэкспресса. И ни один не работает!
По схемотехнике абсолютно точно все в порядке. Напряжения в норме на Vcap конденсатор 1 мкф.

В начале этой темы DrWatson отписался

Цитата:

1) «Чистый» микроконтроллер всегда стартует с загрузчика.

Может у новых МК отключен swim?

Вернуться наверх

oleg110592

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вт ноя 05, 2019 10:20:24 

Друг Кота
Аватар пользователя

Карма: 32

Рейтинг сообщений: 482

Зарегистрирован: Сб сен 10, 2011 17:46:25
Сообщений: 3832

Рейтинг сообщения: 0

Напряжения в норме на Vcap конденсатор 1мкф

на Vcap напряжение 1.8В ?
на всякий, утилитка командной строки для прошивки stm8 под виндовс:
https://github.com/sensics/IR-Board-Pro … /stm8flash
не самая свежая — опция -u может не работать, примеры командной строки для stm8s003f3:

Код:

stm8flash -cstlinkv2 -pstm8s003?3 -u
stm8flash -cstlinkv2 -pstm8s003?3 -s flash -w tru-la-la.hex
stm8flash -cstlinkv2 -pstm8s003?3 -s eeprom -w tru-la-la_ee.bin
stm8flash -cstlinkv2 -pstm8s003?3 -s opt -w rop.bin

исходники утилиты и информация:
https://github.com/vdudouyt/stm8flash

Вернуться наверх

nanocat

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вт ноя 05, 2019 11:18:56 

Зарегистрирован: Чт июн 16, 2016 03:10:05
Сообщений: 2

Рейтинг сообщения: 0

на Vcap напряжение 1.8В ?

Да. В том то и дело, что в одной и той же обвязке stm8 из ЧипДип работают, а те что с aliexpress не работают

на всякий, утилитка командной строки для прошивки stm8 под виндовс:

То же не помогает. Кстати, как можно натянуть на эту программу графический интерфейс? Или это в двух словах не объяснить?

Вернуться наверх

Z_h_e

Не в сети

Заголовок сообщения: Re: Программирование STM8

СообщениеДобавлено: Вт ноя 05, 2019 11:33:37 

Собутыльник Кота
Аватар пользователя

Карма: 25

Рейтинг сообщений: 637

Зарегистрирован: Сб май 14, 2011 21:16:04
Сообщений: 2664
Откуда: г. Чайковский

Рейтинг сообщения: 0

Медали: 1

Получил миской по аватаре (1)

Попробуйте нажать кнопку RESET или что-там есть, дать команду прошиться и тут же RSET отпустить. У меня как-то 103 так заработал, может случайно. Возможно в китайских МК прошивка сразу после старта отключает SWIM.


_________________
Изображение
Добро всегда побеждает зло. Поэтому кто победил — тот и добрый.

Вернуться наверх

Кто сейчас на форуме

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 18

Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

На сегодняшний день есть два очень популярных инструмента для разработки под микроконтроллеры STM8:

— ST Visual Develop — бесплатная среда разработки от STMicroelectronics

— IAR EW for STM8 — платная среда разработки (но есть выпуск Kick starter с ограничением в 8 кБ кода)

У первой есть один недостаток — нет встроенного компилятора языка C, есть только STM8 ассемблер. Этот недостаток можно восполнить скачав и установив сторонний компилятор Cosmic C Compiler (с некоторых пор он бесплатный).

Если со скачиванием и установкой IAR не возникает никаких проблем, то с парой ST Visual Develop (STVD) и Cosmic STM8 C Compiler (CXSTM8) придется немножко повозиться. Хотя на сегодняшний день хлопот от получения до использования продуктов стало меньше, чем ранее (активация Cosmic теперь через Web, раньше было через E-Mail, письма обрабатывались в ручную и лицензию приходилось ждать до 2-ух рабочих дней).

Скачать ST Visual Develop можно отсюда, с офсайта https://www.st.com/en/development-tools/stvd-stm8.html

Внизу страницы можно увидеть вот такую таблицу

По нажатии на GET software нужно будет ввести свои данные и адрес почты, куда придет ссылка на скачивание.

Если не хочется регистрироваться, то можно скачать софт с облака (пароль архива ipasoft.info) https://drive.google.com/file/d/1n3LtyWyGnPcxmYCtUtF8SIWdeDHs7JCr/view?usp=sharing

Скачать COSMIC C Compiler можно отсюда, с офсайта http://cosmicsoftware.com/download_stm8_32k.php

Если ссылка побьется или условия изменятся, то можно воспользоваться ссылкой в облаке (пароль архива ipasoft.info) https://drive.google.com/file/d/1Foouu842DwA3cM0_muZnQ515CtYOxN1G/view?usp=sharing

Устанавливайте STVD, Никаких нюансов не возникнет. С COSMIC’ом придется еще немного повозиться.

Установите COSMIC, соглашайтесь со всем, что он попросит.

По окончании установки не торопитесь закрывать окно установщика, оставьте чекнутой галочку «регистрация продукта». Можно жать ОК. Откроется текстовый документ с инструкцией по активации, его необходимо! закрыть. После чего вылезет окно регистрации. Регистрацию делайте On web!, в полях нужно будет ввести свои данные и актуальный адрес E-Mail. После подтверждения на почту практически мгновенно приходит файл с лицензией. Почта на mail.ru хорошо поддерживается, в СПАМ ничего не улетает.

После получения файла с лицензией запускайте Cosmic CXSTM8 Special Edition и указывайте файл с лицензией для регистрации продукта. Срок регистрации будет 1 год, после чего регистрацию нужно будет повторить, получив новый файл лицензии.

Полученный файл лицензии старайтесь не удалять, а расположите где-нибудь в очевидном месте, например в папке с установленным COSMIC, иначе можно будет однажды словить ошибку «FlexLM No such feature exists» от которой никак не избавишься кроме того как чистить реестр и переустанавливать компилятор заново (об этом способе можно прочесть >>тут<<). Я как то случайно удалил этот файл лицензии и не понимал, что за Flex License Manager не дает мне работать и что он от меня хочет, но к счастью, в почте осталось письмо от Cosmic, где из вложения я повторно скачал файл лицензии и стал относиться к этому файлику внимательнее.

Программы готовы к использованию.

Давайте создадим тестовый проект в STVD

File -> New workspace -> Create workspace and project

Укажите папку и имя для workspace, нажмите ОК

Затем укажите имя проекта, выберите toolchain «STM8 Cosmic», а в Toolchain root укажите путь к компилятору (обычно C:Program Files (x86)COSMICFSE_CompilersCXSTM8) нажмите ОК

Введите имя интересующего контроллера (или часть имени, например stm8s003f3), щелкните на нем в списке найденных камней, кликните Select, после чего станет активной кнопка ОК, жмите ОК.

Проверьте, насколько корректно все работает. Просто подключите заголовочный файл iostm8s003.h как на рисунке и компилируйте код

Таким образом вы имеете надежный инструмент разработки практически без ограничений (кроме необходимости ежегодно обновлять лицензию на компилятор C).

@RandoSY

Basic Project … I’m seeing these errors…

———— Project STM8_Template — STM8 Cosmic — Configuration Debug ————-

Compiling ……..librarybasegpio.c…
cxstm8 +warn +modsl +debug -pxp -no -pp -l -dUSE_TIM4_ISR -dDEBUG -i……..librarybase -i.. -i….stm8_lib -i..stm8_lib -i……..librarymuboard -i..stvd_cosmic -i»C:Program Files (x86)COSMICFSE_CompilersCXSTM8Hstm8″ -clDebug -coDebug ……..librarybasegpio.c
#error cpstm8 ……..librarybasestm8as.h:195 bad # operand
#error cpstm8 ……..librarybasestm8as.h:196 bad # operand
……..librarybasegpio.c:

Apparently cxstm8 doesn’t like #asm, #endasm in the define statment

#error cpstm8 ……..librarybasestm8as.h:195 bad # operand
#error cpstm8 ……..librarybasestm8as.h:196 bad # operand

This is a great project! Thanks for posting.

@gicking

hi RandoSY,

thanks a lot for pointing this out! However, lately I have been extending the functionality of the STM8_templates quite a bit, including SPL support, more STM8 families, and auto-dependency detection (similar to Arduino). Therefore there haven’t been updates for quite a while — sorry for that!

Unfortunately I recently ran into a stupid, non-technical issue. Basically my intention was to replace my custom «stm8as.h» by the device headers from the SPL —> support all STM8 families without having to create my own headers (which is a LOT of effort). However, as pointed out by spth the SPL licence still is not OS —> shouldn’t use it here :-(

I am still struggling about how to proceed from here, ideally without having to scrap the work of the past months…

Ok, but to come back to your question: I will look into that and try to fix it. Thanks again for pointing it out!

@gicking

hi RandoSY,

I have just updated the repository with my current status. As you can see I have made up my mind to stick to my own headers (i.e. not use SPL), but to provide an example how to mix with SPL.

All examples have been tested with the latest SDCC and Cosmic-Eval compilers (latter with exception of «STM8_StdPeriphLib»). Please let me know what you think of the changes, and if it now works for you. Thanks a lot in advance!

Greetings, Georg

PS: with the new ISR structure, I believe things are now much more robust. At least updating the examples to the new structure, and mixing with SPL, turned out to be a breeze so far… :-)

@RandoSY

Hi Georg,

Wow! Thanks so much for the consideration of your prompt reply.

I am testing with a fresh install of ST Visual Develop, and recently licensed COSMIC stm8 C compiler (cxstm8).

Still seeing L

———— Project STM8_Template — STM8 Cosmic — Configuration Release ————-

Compiling ……..librarybasesrcgpio.c…

cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i……..librarystm8s_discoveryinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ……..librarybasesrcgpio.c

#error cpstm8 ……..librarybaseincstm8as.h:195 bad # operand

#error cpstm8 ……..librarybaseincstm8as.h:196 bad # operand

……..librarybasesrcgpio.c:

The command: «cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i……..librarystm8s_discoveryinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ……..librarybasesrcgpio.c» has failed, the returned value is: 1

exit code=1.

STM8_Template.elf — 4 error(s), 0 warning(s)

I wonder if it’s something wrong in my setup???

Thanks again, all your STM8 work is GREAT! I really need to get over to Linux and take a look at SDCC and your excellent project…

Best,

Randy

PS. Happy Holidays!!!

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Tuesday, December 26, 2017 6:32 PM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

hi RandoSY,

I have just updated the repository with my current status. As you can see I have made up my mind to stick to my own headers (i.e. not use SPL), but to provide an example how to mix with SPL.

All examples have been tested with the latest SDCC and Cosmic-Eval compilers (latter with exception of «STM8_StdPeriphLib»). Please let me know what you think of the changes, and if it now works for you. Thanks a lot in advance!

Greetings, Georg

PS: with the new ISR structure, I believe things are now much more robust. At least updating the examples to the new structure, and mixing with SPL, turned out to be a breeze so far… :-)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm_J4F_4UlTLXHeufIhEyk1YqBqYFks5tEYH1gaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOm7l6QpSI7InKMAZ9D0nWHc5NYkB-ks5tEYH1gaJpZM4RLKoc.gif>

@RandoSY

Georg,

OK, finally have correct compiler in path, simplest template example. Sorry I am SO SLOW today. Way, way too much party over XMAS.

Removing intermediate files … Done!

———— Project STM8_Template — STM8 Cosmic — Configuration Release ————-

Compiling ……..librarybasesrcgpio.c…

cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i……..librarystm8s_discoveryinc -i»C:Program Files (x86)COSMICFSE_CompilersCXSTM8Hstm8″ -cl..stvd_cosmic -co..stvd_cosmic ……..librarybasesrcgpio.c

#error cpstm8 ……..librarybaseincstm8as.h:195 bad # operand

#error cpstm8 ……..librarybaseincstm8as.h:196 bad # operand

……..librarybasesrcgpio.c:

The command: «cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i……..librarystm8s_discoveryinc -i»C:Program Files (x86)COSMICFSE_CompilersCXSTM8Hstm8″ -cl..stvd_cosmic -co..stvd_cosmic ……..librarybasesrcgpio.c» has failed, the returned value is: 1

exit code=1.

STM8_Template.elf — 3 error(s), 0 warning(s)

From

/**********************

simple C-project without Arduino-like initialization and

setup()/loop(). No assumption is made, no interrupts used.

Can be used as starting point for projects with extreme

memory limitations or real-time requirements.

Functionality:

— init FCPU to 16MHz

— configure LED pin as output

— toggle LED every 500ms w/o timer -> blocking

**********************/

/*———————————————————-

INCLUDE FILES

———————————————————-*/

#include «stm8as.h» // STM8 peripheral registers

#include «gpio.h» // pin access routines

#include «sw_delay.h» // dummy pause without timer

// define board LED pin for STM8S Discovery Board

#define LED pinSet(PORT_D, pin0)

// main routine

void main(void) {

// switch to 16MHz (default is 2MHz)

CLK.CKDIVR.byte = 0x00;

// configure LED pin as output

pinMode(PORT_D, pin0, OUTPUT);

// main loop

while (1) {

// toggle LED

LED ^= 1;

// wait some time

sw_delay(500);

} // main loop

} // main

Best,

Randy

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Tuesday, December 26, 2017 6:32 PM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

hi RandoSY,

I have just updated the repository with my current status. As you can see I have made up my mind to stick to my own headers (i.e. not use SPL), but to provide an example how to mix with SPL.

All examples have been tested with the latest SDCC and Cosmic-Eval compilers (latter with exception of «STM8_StdPeriphLib»). Please let me know what you think of the changes, and if it now works for you. Thanks a lot in advance!

Greetings, Georg

PS: with the new ISR structure, I believe things are now much more robust. At least updating the examples to the new structure, and mixing with SPL, turned out to be a breeze so far… :-)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm_J4F_4UlTLXHeufIhEyk1YqBqYFks5tEYH1gaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOm7l6QpSI7InKMAZ9D0nWHc5NYkB-ks5tEYH1gaJpZM4RLKoc.gif>

@RandoSY

Georg,

Here’s the offending section, of the required header file. ???, looks correct to me???

// Cosmic compiler

#if defined(__CSMC__)

#define reg(addr,type,name) extern volatile type name @addr ///< syntax for variables at absolute addresses

#define ASM(mnem) _asm(mnem) ///< single line inline assembler

#define ASM_START #asm ///< start multi-line inline assembler

#define ASM_END #endasm ///< end multi-line inline assembler

Have a great day.

Best,

Randy

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Tuesday, December 26, 2017 6:32 PM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

hi RandoSY,

I have just updated the repository with my current status. As you can see I have made up my mind to stick to my own headers (i.e. not use SPL), but to provide an example how to mix with SPL.

All examples have been tested with the latest SDCC and Cosmic-Eval compilers (latter with exception of «STM8_StdPeriphLib»). Please let me know what you think of the changes, and if it now works for you. Thanks a lot in advance!

Greetings, Georg

PS: with the new ISR structure, I believe things are now much more robust. At least updating the examples to the new structure, and mixing with SPL, turned out to be a breeze so far… :-)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm_J4F_4UlTLXHeufIhEyk1YqBqYFks5tEYH1gaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOm7l6QpSI7InKMAZ9D0nWHc5NYkB-ks5tEYH1gaJpZM4RLKoc.gif>

@gicking

hi RandoSY,

looking at lines 195 and 196 I think that the error is triggered by the hashtags inside the #define. Seems like this is forbidden for ANSI-C. But what I don’t understand is, that it did compile on my PC — very strange indeed! Give some more time to investigate this…

As a first try: can you please comment lines 195 and 196 in stm8as.h and see if this solves this issue? ASM_START and ASM_END are currently only used in eeprom.h, so it should be ok for a test. Thanks in advance!

Georg

@gicking

just downloaded and installed «Cosmic Eval» fresh, and «General_Examples/Minimal-C» compiles here without warning or error (see below). Seems like the Cosmic preprocessor can handle hashtags within #defines.

Is there anything special about your installation, e.g. does your build-process use the gcc preprocessor before compiling with cxstm8…? Else I’m at a loss…

Georg

———— Project STM8_Template — STM8 Cosmic — Configuration Release ————-
Removing intermediate files … Done!

———— Project STM8_Template — STM8 Cosmic — Configuration Release ————-

Compiling ……..librarybasesrcgpio.c…
cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ……..librarybasesrcgpio.c
……..librarybasesrcgpio.c:

Compiling ……..librarybasesrcstm8_interrupt_vector.c…
cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ……..librarybasesrcstm8_interrupt_vector.c
……..librarybasesrcstm8_interrupt_vector.c:

Compiling ..main.c…
cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ..main.c
..main.c:

Running Linker
clnk -l»C:Program FilesCOSMICCXSTM8_EVALLib» -o ReleaseSTM8_Template.sm8 ReleaseSTM8_Template.lkf
cvdwarf ReleaseSTM8_Template.sm8

Running Post-Build step
chex -o ReleaseSTM8_Template.s19 ReleaseSTM8_Template.sm8

STM8_Template.elf — 0 error(s), 0 warning(s)

@RandoSY

Hi Georg,

I’m thinking we’re getting somewhere

Here’s where I’ve been downloading my free Cosmic Compiler … (after they send me the license file)

http://cosmicsoftware.com/download_stm8_free.php

This is where my Cosmic STM8 compiler lives … C:Program Files (x86)COSMICFSE_CompilersCXSTM8, etc. …

Whereas I notice your compiler’s instance is installed to here … C:Program FilesCOSMICCXSTM8_EVAL … DIFFERENT!

So I bet that is at the heart of the matter!

Now that I’ve sobered up a little, it did occur to me to search throughout the code base and just substitute literally whatever the #define statement was attempting to do, and see if that would correct the matter.

By way of doing something expeditious, commenting out the two offending lines works just dandy.

I really want to use the ST Develop IDE with your code, the debugger works great, got an old IAR feel, and I mean in a good way.

Thanks again!!!

Randy

Ivy Tech

https://www.ivytech.edu/

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Wednesday, December 27, 2017 5:06 PM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

just downloaded and installed «Cosmic Eval» fresh, and «General_Examples/Minimal-C» compiles here without warning or error (see below). Seems like the Cosmic preprocessor can handle hashtags within #defines.

Is there anything special about your installation, e.g. does your build-process use the gcc preprocessor before compiling with cxstm8…? Else I’m at a loss…

Georg

———— Project STM8_Template — STM8 Cosmic — Configuration Release ————-
Removing intermediate files … Done!

———— Project STM8_Template — STM8 Cosmic — Configuration Release ————-

Compiling ……..librarybasesrcgpio.c…
cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ……..librarybasesrcgpio.c
……..librarybasesrcgpio.c:

Compiling ……..librarybasesrcstm8_interrupt_vector.c…
cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ……..librarybasesrcstm8_interrupt_vector.c
……..librarybasesrcstm8_interrupt_vector.c:

Compiling ..main.c…
cxstm8 +mods0 -pp -i.. -i……..librarybaseinc -i»C:Program FilesCOSMICCXSTM8_EVALHstm8″ -clRelease -coRelease ..main.c
..main.c:

Running Linker
clnk -l»C:Program FilesCOSMICCXSTM8_EVALLib» -o ReleaseSTM8_Template.sm8 ReleaseSTM8_Template.lkf
cvdwarf ReleaseSTM8_Template.sm8

Running Post-Build step
chex -o ReleaseSTM8_Template.s19 ReleaseSTM8_Template.sm8

STM8_Template.elf — 0 error(s), 0 warning(s)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm-4vKA9-VtdU6BPSM5ESozA1gkIRks5tEr9IgaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOmx77DFYDZK8S1PY—c-qvxMfna6Sks5tEr9IgaJpZM4RLKoc.gif>

@gicking

hi RandoSY,

just found this hint -> seems like I don’t need the hashtag after all :-) Can you please try with the updated stm8as.h on Github? Let me know if it works now. Good luck!

Regards, Georg

@RandoSY

Hi Georg!,

Remarkably I found this link as well, and wondered if it wouldn’t apply.

In answer to your question, works like CHAMP! Now I can get to understanding mapping the Arduino application architecture to this new chip.

I’ve taken a hard look at debugging Arduino applications inside Atmel Studio, this works but it’s quite difficult to follow all the twists and turns, and esp. the obsufications of the C++ based libraries, this should be much simpler.

Also, I’m really feeling the way you progress your examples from dead simple, to interrupt driven low power operation, with convenient printf style UART access.

Kudos!

Here’s point is the STM8 is so cheap relatively, it’s almost disposable. Perfect for education, lot’s to learn, and much appreciated.

Best,

Randy

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Thursday, December 28, 2017 3:04 AM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

hi RandoSY,

just found this hint <https://stackoverflow.com/questions/3030099/pragma-in-define-macro> -> seems like I don’t need the hashtag after all :-) Can you please try with the updated stm8as.h on Github? Let me know if it works now. Good luck!

Regards, Georg


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm-Vt4PrS1vBZNqbJd7-8njj00Lrpks5tE0t2gaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOm7dAbHDWx-sMRPGBGtEG7vjqDcaVks5tE0t2gaJpZM4RLKoc.gif>

@gicking

hi again,

great to hear this works now!

The way you write it, it sounds like I the progression from simple to complex projects was made on purpose… However, I have to tell you that I’m just learning as I go along — and as a side-effect I get some (hopefully) useful code. I guess that’s also why I had some major changes already, i.e. when I stumbled into a issue that required some structural change. Hope it won’t happen too often, since it’s rather dull work.

I totally agree that C++ support would be really nice indeed. Apparently there is a way to achieve this with SDCC via LLVM, but it seems to be rather incomplete.

One more thing: if you are looking for true Arduino look&feel with STM8, you may also want to take a look at the sduino project. I see my project rather as a means to learn low(er)-level embedded programming — and to provide useful code for myself…

Thanks again for pointing this issue out and have a happy New Year! :-)

Georg

@RandoSY

Georg,

Working through your other Github folders, of course, what I’ve just learned applies across your other examples.

If you wouldn’t mind I have a question. Whatever attracted you to the STM8 processor in the first place?

It seems you’ve created a lot of the open source infrastructure that allows the STM8 to be used by the maker community.

Best,

Randy

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Thursday, December 28, 2017 11:14 AM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

hi again,

great to hear this works now!

The way you write it, it sounds like I the progression from simple to complex projects was made on purpose… However, I have to tell you that I’m just learning as I go along — and as a side-effect I get some (hopefully) useful code. I guess that’s also why I had some major changes already, i.e. when I stumbled into a issue that required some structural change. Hope it won’t happen too often, since it’s rather dull work.

I totally agree that C++ support would be really nice indeed. Apparently there is a way to achieve this <https://sourceforge.net/p/sdcc/mailman/message/36061704/> with SDCC via LLVM, but it seems to be rather incomplete.

One more thing: if you are looking for true Arduino look&feel with STM8, you may also want to take a look at the sduino project <https://github.com/tenbaht/sduino> . I see my project rather as a means to learn low(er)-level embedded programming — and to provide useful code for myself…

Thanks again for pointing this issue out and have a happy New Year! :-)

Georg


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm2whHBTgw1gErtXA1x8PzFEPADw6ks5tE75lgaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOmw8CDBNKgf1Z_D1FusXdGV-Ff73Aks5tE75lgaJpZM4RLKoc.gif>

@gicking

hi Randy,

not at all! I am working for an automotive supplier, and we’ve been using the STM8 for quite a while as our bred & butter controller. Reason is — as you correctly pointed out — an unparalleled features vs. price ratio.

So when I developed an IC validation tool («muBoard») years ago, of course it was based on STM8. Unfortunately I overlooked the fact that no OS C-compiler was available (and Cosmic didn’t offer eval versions). So use of the muBoard was restricted to the lucky holders of a Dongle :-( The «solution» for this was a new language with corresponding byte code interpreter. But while that was a very interesting endeavor, and works surprisingly well, it also has some major drawbacks. So, when SDCC became available, I started porting (and extending) the muBoard SW-functions to SDCC, and tried to make the toolchain as easy to use as muBatch. The result is what you see on Github.

Why stick to STM8 and not switch to Arduino? Well, recently a colleague developed a muBoard successor, which is Arduino based -> in principle I could (and probably should) stop putting effort into STM8. However, while I use Arduinos a lot nowadays and appreciate the great community support, the universe of available libraries, and the ease of use, I sometimes miss the dirty, low-level programming. Besides, I still prefer the STM8 for my more serious projects, because it’s very lean on HW, extremely robust, and has very good power-saving features (especially STM8L). Especially the latter makes it perfect for battery powered devices — and is the reason for the Minimal-C projects without any overhead.

So what’s your reason to look into STM8, if I may ask?

Regards, Georg

PS: how about switching to PM (icking@onlinehome.de) instead of using the issues page on Github?

@RandoSY

Hi Georg!

I did respond and forward to the (icking@onlinehome.de) email address you posted.

Best,

Randy

From: Georg Icking-Konert [mailto:notifications@github.com]
Sent: Friday, December 29, 2017 2:40 AM
To: gicking/STM8_templates
Cc: RandoSY; Author
Subject: Re: [gicking/STM8_templates] Compilation error Cosmic (#1)

hi Randy,

not at all! I am working for an automotive supplier, and we’ve been using the STM8 for quite a while as our bred & butter controller. Reason is — as you correctly pointed out — an unparalleled features vs. price ratio.

So when I developed an IC validation tool («muBoard») years ago, of course it was based on STM8. Unfortunately I overlooked the fact that no OS C-compiler was available (and Cosmic didn’t offer eval versions). So use of the muBoard was restricted to the lucky holders of a Dongle :-( The «solution» for this was a new language with corresponding byte code interpreter <https://frosch.piandmore.de/en/pam9/call/public-media/event_media/160611_Vortrag_Interpreter.pdf> . But while that was a very interesting endeavor, and works surprisingly well, it also has some major drawbacks. So, when SDCC became available, I started porting (and extending) the muBoard SW-functions to SDCC, and tried to make the toolchain as easy to use as muBatch. The result is what you see on Github.

Why stick to STM8 and not switch to Arduino? Well, recently a colleague developed a muBoard successor, which is Arduino based -> in principle I could (and probably should) stop putting effort into STM8. However, while I use Arduinos a lot nowadays and appreciate the great community support, the universe of available libraries, and the ease of use, I sometimes miss the dirty, low-level programming. Besides, I still prefer the STM8 for my more serious projects, because it’s very lean on HW, extremely robust, and has very good power-saving features (especially STM8L). Especially the latter makes it perfect for battery powered devices — and is the reason for the Minimal-C projects without any overhead.

So what’s your reason to look into STM8, if I may ask?

Regards, Georg

PS: how about switching to PM (icking@onlinehome.de) instead of using the issues page on Github?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAlOm2jTK-WTVvIuQmWNyLxsj2xaf4Fvks5tFJc5gaJpZM4RLKoc> . <https://github.com/notifications/beacon/AAlOm5LAOpiEjGKJdIb80KDNNhJ-jlSuks5tFJc5gaJpZM4RLKoc.gif>

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error creating process c users appdata local temp ixp000 tmp dxwsetup exe
  • Error creating process advpack
  • Error creating output media reaper
  • Error creating new folder rpf directory x64 already exists network graphics
  • Error creating new folder rpf directory common already exists

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии