Is anybody using ip-ip tunnels on MQX? I am trying with MQX version 3.8.1 (with a Kinetis K60) but not having much success as there is very little documentation/sample code?
Thanks for all the info, not quite what I had in mind. But I have managed to come up with a solution. I think that I need to switch to MQX 4.0 quite soon.
Are you asking about the MQX IPC (Inter Processor Communication)?
If yes the MQXUG.pdf in the MQX4.0/docs/mqx folder section 3.8 discusses IPC.
Section 22.214.171.124.4 references the example we have in MQX4.0/examples/ipc folder.
I've just tested this demo using two Tower kits with a NULL modem (Null modem cables have the Tx (transmit) and Rx (Recieve) lines crossed over, thereby allowing data to be sent from one device to the other: reference).
Note that the IPC is using a UARTin the interrupt mode as the IPC communication link so in your user_config.h header you need something like the following:
#define BSPCFG_ENABLE_TTYF 0 // <---polled mode disabled
#define BSPCFG_ENABLE_ITTYF 1 // <--Interrupt mode enabled
Other #defines you need
#define MQX_IS_MULTI_PROCESSOR 1
#define MQX_USE_IPC 1
Since there is only one UART interface for each tower kit, you can either use the OSBDM debugger interface as a COM port or define the default for "iodebug:". My example uses iodebug: for the TWR-K60F120M kit and the OSJTAG-COM via the OSBDM interface for the TWR-K60D100M kit.
I've attached ZIP with the modified file for CPU1 and CPU2 and the respective user_config.h and twrk60xxxx.h headers. Again using MQX4.0.
You must run the CPU2 project first, then boot/run the CPU1 project.
CPU2 project is then waiting for a message from CPU2 and once it receives it, will increment a variable and return it to thr sender/CPU1. CPU2 is basically modifying the message and returning the message to CPU1.
CPU1 will send a message to CPU2. Above explains what CPU2 does.
I added LED blinking to the CPU2 example so there is a visual indication the system is working.
For CPU1 I used the OSBDM COM port to watch the terminal output.
Once the CPU1 has received 1000 messages, it terminate. You can just press reset button on CPU1 and the communication starts again.
Retrieving data ...