Skip to content
Permalink
Browse files

MSP430 Debug Serial Lib Ok

  • Loading branch information
mbriday committed Nov 22, 2019
1 parent 02e063b commit 7d62f98b45f8c77380777500a84a42cd6f5849e9
Binary file not shown.
@@ -1108,21 +1108,23 @@ \section{Memory mapping and memory protection}

\section{Libraries}
\subsection{Serial line}
The launchpad kits use a serial line over USB that can be used for debugging purpose. The configuration is 115200 bauds, 8N1.
The launchpad kits use a serial line over USB that can be used for debugging purpose. The configuration is \emph{9600 bauds, 8N1}. The clock is the DCO, which is not precise enough to get a correct 115200 bauds communication.

The library should be declared in the .oil file (so that dedicated files are included in the build process)
The library should be declared in the .oil file (so that dedicated files are included in the build process), with 2 parameters:
\begin{lstlisting}
BUILD = TRUE {
LIBRARY = serial;
BUILD = TRUE {
LIBRARY = serial {
TXBUFFER = 16;
RXBUFFER = 16;
};
};
\end{lstlisting}

The library is quite limited at this date, and it can only send characters (no reception). There is no ring buffer, and there is a waiting loop if the previous character is not yet sent.

An example is given for the msp430fr5969 launchpad.
The buffers are ring buffers that are updated in the corresponding RX or TX interrupts. If the buffer size is set to 0, the corresponding interrupt is not enabled.

The library supports various MCU change frequencies, and the output frequency is updated (the current message may be corrupted!).

An example is given for the msp430fr5969 launchpad.
\bibliographystyle{plain}
\bibliography{porting}

@@ -1,12 +1,21 @@
# Serial over USB support
# Debug UART serial line over USB

The lib offers a lightweight serial communication for the launchpad boards with serial over USB

The basic implementation opens the serial port (9600, 8N1) to push debug messages

At this date, it supports:
* update the baud rate parameters when there are DCO frequency updates.
* transmit using an interrupt and a ring buffer.
* reception using an interrupt and a ring buffer.
Note that if any buffer size (defined in the OIL) file is set to 0, the corresponding interrupt is not enabled

In the OIL file, 2 parameters should be given to the lib:

```
LIBRARY = serial {
TXBUFFER = 16;
RXBUFFER = 16;
};
```

At this date, it does **not** support:
* transmit using an interrupt (and a ring buffer)
* receive msgs
@@ -5,6 +5,9 @@
/* function that should be called each time
* the DCO frequency is changed to recalculate the
* correct baud rate parameters.
*
* During init, this function is registered has a
* callback that should be called for each clock update.
**/
void tpl_serial_update_freq();

0 comments on commit 7d62f98

Please sign in to comment.
You can’t perform that action at this time.