cancel
Showing results for 
Search instead for 
Did you mean: 

Can assembly code running on stm8s-dicovery board?

MQi.1
Senior II

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?

4 REPLIES 4

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MQi.1
Senior II

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?

YAY.1
Senior

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.

MQi.1
Senior II

Thanks, I will try it later.