The STM8 is an 8-bit microcontroller by STMicroelectronics.
Questions tagged [stm8]
76 questions
0
votes
2 answers
How to disable all optimization when using COSMIC compiler?
I am using the COSMIC compiler in the STVD ide and even though optimization is turned of with -no (documentation says "-no: do not use optimizer") some lines of code get removed and cannot have a breakpoint placed upon them, nor are they to be found…

EN20
- 51
- 11
0
votes
1 answer
STM8 TIM1 (or TIM2) - one 5s tick after external interrupt event
I'm trying to implement this logic in STM8S103F3:
1) Controller wait for external interurpts on GPIOC (high by default) after initialization.
2.1) external interrupt triggered: if PIN5 of GPIOC is low, turn test led on, and start timer for 5s.
2.2)…

Anton
- 575
- 2
- 7
- 27
0
votes
0 answers
i2c stm8 issue with event
I'm working on the i2c driver for STM8S105C6T6. I cannot receive the I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED. Please, advice where I'm wrong.
void I2C_ACC_ByteRead(u8 I2C_Slave_Address, u8 ReadAddr, u8 *pBuffer)
{
/* while the bus is busy…

Алексей Тимофеев
- 35
- 4
0
votes
1 answer
Not able to Debug STM8s001J3 with STVD and STVP using STLinkv2 Debugger
As the STM8S001J3 MCU has no Reset pin, How do I connect the MCU with ST Link v2 using SWIM pin for debugging?
STLink V2 : STM8s001j3
VDD : VDD
GND : GND
SWIM : SWIM
RESET : ?
I have left the STLink V2's…

Santhosh Shetty Chowdary
- 97
- 1
- 5
- 15
0
votes
0 answers
STM8 UART Transmiission gets truncated
I am using the stm8l151... mcu and I am trying to send different strings via Uart1 to HTerminal. I have three different strings to send. The first two strings are transmitted completely but when the third one is being sent, it is truncated and it…

Oseihie Eigbobo
- 1
- 2
0
votes
1 answer
Disable read-out protection stm8s003
I am starting to use stm8s003. I use the stm8s003 board like this:
"https://www.cnx-software.com/wp-content/uploads/2015/01/One_dollar_development_board.jpg".
When I use IAR and download the program to my stm8 this error occurs :
"The Flash…

tuanti1997qn
- 57
- 1
- 10
0
votes
2 answers
stm8 Read Out Protection (ROP) setting option byte in code
FLASH_Unlock(FLASH_MEMTYPE_DATA);
if(FLASH_ReadOptionByte(0x4800)!=0xaa)
{
FLASH_ProgramOptionByte(0x4800, 0xaa);
}
FLASH_Lock(FLASH_MEMTYPE_DATA);
Using stm8s003f3.
Adding these code main initialization, code protect…

mryldz
- 95
- 2
- 9
0
votes
1 answer
Receiving data on UART with STM8L
i wanna to know that, is there any thing to do for sending data on UART to STM8L?
i wrote a code that was similar to others and i think my hardware is okay.
i send some data to STM8L with PC by terminal software.
here i think i should first send…

Mendozo
- 9
- 3
0
votes
1 answer
IAR build library with different #define
I am going to build a simple library (.a file) in IAR Workbench for STM8. In this library, I want to implement both hardware SPI and software SPI for users to choose.
In my library.c, I wrote:
#include "library.h"
void LibraryInit()
{
#ifdef…

SoWaiSam
- 1
0
votes
1 answer
STM8SF103 Assembly - Load immediate value to ram register
I am trying to write a program in assembly language for the stm8sf103 microcontroller.
I would like to store an immediate hexadecimal value in a ram register (such as $0), but this isn't working and i am wondering why:
stm8/
segment 'rom'
loop
…

binaryBigInt
- 1,526
- 2
- 18
- 44
0
votes
2 answers
STM8 timer not ticking at the right time
I am working with a STM8 timer (not my code, but maintaining it) and in it it uses a timer. Apparently the clock is set at 16MHz erfo 0.0625uS. The settings of the timer are ARRH=0x03 ARRL=0x20 therefore (0x0320=800) it resets at 800 (ergo 50us)…

KansaiRobot
- 7,564
- 11
- 71
- 150
0
votes
3 answers
STM8 interrupt serial receive
I am new to STM8, and trying to use a STM8S103F3, using IAR Embedded Workbench.
Using C, I like to use the registers directly.
I need serial on 14400 baud, 8N2, and getting the UART transmit is easy, as there are numerous good tutorials and examples…

user3824211
- 21
- 1
- 6
0
votes
1 answer
Use old GDB 4.17 with actual Eclipse CDT (9.0) or at least with Eclipse Juno
This is the situation:
I would like to debug ST's STM8 Microcontroller with Eclipse.
For compiling, im using IAR Kickstart together with their own Eclipse Plugin. This works quite fine.
Unfortunately, they dont offer any way to integrate their…

C. Hediger
- 434
- 7
- 22
-1
votes
1 answer
COSMIC C - How to add assembler file to C code
I am getting this error when using atomthreads in cosmic c for stm8L151c6 micro controller.
clnk - symbol _archFirstThreadRestore not defined (Debug\atomkernel.o)
Ifound out that _archFirstThreadRestore is defined inside a assembler file named…

NINJA
- 89
- 2
- 10
-1
votes
1 answer
TIM2 module not ticking at 1us in STM8S103F3 controller
I created a program on STM8S103F3 to generate a delay in rage of micro seconds using TIM2 module, but the timer is not ticking as expected and when I tried to call 5 sec delay using it, it is giving around 3 sec delay. I'm using 16MHz HSI oscillator…

rahul_T_T
- 133
- 9