Has anyone used the UART serial port on this dongle on a Mac? Is the output supposed to show up in GDB or in the JLinkExe? Do I need a driver?
The instructions for the dongle have me disable some of the USB CDC drivers (without this, I cannot connect to the chip).
How do I see serial console output?
I'm using the following code:
Display All
The instructions for the dongle have me disable some of the USB CDC drivers (without this, I cannot connect to the chip).
How do I see serial console output?
I'm using the following code:
Source Code
- // P0.21-3 are red, green, blue LEDs on development dongle
- GPIO_DIRSET = 7 << 21; // set pins to output
- GPIO_OUTSET = 7 << 21; // set pins high -- LED off
- GPIO_OUTCLR = 1 << 21; // set red led on.
- UART_ENABLE = 1;
- // GPIO UART
- // P0.08 RTS
- // P0.09 TXD
- // P0.10 CTS
- // P0.11 RXD
- UART_PSELRTS = 1 << 8;
- UART_PSELTXD = 1 << 9;
- UART_PSELCTS = 1 << 10;
- UART_PSELRXD = 1 << 11;
- UART_CONFIG = UART_CONFIG_HWFC_ENABLED;
- UART_STARTTX = 1;
- char* hello = "Hello, world.\n";
- uint8_t len = strlen(hello);
- for(int i = 0; i < len; ++i) {
- UART_TXD = hello[i];
- while(!UART_TXDRDY) /* wait */; // HANGS here
- UART_TXDRDY = 0;
- }
- GPIO_OUTSET = 1 << 21; // set pin low - red LED off.
- GPIO_OUTCLR = 1 << 22; // set pin low - green LED on.
- while(1);