I have been partially successful at getting serial COM from own PCB through the FRDM K22F board. Here is what I did: I programmed the Target MCU on the FRDM board with a blank program (with the hope it doesn't interfere with Serial COM), I programmed my PCB using the SWD J11 pin. The programming is successful. Here is the code:
#include "mbed.h"
Serial pc(USBTX, USBRX);
DigitalOut led(PTC4);
int main() {
pc.baud(9600);
while(1)
{
led = 1;
pc.printf("Something");
}
}
I also hooked up the PTE0 and PTE1 (UART_TX and UART_RX) from my PCB to the PTE0/1 headers on the FRDM board with the hope that I would get serial COM from my PCB. The problem is that I partially, almost randomly, get data coming from the board to my terminal.
Has anyone tried this or have any ideas how to make this work?
I am planning on building my own PCB and programming it with the K22F's OpenSDA chip by connecting the SWD pins. I wonder whether I can also debug my PCB using serial.
Looking at the FRDM K22F schematics it seems the OpenSDA chip is also connected to the K22F MCU via UART. Is the serial com taking place through UART? If so, could I hook up my PCBs UART pins to respective (PTE0 and PTE1) pins on the FRDM board and make it seem like my PCB is the target MCU?
For reference, this is the programming method I plan to use: http://developer.mbed.org/cookbook/Prototype-To-Hardware-KL25Z