The STM8 is an 8-bit microcontroller by STMicroelectronics.
Questions tagged [stm8]
76 questions
1
vote
0 answers
stm8s cco flag never set
I have a discovery stm8s003k board and when I tested a program for cco capability it seems cco will never be stable and program always remain in line: while(CLK_GetFlagStatus(CLK_FLAG_CCORDY) == FALSE);
code and more explain is in detail.
I tested…

amirsaeedkhan166
- 11
- 1
1
vote
1 answer
How to correctly read data returned by MFRC522 via SPI using STM8S103F3?
I had tested reading Mifare RFID 1K cards with an RFID-RC522 module via UART using a Pyhton script on my PC. Now I am using STM8S103F3 to interface with the same RFID-RC522 (MFRC522) via SPI, but I have the problem of not getting the correct…

koko
- 11
- 3
1
vote
0 answers
C typedef enum "impossible" value in debug mode
On a STM8S, using the config files, on one hand I have (stm8s.h file)
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus, BitStatus, BitAction;
and, in one of my functions (fonctions.c file), I have
BitStatus minutes = RESET;
Yet, when I…

EPikk
- 11
- 1
1
vote
2 answers
Has anyone figured out how to program the STWBC-MC module by STM?
The documents say that we can flash custom firmware on this module but it doesn't say how. I am unable to locate any build tool chain either. I tried raising a customer support ticket with STM and they don't seem to have any answers. Has anyone used…

Gautham Ranganathan
- 11
- 1
1
vote
0 answers
STM 8 register addresses
My question has to do with how STM8 microcontrollers address things. Maybe Im missing something, I wrote a small program where the problem exists. The weird thing is that its different on my computer vs the stm8 MCU.
#include
#define…

cameroony
- 67
- 1
- 10
1
vote
0 answers
What are these sections in a Linker's map file?
My COSMIC-C linker generates a map file for my STM8S microcontroller project, which despite having a few familiar sections, is a little inexpressive.
here is the map file output and a few modules :
--------
…

Tirdad Sadri Nejad
- 149
- 10
1
vote
2 answers
Weird behavior of printf on a stm8l with COSMIC compiler
printf gives me weird extra values in some cases. What might be happening?
I'm manipulating values in an uint8_t array and printing it out to my terminal to verify if everything is correct. But for some reason I am getting weird values when I print…

caiomarcos
- 13
- 3
1
vote
1 answer
What does '.dcall' mean in assembly code?
I'm trying to understand a program in assembly code which should be compiled with COSMIC compiler to run on STM8 controller.
At the beginning of the program, there are a couple of xref and xdef and then comes a .dcall statement or command. Here it…

Salahuddin
- 1,617
- 3
- 23
- 37
1
vote
2 answers
Understanding functions in stm8s disassembly?
I'm programming an STM8S microcontroller using STVD IDE. It uses the COSMIC compiler.
I found that there is a veriable that is increased unexpectedly. When debugging I found that there is a line in the assembly code that causes this variable to…

Salahuddin
- 1,617
- 3
- 23
- 37
1
vote
1 answer
Interrupt STM8s issue with SDCC compiler
I want to use interrupts on the SMT8S003K3 (STM8SVL-DISCOVERY) and somehow it does not get recognized when I use the interrupt on a other file where my main() is located.
I made two tests:
- first I modified this code to Standard Peripheral…

K0ertis
- 121
- 1
- 9
1
vote
1 answer
cpputest on STM8 failed due multiple 'main'
I want to use cpputest on STM8 and installed all the required tools for it.
I am able to run cpputest on my simplified code.
on my main file which belongs to the hardware I have of course the main function. But in the Test environment I have a main…

K0ertis
- 121
- 1
- 9
1
vote
2 answers
1
vote
1 answer
Problems in debugging IAR Embedded Workshop
I have received some code which I have to maintain. To do this I will be using IAR embedded workbench.
Since it is my first time I am watching some tutorials like
Getting Started with IAR Embedded Workbench
Now if you look at minute 4.32, you can…

KansaiRobot
- 7,564
- 11
- 71
- 150
1
vote
1 answer
Assembly instruction in STVD IDE for STM8 microcontroller
I'm programming STM8 micro controller in STVD. I happen to use an assembly instruction in the middle of code. As shown here
I used a instruction as below
asm("MOV $00500A,#$3");
But I'm facing with following error
#error cpstm8…

Learner
- 13
- 4
1
vote
1 answer
Is it needed to typecast float to double when using math.h?
I use the Cosmic C Compiler for STM8 micro controllers and use float variables. For the currently used platform the compiler does not provide double types. Anyway, when one uses doubles they are treated as floats.
I wonder whether it is needed to…

DukeNukem49
- 11
- 2