8 years ago.

Serial RPC won't compile with RTOS

Hi

I have managed to get to two different projects to work, one using mbed-rtos library and one using the RPC_Serial library, When i try to combine these together on one program it won't compile.

The only code written is

#include "mbed.h"
#include "rtos.h"
#include "rpc.h"
 
DigitalOut led1(LED1);
DigitalOut led2(LED2);
SerialRPCInterface SerialInterface(USBTX, USBRX);
 
void led2_thread(void const *args) {
    while (true) {
        led2 = !led2;
        Thread::wait(1000);
    }
}
 
int main() {
    Thread thread(led2_thread);
    
    while (true) {
        led1 = !led1;
        Thread::wait(500);
    }
}

has anybody had these RTOS and serial RPCworking together? Thanks

First i imported the RTOS example as shown below /media/uploads/chromosteve/import_rtos.png

Then i imported the RPClibrary into the RTOS example program as shown below /media/uploads/chromosteve/import_rpc.png

i added the #include "rpc.h" to the main program but it still gives an error /media/uploads/chromosteve/import_rpc.png

/media/uploads/chromosteve/compile_error.png

I tried using the button "Fix It" which gave me the option to add more libraries, i tried adding the library mbed-rpc but this gave even more errors (see below)

/media/uploads/chromosteve/compile_more_errors.png

Any help would be greatly appreciated.

Steve

Can you share the output why it fails to compile?

posted by Martin Kojtal 07 Aug 2014

Here is the output from the compiler

Error: Not a class or struct name in "RPCInterface/RPCFunction.h", Line: 46, Col: 28 Error: Identifier "parse_char" is undefined in "RPCInterface/RPCFunction.cpp", Line: 50, Col: 33 Error: Identifier "isalnum" is undefined in "RPCInterface/RPCFunction.cpp", Line: 56, Col: 19 Error: Identifier "isgraph" is undefined in "RPCInterface/RPCFunction.cpp", Line: 56, Col: 36 Error: Incomplete type is not allowed in "RPCInterface/RPCFunction.cpp", Line: 75, Col: 10 Error: Identifier "Base" is undefined in "RPCInterface/RPCFunction.cpp", Line: 75, Col: 32 Error: Identifier "this_ptr" is undefined in "RPCInterface/RPCFunction.cpp", Line: 75, Col: 38 Error: Expected a ")" in "RPCInterface/RPCFunction.cpp", Line: 75, Col: 46 Error: Expected a ";" in "RPCInterface/RPCFunction.cpp", Line: 75, Col: 85 Warning: At end of source: #12-D: parsing restarts here after previous syntax error in "RPCInterface/RPCFunction.cpp", Line: 115, Col: 2

posted by Steven Mattu 07 Aug 2014

I am still facing the same problem. I do not get why "base" is not identified as a class!

posted by Mustafa Kamoona 07 Apr 2015

2 Answers

7 years, 4 months ago.

Sorry I meant to comment

posted by Mustafa Kamoona 06 Apr 2015
7 years, 4 months ago.

RPC library has been separated from the mbed base library.
and, the class name has been changed. (Base => RPC)

need other changes to support the RTOS. it is difficult to explain everything.
I will publish the example. please read the change history.

Import programSerialRPC_rtos_example

Serial RPC(Remote Procedure Call) with RTOS Support.