<p>Kévin Redon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10669">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">UART: switch baud rate to 921600 bps<br><br>the higher baud rate allows for more debugging (without dropping<br>data) and is well supported by USB for UART adapters (this<br>standard baud rate is 8 x 115200).<br>the closest matching integer value is calculated for UART CR.<br>no floating point calculation can be used since this would<br>increase the size of the resulting binary by ~ 2kB (for the<br>softfp). this is not possible for the DFU since it already is<br>close to the maximum size of 16 kB.<br><br>Change-Id: I82b74f697342d580ccb79ada4715f35f4e8cca86<br>---<br>M firmware/libboard/common/include/board_common.h<br>M firmware/libboard/common/source/uart_console.c<br>2 files changed, 8 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/69/10669/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h</span><br><span>index db030ad..1155158 100644</span><br><span>--- a/firmware/libboard/common/include/board_common.h</span><br><span>+++ b/firmware/libboard/common/include/board_common.h</span><br><span>@@ -77,8 +77,8 @@</span><br><span> #define PINS_UART  { PIO_PA9A_URXD0|PIO_PA10A_UTXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}</span><br><span> </span><br><span> /** UART0 */</span><br><span style="color: hsl(0, 100%, 40%);">-/** Console baudrate always using 115200. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define CONSOLE_BAUDRATE    115200</span><br><span style="color: hsl(120, 100%, 40%);">+/** Console baud rate in bps */</span><br><span style="color: hsl(120, 100%, 40%);">+#define CONSOLE_BAUDRATE    921600</span><br><span> /** UART peripheral used by the console (UART0). */</span><br><span> #define CONSOLE_UART       UART0</span><br><span> /** UART peripheral ID used by the console (UART0). */</span><br><span>diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c</span><br><span>index 3a00e49..bcfb0b7 100644</span><br><span>--- a/firmware/libboard/common/source/uart_console.c</span><br><span>+++ b/firmware/libboard/common/source/uart_console.c</span><br><span>@@ -85,7 +85,12 @@</span><br><span> </span><br><span>        /* Configure baudrate */</span><br><span>     /* Asynchronous, no oversampling */</span><br><span style="color: hsl(0, 100%, 40%);">-     pUart->UART_BRGR = (masterClock / baudrate) / 16;</span><br><span style="color: hsl(120, 100%, 40%);">+  //pUart->UART_BRGR = (masterClock / baudrate) / 16;</span><br><span style="color: hsl(120, 100%, 40%);">+        if ((masterClock / baudrate) % 16 >= 7) {</span><br><span style="color: hsl(120, 100%, 40%);">+          pUart->UART_BRGR = ( masterClock / baudrate) / 16 + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+     } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              pUart->UART_BRGR = ( masterClock / baudrate) / 16 + 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span> </span><br><span>        /* Disable PDC channel */</span><br><span>    pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10669">change 10669</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10669"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I82b74f697342d580ccb79ada4715f35f4e8cca86 </div>
<div style="display:none"> Gerrit-Change-Number: 10669 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>