This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Questions on calling external function

Excuse me, I have a question on calling external function. 

board using: nrf52832

softdevice using : s132(6.1.1)

The situation: There are two applications  which is named as app1.c and app2.c . In app1.c, there is the main application which will handle all the work . In app2.c will only contain a function which will return a value. For example, app2.c contain the function int foo(char a1, char b2). In my project, may I program these two application separately in two memory address in which app1.c can call the function in app2.c externally. 

for example in app1.c:

int main(){

int a = foo('a','b');//call the function in app2.c and use the value returned later

}

Reason to do this: These two application is written by two different person so that one can call the external function when it is needed. 

Searching the internet, I find that superior call interface will be helpful but I cannot understand how it works after reading the document: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.1.0%2Flib_svc.html&anchor=lib_svc_reserved_svc_number

May you give me an example on how to use the superior call interface to call an external function which is located at a specific address.The document is quite difficult to follow as it has several section and has not provided a deep explanation 

Question list:

a) do I need to program the bootloader into the board before using the svc.

b) can the svc works when the external function store at another memory address. e.g. app1 stores at 0x46000 having a size of 0x20000, external function saving at 0x66000

c) may you give me an example on how to use the superior call interface to call an external function which is located at a specific address

d) if svc does not work may you suggest me a better alternatives on programming two application on the same block of memory  and enabling jumping between

All in all, thank you for your attention and I will appreciate and be grateful for any help from others.

Parents Reply Children
Related