2019-10-08 10:26 PM
Hello everyone,
Is it possible to create Run-in-RAM code using SDCC? If possible then how to do this?
Thanks in advance.
2019-10-17 10:52 PM
SDCC deson't have direct support for this yet. However, there are some ways this can be done using code and ram section options, then copying the function to RAM manually (e.g. using memcpy()).
Here's an example of one way to do this (it uses a custom copy function instead of memcpy()):
https://lujji.github.io/blog/executing-code-from-ram-on-stm8/
2019-10-18 08:12 AM
Very thanks. Copying a segment is not a problem. The problem is to create it correctly. I did not find in the SDCC documentation the possibility of creating relocatable code. Is it possible? This would greatly simplify the design processes. In the given in the attachment example the call pointers are absolute. STM8L15x have very attractive characteristics of ULP run. I would like to do something using free tools.
2019-10-22 10:41 PM
I understand. There is no way to do this using SDCC without external tools. In any case, is possible resort to editing the code in assembler and linking the program code manually, through explicit indication of sections locations. Thanks.
2019-10-25 04:43 AM
In my opinion, the best solution to this problem was proposed by Philipp Krause in Sourceforge. https://sourceforge.net/p/sdcc/discussion/1864/thread/01c26712ef/#2044/d050/c5a5 I think the question is settled. Thanks again.