Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thank you very much #4

Open
MarrekNozka opened this issue Feb 5, 2021 · 6 comments
Open

Thank you very much #4

MarrekNozka opened this issue Feb 5, 2021 · 6 comments

Comments

@MarrekNozka
Copy link

MarrekNozka commented Feb 5, 2021

It works!

I want my thanks to you. Unuse code is removed at linking time. Great. Very good work.
My coce with SPL is here: https://github.com/MarrekNozka/stm8-dce-example

Thanks!

@XaviDCR92
Copy link
Owner

Thanks a lot for your interest, @MarrekNozka ! Please do not hesitate to make suggestions or improvements.

@MarrekNozka
Copy link
Author

MarrekNozka commented Feb 24, 2021

I try build https://github.com/MarrekNozka/stm8-dce-example and I have not success.
I added function UART_Init() form SPL and I got error messages:

$ make
stm8-ld obj/stm8s_rst.o obj/stm8s_i2c.o obj/stm8s_itc.o obj/stm8s_spi.o obj/stm8s_tim2.o obj/stm8s_awu.o obj/stm8s_it.o
obj/stm8s_uart3.o obj/stm8s_adc2.o obj/stm8s_clk.o obj/stm8s_iwdg.o obj/main.o obj/stm8s_gpio.o obj/stm8s_exti.o
obj/stm8s_tim3.o obj/stm8s_uart1.o obj/stm8s_wwdg.o obj/stm8s_tim1.o obj/stm8s_beep.o obj/stm8s_tim4.o obj/stm8s_can.o 
-o obj/STM8.elf -T./elf32stm8s003f3.x --print-memory-usage --gc-sections -Map obj/map_STM8.map 

obj/stm8s_clk.o: In function `CLK_GetClockFreq':
src/stm8s_clk.c:583: undefined reference to `__divulong'
obj/stm8s_uart1.o: In function `UART1_Init':
src/stm8s_uart1.c:128: undefined reference to `__divulong'
src/stm8s_uart1.c:129: undefined reference to `__mullong'
src/stm8s_uart1.c:129: undefined reference to `__divulong'
src/stm8s_uart1.c:131: undefined reference to `__mullong'
src/stm8s_uart1.c:131: undefined reference to `__divulong'

I don't know what's happening and where find resolv. I will be vary happy for you assistance. Thanks.

@XaviDCR92
Copy link
Owner

Please take a look at #2 (comment) for a workaround to this issue.

@MarrekNozka
Copy link
Author

MarrekNozka commented Mar 16, 2021

O.K. I understand. It works. Thanks.

@MarrekNozka
Copy link
Author

MarrekNozka commented Mar 16, 2021

I have a new problem :) I added stm8s_flash.c file from SPL to project. I got this error:

sdcc src/stm8s_flash.c -DSTM8S208 -mstm8 --out-fmt-elf -c --debug --opt-code-size --asm=gas --function-sections --data-sections -Iinc/ -MM > obj/stm8s_flash.d
sdcc src/stm8s_flash.c -DSTM8S208 -mstm8 --out-fmt-elf -c --debug --opt-code-size --asm=gas --function-sections --data-sections -Iinc/ -o obj/stm8s_flash.o
obj/stm8s_flash.asm: Assembler messages:
obj/stm8s_flash.asm:79: Error: Invalid instruction: ldf [_asm_addr+1].e,a
obj/stm8s_flash.asm:102: Error: Invalid instruction: ldf a,[_asm_addr+1].e
make: *** [Makefile:63: obj/stm8s_flash.o] Chyba 1
rm obj/stm8s_flash.d

7d9f7f2

@MarrekNozka
Copy link
Author

Reason is inline assembler in stm8s_flash.c. if I understand correctly, I must this stm8-as convert to gas.

__asm
  ld	a,_asm_val
  ldf	[_asm_addr+1].e,a
__endasm;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants