Need help - RLP with Hydra


i am new in RLP, and have few question / problems:

  1. I want to exit for C code. i am using “return” in the called function but it doesnt work all the times. i tried this:
    // C code (RLP)
    static int counter = 0;
    while (counter < 50)
    //do some work.
    i saw this code not always returns to C# code.
    any idea?

  2. i want to debug my C code. what is the best way to do this? LCD screen? do you know better way?

Welcome to the forum!

  1. Probably you have programmed an endless loop. Or the loop takes too long and the debugger looses connection.

  2. You could use a serial port to output messages to a terminal.

Thanks on your answer!

  1. what is too long? C code can run 10 minutes and even more… and what about case that i dont use debugger- in that case it will retrun always?

  2. what can i do with serial port? send statuses to file?

  1. 10 minutes is too long. You should limit the time you’re in RLP to maximum a few seconds. Otherwise you are blocking the whole NETMF framework and you will loose connection with the debugger or won’t be able to ever connect again with the board (unless you upload the complete firmware again). What are you processing that takes 10 minutes if I might ask?

  2. You can connect the Hydra to your PC and use a software terminal emulator like Hyperterminal, putty, teraterm, to monitor messages. Then implement some code in RLP so you can have it sending out messages over the serial port. See this Codeshare example:

Thanks a lot!!

about 1:
can i do the following (without using debugger)? does it work?:

C# code:

while (true)
int res = Invoke() //invoke the RLP function…

C code:

//do something during 10 minutes and return value