2020-03-28 06:07 AM
I have tested my stm8s-discovery board for 2 days. The MCU is stm8s105c6t6, the Hex format file produced in c language on the IAR EW platform, could run as expected when uploaded into the board, but the final file from assembly language, both in Hex and .s19 format, generated from STVD, cann't run at all when uploading.
I have tested download code from STVD and STVP, in format of intel hex, intel hex extended, and motorola s19, neither of it could run.
So, my question is, whether file produced in assembly code could run on stm8s105c6t6? Is there any other configuration option, or due to ST-LINK(v2) or stms8-dicovery board itself?
2020-03-28 08:31 AM
The problem would seem to be with WHAT you're loading, not how it is packaged/formatted. The output of the C compiler is machine code.
Perhaps review more critically what you're generating out of the assembler/linker, look at the listing files, map files, and expectations the micro-controller has for starting and executing code. Perhaps disassemble the working code to better understand its structure.
2020-03-29 06:45 PM
My code is here:
stm8/
#include "mapping.inc"
segment 'rom'
SET
bset $5002, #3
bset $5002, #4
bset $5002, #5
bset $5002, #6
LOOP
bset $5000, #3
bset $5000, #4
bset $5000, #5
bset $5000, #6
;bcpl $5000, #5
;bcpl $5000, #6
;jra LOOP
;jra DELAY_1
;bcpl $5000, #3
;bcpl $5000, #4
;bcpl $5000, #5
;bcpl $5000, #6
;jra DELAY_1
jra LOOP
END
Is it lack of anything?
2020-08-22 06:58 AM
Which program do you use to programming ?
Unfortunately,
I dont know stm8 programing with assembly language.
But,
If you dont use ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32, Could you try with this again ?
And
you should update firmware....
and
it is seeing that somethings is mising.
You may not have specified ram location,stack or something
(stm32 example)
PUBLIC __vector_table
SECTION .text:CODE:REORDER(10)
REQUIRE __vector_table
SECTION CSTACK:DATA:NOROOT(10)
SECTION .intvec:CODE:NOROOT(10)
DATA
__vector_table
DCD sfe(CSTACK)
DCD SETUP
SECTION .text:CODE:REORDER:NOROOT(10)
THUMB
I hope this will help you.
2020-08-24 03:19 AM
Thanks, I will try it later.