summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-10-24 13:17:01 +0700
committerGitHub <[email protected]>2019-10-24 13:17:01 +0700
commit5d975d93139e0ce346372dc07ca34ef9df7b0287 (patch)
tree8661248bd0392312a212dd02e07b06f6fa248da8 /hw
parente413c9efa303d70de019a91aa415384fe80ca78f (diff)
parent6f952a8e84acfbc962cf3d37ed72bddefebaf58b (diff)
Merge pull request #203 from hathach/develop
add log support using uart with CFG_TUSB_DEBUG >= 2, close #200
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/board.c58
-rw-r--r--hw/bsp/board.h6
-rw-r--r--hw/bsp/circuitplayground_bluefruit/circuitplayground_bluefruit.c6
-rw-r--r--hw/bsp/circuitplayground_express/circuitplayground_express.c12
-rw-r--r--hw/bsp/ea4088qs/ea4088qs.c6
-rw-r--r--hw/bsp/ea4357/ea4357.c8
-rw-r--r--hw/bsp/feather_m0_express/feather_m0_express.c12
-rw-r--r--hw/bsp/feather_m4_express/feather_m4_express.c12
-rw-r--r--hw/bsp/feather_nrf52840_express/feather_nrf52840_express.c6
-rw-r--r--hw/bsp/feather_stm32f405/feather_stm32f405.c12
-rw-r--r--hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c6
-rw-r--r--hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c6
-rw-r--r--hw/bsp/lpcxpresso1347/lpcxpresso1347.c6
-rw-r--r--hw/bsp/lpcxpresso1549/lpcxpresso1549.c6
-rw-r--r--hw/bsp/lpcxpresso1769/lpcxpresso1769.c8
-rw-r--r--hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c6
-rw-r--r--hw/bsp/lpcxpresso54114/lpcxpresso54114.c6
-rw-r--r--hw/bsp/lpcxpresso55s69/lpcxpresso55s69.c6
-rw-r--r--hw/bsp/mbed1768/mbed1768.c8
-rw-r--r--hw/bsp/mcb1800/mcb1800.c13
-rw-r--r--hw/bsp/metro_m0_express/metro_m0_express.c12
-rw-r--r--hw/bsp/metro_m4_express/metro_m4_express.c12
-rw-r--r--hw/bsp/ngx4330/ngx4330.c8
-rw-r--r--hw/bsp/pca10056/board.mk1
-rw-r--r--hw/bsp/pca10056/pca10056.c36
-rw-r--r--hw/bsp/pca10059/pca10059.c6
-rw-r--r--hw/bsp/printf_retarget.c183
-rw-r--r--hw/bsp/pyboardv11/pyboardv11.c12
-rw-r--r--hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c12
-rw-r--r--hw/bsp/stm32f072disco/stm32f072disco.c12
-rw-r--r--hw/bsp/stm32f103bluepill/stm32f103bluepill.c12
-rw-r--r--hw/bsp/stm32f207nucleo/stm32f207nucleo.c12
-rw-r--r--hw/bsp/stm32f303disco/stm32f303disco.c12
-rw-r--r--hw/bsp/stm32f407disco/stm32f407disco.c12
-rw-r--r--hw/bsp/stm32f411disco/stm32f411disco.c12
-rw-r--r--hw/bsp/stm32f412disco/stm32f412disco.c12
-rw-r--r--hw/bsp/stm32f767nucleo/board.mk1
-rw-r--r--hw/bsp/stm32f767nucleo/stm32f767nucleo.c47
-rw-r--r--hw/bsp/stm32f767nucleo/stm32f7xx_hal_conf.h4
-rw-r--r--hw/bsp/stm32l0538disco/stm32l0538disco.c12
-rw-r--r--hw/bsp/stm32l476disco/stm32l476disco.c12
-rw-r--r--hw/mcu/nordic/nrfx_config.h877
-rw-r--r--hw/mcu/nordic/nrfx_log.h135
m---------hw/mcu/ti0
44 files changed, 518 insertions, 1145 deletions
diff --git a/hw/bsp/board.c b/hw/bsp/board.c
new file mode 100644
index 000000000..16e713de5
--- /dev/null
+++ b/hw/bsp/board.c
@@ -0,0 +1,58 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2018, hathach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#include "board.h"
+
+//--------------------------------------------------------------------+
+// MACRO TYPEDEF CONSTANT ENUM DECLARATION
+//--------------------------------------------------------------------+
+
+//#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
+// #define retarget_getchar board_uart_getchar
+// #define retarget_putchar board_uart_putchar
+//#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
+// volatile int32_t ITM_RxBuffer; // keil variable to read from SWO
+// #define retarget_getchar ITM_ReceiveChar
+// #define retarget_putchar ITM_SendChar
+//#else
+// #error Target is not implemented yet
+//#endif
+
+//------------- IMPLEMENTATION -------------//
+
+// newlib read()/write() retarget
+
+TU_ATTR_USED int _write (int fhdl, const void *buf, size_t count)
+{
+ (void) fhdl;
+ return board_uart_write(buf, count);
+}
+
+TU_ATTR_USED int _read (int fhdl, char *buf, size_t count)
+{
+ (void) fhdl;
+ return board_uart_read((uint8_t*) buf, count);
+}
diff --git a/hw/bsp/board.h b/hw/bsp/board.h
index 15e3a2511..4c5716d96 100644
--- a/hw/bsp/board.h
+++ b/hw/bsp/board.h
@@ -42,7 +42,7 @@
#include "tusb.h"
-#define CFG_UART_BAUDRATE 115200
+#define CFG_BOARD_UART_BAUDRATE 115200
//--------------------------------------------------------------------+
// Board Porting API
@@ -107,10 +107,10 @@ static inline void board_delay(uint32_t ms)
}
}
-static inline int8_t board_uart_getchar(void)
+static inline int board_uart_getchar(void)
{
uint8_t c;
- return board_uart_read(&c, 1) ? c : (-1);
+ return board_uart_read(&c, 1) ? (int) c : (-1);
}
static inline int board_uart_putchar(uint8_t c)
diff --git a/hw/bsp/circuitplayground_bluefruit/circuitplayground_bluefruit.c b/hw/bsp/circuitplayground_bluefruit/circuitplayground_bluefruit.c
index 59085fe97..30742ab9f 100644
--- a/hw/bsp/circuitplayground_bluefruit/circuitplayground_bluefruit.c
+++ b/hw/bsp/circuitplayground_bluefruit/circuitplayground_bluefruit.c
@@ -125,15 +125,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/circuitplayground_express/circuitplayground_express.c b/hw/bsp/circuitplayground_express/circuitplayground_express.c
index 355e15d39..6ca584eb3 100644
--- a/hw/bsp/circuitplayground_express/circuitplayground_express.c
+++ b/hw/bsp/circuitplayground_express/circuitplayground_express.c
@@ -116,6 +116,18 @@ uint32_t board_button_read(void)
return gpio_get_pin_level(BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/ea4088qs/ea4088qs.c b/hw/bsp/ea4088qs/ea4088qs.c
index 4e9f930d2..8adb61fda 100644
--- a/hw/bsp/ea4088qs/ea4088qs.c
+++ b/hw/bsp/ea4088qs/ea4088qs.c
@@ -131,16 +131,14 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
//return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
//UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/ea4357/ea4357.c b/hw/bsp/ea4357/ea4357.c
index 2164d3e09..c276f10d3 100644
--- a/hw/bsp/ea4357/ea4357.c
+++ b/hw/bsp/ea4357/ea4357.c
@@ -134,7 +134,7 @@ void board_init(void)
UART_CFG_Type UARTConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
UARTConfigStruct.Clock_Speed = 0;
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
@@ -254,16 +254,14 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
//return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
//UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/feather_m0_express/feather_m0_express.c b/hw/bsp/feather_m0_express/feather_m0_express.c
index 17576bb5a..35505add9 100644
--- a/hw/bsp/feather_m0_express/feather_m0_express.c
+++ b/hw/bsp/feather_m0_express/feather_m0_express.c
@@ -116,6 +116,18 @@ uint32_t board_button_read(void)
return gpio_get_pin_level(BUTTON_PIN) ? 0 : 1;
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/feather_m4_express/feather_m4_express.c b/hw/bsp/feather_m4_express/feather_m4_express.c
index a368b3038..fccd0d3af 100644
--- a/hw/bsp/feather_m4_express/feather_m4_express.c
+++ b/hw/bsp/feather_m4_express/feather_m4_express.c
@@ -105,6 +105,18 @@ uint32_t board_button_read(void)
return gpio_get_pin_level(BUTTON_PIN) ? 0 : 1;
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
diff --git a/hw/bsp/feather_nrf52840_express/feather_nrf52840_express.c b/hw/bsp/feather_nrf52840_express/feather_nrf52840_express.c
index ed3954c82..24cc3cf2f 100644
--- a/hw/bsp/feather_nrf52840_express/feather_nrf52840_express.c
+++ b/hw/bsp/feather_nrf52840_express/feather_nrf52840_express.c
@@ -125,15 +125,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/feather_stm32f405/feather_stm32f405.c b/hw/bsp/feather_stm32f405/feather_stm32f405.c
index 02c33a0a8..0bc40ece0 100644
--- a/hw/bsp/feather_stm32f405/feather_stm32f405.c
+++ b/hw/bsp/feather_stm32f405/feather_stm32f405.c
@@ -172,6 +172,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c b/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
index f7fc16ec2..546dd3d13 100644
--- a/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
+++ b/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
@@ -173,15 +173,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c b/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c
index 4f0194972..d062de7c3 100644
--- a/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c
+++ b/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c
@@ -100,15 +100,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso1347/lpcxpresso1347.c b/hw/bsp/lpcxpresso1347/lpcxpresso1347.c
index d389eb798..cc1a8deae 100644
--- a/hw/bsp/lpcxpresso1347/lpcxpresso1347.c
+++ b/hw/bsp/lpcxpresso1347/lpcxpresso1347.c
@@ -130,14 +130,12 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso1549/lpcxpresso1549.c b/hw/bsp/lpcxpresso1549/lpcxpresso1549.c
index e10e24020..5f806d851 100644
--- a/hw/bsp/lpcxpresso1549/lpcxpresso1549.c
+++ b/hw/bsp/lpcxpresso1549/lpcxpresso1549.c
@@ -113,14 +113,12 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso1769/lpcxpresso1769.c b/hw/bsp/lpcxpresso1769/lpcxpresso1769.c
index bc6b1da7e..e2d5f6cf2 100644
--- a/hw/bsp/lpcxpresso1769/lpcxpresso1769.c
+++ b/hw/bsp/lpcxpresso1769/lpcxpresso1769.c
@@ -116,7 +116,7 @@ void board_init(void)
UART_CFG_Type UARTConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
@@ -160,16 +160,14 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
// return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
// UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c b/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c
index df915a720..11b190b92 100644
--- a/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c
+++ b/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c
@@ -144,15 +144,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso54114/lpcxpresso54114.c b/hw/bsp/lpcxpresso54114/lpcxpresso54114.c
index 090c1a95e..d86af58c8 100644
--- a/hw/bsp/lpcxpresso54114/lpcxpresso54114.c
+++ b/hw/bsp/lpcxpresso54114/lpcxpresso54114.c
@@ -145,15 +145,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/lpcxpresso55s69/lpcxpresso55s69.c b/hw/bsp/lpcxpresso55s69/lpcxpresso55s69.c
index 41e3028f1..e595634a7 100644
--- a/hw/bsp/lpcxpresso55s69/lpcxpresso55s69.c
+++ b/hw/bsp/lpcxpresso55s69/lpcxpresso55s69.c
@@ -187,15 +187,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/mbed1768/mbed1768.c b/hw/bsp/mbed1768/mbed1768.c
index 05fb4ef35..9f1ed12ef 100644
--- a/hw/bsp/mbed1768/mbed1768.c
+++ b/hw/bsp/mbed1768/mbed1768.c
@@ -108,7 +108,7 @@ void board_init(void)
UART_CFG_Type UARTConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
@@ -152,16 +152,14 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
// return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
// UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/mcb1800/mcb1800.c b/hw/bsp/mcb1800/mcb1800.c
index 6f1ef4244..deb17f113 100644
--- a/hw/bsp/mcb1800/mcb1800.c
+++ b/hw/bsp/mcb1800/mcb1800.c
@@ -28,14 +28,13 @@
#include "../board.h"
// PD_10
-#define LED_PORT 6
-#define LED_PIN 24
+#define LED_PORT 6
+#define LED_PIN 24
// P4_0
#define BUTTON_PORT 2
#define BUTTON_PIN 0
-
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
//--------------------------------------------------------------------+
@@ -118,7 +117,7 @@ void board_init(void)
UART_CFG_Type UARTConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
UARTConfigStruct.Clock_Speed = 0;
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
@@ -191,16 +190,14 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
//return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
//UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/metro_m0_express/metro_m0_express.c b/hw/bsp/metro_m0_express/metro_m0_express.c
index 17576bb5a..35505add9 100644
--- a/hw/bsp/metro_m0_express/metro_m0_express.c
+++ b/hw/bsp/metro_m0_express/metro_m0_express.c
@@ -116,6 +116,18 @@ uint32_t board_button_read(void)
return gpio_get_pin_level(BUTTON_PIN) ? 0 : 1;
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/metro_m4_express/metro_m4_express.c b/hw/bsp/metro_m4_express/metro_m4_express.c
index 583a4dfe6..08559e57c 100644
--- a/hw/bsp/metro_m4_express/metro_m4_express.c
+++ b/hw/bsp/metro_m4_express/metro_m4_express.c
@@ -105,6 +105,18 @@ uint32_t board_button_read(void)
return gpio_get_pin_level(BUTTON_PIN) ? 0 : 1;
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
diff --git a/hw/bsp/ngx4330/ngx4330.c b/hw/bsp/ngx4330/ngx4330.c
index 0e39ea711..669180026 100644
--- a/hw/bsp/ngx4330/ngx4330.c
+++ b/hw/bsp/ngx4330/ngx4330.c
@@ -132,7 +132,7 @@ void board_init(void)
UART_CFG_Type UARTConfigStruct;
UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
UARTConfigStruct.Clock_Speed = 0;
UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
@@ -236,16 +236,14 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
//return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
//UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/pca10056/board.mk b/hw/bsp/pca10056/board.mk
index c0616abee..abe0d642c 100644
--- a/hw/bsp/pca10056/board.mk
+++ b/hw/bsp/pca10056/board.mk
@@ -24,6 +24,7 @@ LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
SRC_C += \
hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
+ hw/mcu/nordic/nrfx/drivers/src/nrfx_uarte.c \
hw/mcu/nordic/nrfx/mdk/system_nrf52840.c \
INC += \
diff --git a/hw/bsp/pca10056/pca10056.c b/hw/bsp/pca10056/pca10056.c
index 57426732c..31fd5e9be 100644
--- a/hw/bsp/pca10056/pca10056.c
+++ b/hw/bsp/pca10056/pca10056.c
@@ -29,6 +29,7 @@
#include "nrfx.h"
#include "nrfx/hal/nrf_gpio.h"
#include "nrfx/drivers/include/nrfx_power.h"
+#include "nrfx/drivers/include/nrfx_uarte.h"
#ifdef SOFTDEVICE_PRESENT
#include "nrf_sdm.h"
@@ -44,6 +45,12 @@
#define BUTTON_PIN 11
#define BUTTON_STATE_ACTIVE 0
+#define UART_RX_PIN 8
+#define UART_TX_PIN 6
+
+static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(0);
+//static void uart_handler(nrfx_uart_event_t const * p_event, void* p_context);
+
// tinyusb function that handles power event (detected, ready, removed)
// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.
extern void tusb_hal_nrf_power_event(uint32_t event);
@@ -69,6 +76,22 @@ void board_init(void)
SysTick_Config(SystemCoreClock/1000);
#endif
+ // UART
+ nrfx_uarte_config_t uart_cfg =
+ {
+ .pseltxd = UART_TX_PIN,
+ .pselrxd = UART_RX_PIN,
+ .pselcts = NRF_UARTE_PSEL_DISCONNECTED,
+ .pselrts = NRF_UARTE_PSEL_DISCONNECTED,
+ .p_context = NULL,
+ .hwfc = NRF_UARTE_HWFC_DISABLED,
+ .parity = NRF_UARTE_PARITY_EXCLUDED,
+ .baudrate = NRF_UARTE_BAUDRATE_115200, // CFG_BOARD_UART_BAUDRATE
+ .interrupt_priority = 7
+ };
+
+ nrfx_uarte_init(&_uart_id, &uart_cfg, NULL); //uart_handler);
+
#if TUSB_OPT_DEVICE_ENABLED
// Priorities 0, 1, 4 (nRF52) are reserved for SoftDevice
// 2 is highest for application
@@ -124,18 +147,21 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == nrf_gpio_pin_read(BUTTON_PIN);
}
+//static void uart_handler(nrfx_uart_event_t const * p_event, void* p_context)
+//{
+//
+//}
+
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
+// return NRFX_SUCCESS == nrfx_uart_rx(&_uart_id, buf, (size_t) len) ? len : 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
- return 0;
+ return (NRFX_SUCCESS == nrfx_uarte_tx(&_uart_id, (uint8_t const*) buf, (size_t) len)) ? len : 0;
}
#if CFG_TUSB_OS == OPT_OS_NONE
diff --git a/hw/bsp/pca10059/pca10059.c b/hw/bsp/pca10059/pca10059.c
index b18c1d231..69246f4a6 100644
--- a/hw/bsp/pca10059/pca10059.c
+++ b/hw/bsp/pca10059/pca10059.c
@@ -123,15 +123,13 @@ uint32_t board_button_read(void)
int board_uart_read(uint8_t* buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
int board_uart_write(void const * buf, int len)
{
- (void) buf;
- (void) len;
+ (void) buf; (void) len;
return 0;
}
diff --git a/hw/bsp/printf_retarget.c b/hw/bsp/printf_retarget.c
deleted file mode 100644
index 707a1e099..000000000
--- a/hw/bsp/printf_retarget.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * This file is part of the TinyUSB stack.
- */
-
-#include "board.h"
-
-#if CFG_PRINTF_TARGET != PRINTF_TARGET_SEMIHOST
-
-#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
- #define retarget_getchar() board_uart_getchar()
- #define retarget_putchar(c) board_uart_putchar(c);
-#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
- volatile int32_t ITM_RxBuffer; // keil variable to read from SWO
- #define retarget_getchar() ITM_ReceiveChar()
- #define retarget_putchar(c) ITM_SendChar(c)
-#else
- #error Target is not implemented yet
-#endif
-
-//--------------------------------------------------------------------+
-// LPCXPRESSO / RED SUITE
-//--------------------------------------------------------------------+
-#if defined __CODE_RED
-
-#if CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
- #error author does not know how to retarget SWO with lpcxpresso/red-suite
-#endif
-
-// Called by bottom level of printf routine within RedLib C library to write
-// a character. With the default semihosting stub, this would write the character
-// to the debugger console window . But this version writes
-// the character to the UART.
-int __sys_write (int iFileHandle, char *buf, int length)
-{
- (void) iFileHandle;
-
- for (int i=0; i<length; i++)
- {
- if (buf[i] == '\n') retarget_putchar('\r');
-
- retarget_putchar( buf[i] );
- }
-
- return length;
-}
-
-// Called by bottom level of scanf routine within RedLib C library to read
-// a character. With the default semihosting stub, this would read the character
-// from the debugger console window (which acts as stdin). But this version reads
-// the character from the UART.
-int __sys_readc (void)
-{
- return (int) retarget_getchar();
-}
-
-#elif defined __SES_ARM && 0
-#include <stdarg.h>
-#include <stdio.h>
-#include "__libc.h"
-
-int printf(const char *fmt,...) {
- char buffer[128];
- va_list args;
- va_start (args, fmt);
- int n = vsnprintf(buffer, sizeof(buffer), fmt, args);
-
- for(int i=0; i < n; i++)
- {
- retarget_putchar( buffer[i] );
- }
-
- va_end(args);
- return n;
-}
-
-int __putchar(int ch, __printf_tag_ptr ctx)
-{
- (void)ctx;
- retarget_putchar( (uint8_t) ch );
- return 1;
-}
-
-int __getchar()
-{
- return retarget_getchar();
-}
-
-//--------------------------------------------------------------------+
-// KEIL
-//--------------------------------------------------------------------+
-#elif defined __CC_ARM // keil
-
-struct __FILE {
- uint32_t handle;
-};
-
-void _ttywrch(int ch)
-{
- if ( ch == '\n' ) retarget_putchar('\r');
-
- retarget_putchar(ch);
-}
-
-int fgetc(FILE *f)
-{
- return retarget_getchar();
-}
-
-int fputc(int ch, FILE *f)
-{
- _ttywrch(ch);
- return ch;
-}
-
-//--------------------------------------------------------------------+
-// IAR
-//--------------------------------------------------------------------+
-#elif defined __ICCARM__ // TODO could not able to retarget to UART with IAR
-
-#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
-#include <stddef.h>
-
-size_t __write(int handle, const unsigned char *buf, size_t length)
-{
- /* Check for the command to flush all handles */
- if (handle == -1) return 0;
-
- /* Check for stdout and stderr (only necessary if FILE descriptors are enabled.) */
- if (handle != 1 && handle != 2) return -1;
-
- for (size_t i=0; i<length; i++)
- {
- if (buf[i] == '\n') retarget_putchar('\r');
-
- retarget_putchar( buf[i] );
- }
-
- return length;
-}
-
-size_t __read(int handle, unsigned char *buf, size_t bufSize)
-{
- /* Check for stdin (only necessary if FILE descriptors are enabled) */
- if (handle != 0) return -1;
-
- size_t i;
- for (i=0; i<bufSize; i++)
- {
- int8_t ch = board_uart_getchar();
- if (ch == -1) break;
- buf[i] = ch;
- }
-
- return i;
-}
-
-#endif
-
-#endif
-
-#endif // CFG_PRINTF_TARGET != PRINTF_TARGET_SEMIHOST
diff --git a/hw/bsp/pyboardv11/pyboardv11.c b/hw/bsp/pyboardv11/pyboardv11.c
index 85c0eb58f..2d4c732cc 100644
--- a/hw/bsp/pyboardv11/pyboardv11.c
+++ b/hw/bsp/pyboardv11/pyboardv11.c
@@ -174,6 +174,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c b/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c
index 6ee73bcc2..e51eda927 100644
--- a/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c
+++ b/hw/bsp/stm32f070rbnucleo/stm32f070rbnucleo.c
@@ -109,6 +109,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f072disco/stm32f072disco.c b/hw/bsp/stm32f072disco/stm32f072disco.c
index 2faa00db9..46cb09490 100644
--- a/hw/bsp/stm32f072disco/stm32f072disco.c
+++ b/hw/bsp/stm32f072disco/stm32f072disco.c
@@ -131,6 +131,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f103bluepill/stm32f103bluepill.c b/hw/bsp/stm32f103bluepill/stm32f103bluepill.c
index aade44d35..24c898c84 100644
--- a/hw/bsp/stm32f103bluepill/stm32f103bluepill.c
+++ b/hw/bsp/stm32f103bluepill/stm32f103bluepill.c
@@ -139,6 +139,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f207nucleo/stm32f207nucleo.c b/hw/bsp/stm32f207nucleo/stm32f207nucleo.c
index c313ed9f5..de0b4753b 100644
--- a/hw/bsp/stm32f207nucleo/stm32f207nucleo.c
+++ b/hw/bsp/stm32f207nucleo/stm32f207nucleo.c
@@ -152,6 +152,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f303disco/stm32f303disco.c b/hw/bsp/stm32f303disco/stm32f303disco.c
index ae369ed5b..d6d97a531 100644
--- a/hw/bsp/stm32f303disco/stm32f303disco.c
+++ b/hw/bsp/stm32f303disco/stm32f303disco.c
@@ -143,6 +143,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f407disco/stm32f407disco.c b/hw/bsp/stm32f407disco/stm32f407disco.c
index 16cec3e9a..b80c5c1b3 100644
--- a/hw/bsp/stm32f407disco/stm32f407disco.c
+++ b/hw/bsp/stm32f407disco/stm32f407disco.c
@@ -169,6 +169,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f411disco/stm32f411disco.c b/hw/bsp/stm32f411disco/stm32f411disco.c
index ce8753432..d8d79d2f0 100644
--- a/hw/bsp/stm32f411disco/stm32f411disco.c
+++ b/hw/bsp/stm32f411disco/stm32f411disco.c
@@ -168,6 +168,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f412disco/stm32f412disco.c b/hw/bsp/stm32f412disco/stm32f412disco.c
index 0a3ae7365..8d93013c1 100644
--- a/hw/bsp/stm32f412disco/stm32f412disco.c
+++ b/hw/bsp/stm32f412disco/stm32f412disco.c
@@ -195,6 +195,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32f767nucleo/board.mk b/hw/bsp/stm32f767nucleo/board.mk
index 65690cb2f..46023334c 100644
--- a/hw/bsp/stm32f767nucleo/board.mk
+++ b/hw/bsp/stm32f767nucleo/board.mk
@@ -25,6 +25,7 @@ SRC_C += \
$(ST_HAL_DRIVER)/Src/stm32f7xx_hal_rcc.c \
$(ST_HAL_DRIVER)/Src/stm32f7xx_hal_rcc_ex.c \
$(ST_HAL_DRIVER)/Src/stm32f7xx_hal_gpio.c \
+ $(ST_HAL_DRIVER)/Src/stm32f7xx_hal_uart.c \
$(ST_HAL_DRIVER)/Src/stm32f7xx_hal_pwr_ex.c
SRC_S += \
diff --git a/hw/bsp/stm32f767nucleo/stm32f767nucleo.c b/hw/bsp/stm32f767nucleo/stm32f767nucleo.c
index 07412fd8e..13966438f 100644
--- a/hw/bsp/stm32f767nucleo/stm32f767nucleo.c
+++ b/hw/bsp/stm32f767nucleo/stm32f767nucleo.c
@@ -38,6 +38,24 @@
#define BUTTON_PIN GPIO_PIN_13
#define BUTTON_STATE_ACTIVE 1
+#define UARTx USART3
+#define UART_GPIO_PORT GPIOD
+#define UART_GPIO_AF GPIO_AF7_USART3
+#define UART_TX_PIN GPIO_PIN_8
+#define UART_RX_PIN GPIO_PIN_9
+
+UART_HandleTypeDef UartHandle;
+
+// enable all LED, Button, Uart, USB clock
+static void all_rcc_clk_enable(void)
+{
+ __HAL_RCC_GPIOA_CLK_ENABLE(); // USB D+, D-
+ __HAL_RCC_GPIOB_CLK_ENABLE(); // LED
+ __HAL_RCC_GPIOC_CLK_ENABLE(); // Button
+ __HAL_RCC_GPIOD_CLK_ENABLE(); // Uart tx, rx
+ __HAL_RCC_USART3_CLK_ENABLE(); // Uart module
+}
+
/**
* @brief System Clock Configuration
* The system Clock is configured as follow :
@@ -109,13 +127,13 @@ void board_init(void)
#endif
SystemClock_Config();
-
SystemCoreClockUpdate();
+ all_rcc_clk_enable();
+
GPIO_InitTypeDef GPIO_InitStruct;
// LED
- __HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = LED_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
@@ -123,16 +141,32 @@ void board_init(void)
HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
// Button
- __HAL_RCC_GPIOC_CLK_ENABLE();
GPIO_InitStruct.Pin = BUTTON_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
+ // Uart
+ GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = UART_GPIO_AF;
+ HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
+
+ UartHandle.Instance = UARTx;
+ UartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE;
+ UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
+ UartHandle.Init.StopBits = UART_STOPBITS_1;
+ UartHandle.Init.Parity = UART_PARITY_NONE;
+ UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ UartHandle.Init.Mode = UART_MODE_TX_RX;
+ UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
+ HAL_UART_Init(&UartHandle);
+
/* Configure USB FS GPIOs */
/* Configure DM DP Pins */
- __HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
@@ -155,7 +189,6 @@ void board_init(void)
/* Enable USB FS Clocks */
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
}
//--------------------------------------------------------------------+
@@ -180,8 +213,8 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- (void) buf; (void) len;
- return 0;
+ HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
+ return len;
}
#if CFG_TUSB_OS == OPT_OS_NONE
diff --git a/hw/bsp/stm32f767nucleo/stm32f7xx_hal_conf.h b/hw/bsp/stm32f767nucleo/stm32f7xx_hal_conf.h
index 44093d69c..234191b00 100644
--- a/hw/bsp/stm32f767nucleo/stm32f7xx_hal_conf.h
+++ b/hw/bsp/stm32f767nucleo/stm32f7xx_hal_conf.h
@@ -41,7 +41,7 @@
/* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_DAC_MODULE_ENABLED */
/* #define HAL_DCMI_MODULE_ENABLED */
-/* #define HAL_DMA_MODULE_ENABLED */
+#define HAL_DMA_MODULE_ENABLED
/* #define HAL_DMA2D_MODULE_ENABLED */
/* #define HAL_ETH_MODULE_ENABLED */
#define HAL_FLASH_MODULE_ENABLED
@@ -66,7 +66,7 @@
/* #define HAL_SPDIFRX_MODULE_ENABLED */
/* #define HAL_SPI_MODULE_ENABLED */
/* #define HAL_TIM_MODULE_ENABLED */
-/* #define HAL_UART_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
/* #define HAL_USART_MODULE_ENABLED */
/* #define HAL_IRDA_MODULE_ENABLED */
/* #define HAL_SMARTCARD_MODULE_ENABLED */
diff --git a/hw/bsp/stm32l0538disco/stm32l0538disco.c b/hw/bsp/stm32l0538disco/stm32l0538disco.c
index a3daaf0d2..6b0222ea0 100644
--- a/hw/bsp/stm32l0538disco/stm32l0538disco.c
+++ b/hw/bsp/stm32l0538disco/stm32l0538disco.c
@@ -161,6 +161,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/bsp/stm32l476disco/stm32l476disco.c b/hw/bsp/stm32l476disco/stm32l476disco.c
index 8e01814c6..a4cad68bb 100644
--- a/hw/bsp/stm32l476disco/stm32l476disco.c
+++ b/hw/bsp/stm32l476disco/stm32l476disco.c
@@ -182,6 +182,18 @@ uint32_t board_button_read(void)
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
}
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
diff --git a/hw/mcu/nordic/nrfx_config.h b/hw/mcu/nordic/nrfx_config.h
index 7c8b90781..8f9aeffe5 100644
--- a/hw/mcu/nordic/nrfx_config.h
+++ b/hw/mcu/nordic/nrfx_config.h
@@ -1,879 +1,10 @@
#ifndef NRFX_CONFIG_H__
#define NRFX_CONFIG_H__
-#define NRFX_PRS_ENABLED 0
-#define NRFX_CLOCK_ENABLED 0
+#define NRFX_POWER_ENABLED 1
+#define NRFX_POWER_CONFIG_IRQ_PRIORITY 7
-// <e> NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver
-//==========================================================
-#ifndef NRFX_POWER_ENABLED
-#define NRFX_POWER_ENABLED 1
-#endif
-// <o> NRFX_POWER_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY
-#define NRFX_POWER_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator
-
-
-// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
-
-#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN
-#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0
-#endif
-
-// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator
-
-
-// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
-
-#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV
-#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0
-#endif
-
-// </e>
-
-
-// <e> NRFX_QSPI_ENABLED - nrfx_qspi - QSPI peripheral driver
-//==========================================================
-#ifndef NRFX_QSPI_ENABLED
-#define NRFX_QSPI_ENABLED 1
-#endif
-// <o> NRFX_QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255>
-
-
-#ifndef NRFX_QSPI_CONFIG_SCK_DELAY
-#define NRFX_QSPI_CONFIG_SCK_DELAY 1
-#endif
-
-// <o> NRFX_QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation.
-#ifndef NRFX_QSPI_CONFIG_XIP_OFFSET
-#define NRFX_QSPI_CONFIG_XIP_OFFSET 0
-#endif
-
-// <o> NRFX_QSPI_CONFIG_READOC - Number of data lines and opcode used for reading.
-
-// <0=> FastRead
-// <1=> Read2O
-// <2=> Read2IO
-// <3=> Read4O
-// <4=> Read4IO
-
-#ifndef NRFX_QSPI_CONFIG_READOC
-#define NRFX_QSPI_CONFIG_READOC 0
-#endif
-
-// <o> NRFX_QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing.
-
-// <0=> PP
-// <1=> PP2O
-// <2=> PP4O
-// <3=> PP4IO
-
-#ifndef NRFX_QSPI_CONFIG_WRITEOC
-#define NRFX_QSPI_CONFIG_WRITEOC 0
-#endif
-
-// <o> NRFX_QSPI_CONFIG_ADDRMODE - Addressing mode.
-
-// <0=> 24bit
-// <1=> 32bit
-
-#ifndef NRFX_QSPI_CONFIG_ADDRMODE
-#define NRFX_QSPI_CONFIG_ADDRMODE 0
-#endif
-
-// <o> NRFX_QSPI_CONFIG_MODE - SPI mode.
-
-// <0=> Mode 0
-// <1=> Mode 1
-
-#ifndef NRFX_QSPI_CONFIG_MODE
-#define NRFX_QSPI_CONFIG_MODE 0
-#endif
-
-// <o> NRFX_QSPI_CONFIG_FREQUENCY - Frequency divider.
-
-// <0=> 32MHz/1
-// <1=> 32MHz/2
-// <2=> 32MHz/3
-// <3=> 32MHz/4
-// <4=> 32MHz/5
-// <5=> 32MHz/6
-// <6=> 32MHz/7
-// <7=> 32MHz/8
-// <8=> 32MHz/9
-// <9=> 32MHz/10
-// <10=> 32MHz/11
-// <11=> 32MHz/12
-// <12=> 32MHz/13
-// <13=> 32MHz/14
-// <14=> 32MHz/15
-// <15=> 32MHz/16
-
-#ifndef NRFX_QSPI_CONFIG_FREQUENCY
-#define NRFX_QSPI_CONFIG_FREQUENCY 15
-#endif
-
-// <s> NRFX_QSPI_PIN_SCK - SCK pin value.
-#ifndef NRFX_QSPI_PIN_SCK
-#define NRFX_QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED
-#endif
-
-// <s> NRFX_QSPI_PIN_CSN - CSN pin value.
-#ifndef NRFX_QSPI_PIN_CSN
-#define NRFX_QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED
-#endif
-
-// <s> NRFX_QSPI_PIN_IO0 - IO0 pin value.
-#ifndef NRFX_QSPI_PIN_IO0
-#define NRFX_QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED
-#endif
-
-// <s> NRFX_QSPI_PIN_IO1 - IO1 pin value.
-#ifndef NRFX_QSPI_PIN_IO1
-#define NRFX_QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED
-#endif
-
-// <s> NRFX_QSPI_PIN_IO2 - IO2 pin value.
-#ifndef NRFX_QSPI_PIN_IO2
-#define NRFX_QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED
-#endif
-
-// <s> NRFX_QSPI_PIN_IO3 - IO3 pin value.
-#ifndef NRFX_QSPI_PIN_IO3
-#define NRFX_QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED
-#endif
-
-// <o> NRFX_QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_QSPI_CONFIG_IRQ_PRIORITY
-#define NRFX_QSPI_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// </e>
-
-// <e> NRFX_RNG_ENABLED - nrfx_rng - RNG peripheral driver
-//==========================================================
-#ifndef NRFX_RNG_ENABLED
-#define NRFX_RNG_ENABLED 1
-#endif
-// <q> NRFX_RNG_CONFIG_ERROR_CORRECTION - Error correction
-
-
-#ifndef NRFX_RNG_CONFIG_ERROR_CORRECTION
-#define NRFX_RNG_CONFIG_ERROR_CORRECTION 1
-#endif
-
-// <o> NRFX_RNG_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_RNG_CONFIG_IRQ_PRIORITY
-#define NRFX_RNG_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// <e> NRFX_RNG_CONFIG_LOG_ENABLED - Enables logging in the module.
-//==========================================================
-#ifndef NRFX_RNG_CONFIG_LOG_ENABLED
-#define NRFX_RNG_CONFIG_LOG_ENABLED 0
-#endif
-// <o> NRFX_RNG_CONFIG_LOG_LEVEL - Default Severity level
-
-// <0=> Off
-// <1=> Error
-// <2=> Warning
-// <3=> Info
-// <4=> Debug
-
-#ifndef NRFX_RNG_CONFIG_LOG_LEVEL
-#define NRFX_RNG_CONFIG_LOG_LEVEL 3
-#endif
-
-// <o> NRFX_RNG_CONFIG_INFO_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_RNG_CONFIG_INFO_COLOR
-#define NRFX_RNG_CONFIG_INFO_COLOR 0
-#endif
-
-// <o> NRFX_RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_RNG_CONFIG_DEBUG_COLOR
-#define NRFX_RNG_CONFIG_DEBUG_COLOR 0
-#endif
-
-// </e>
-
-// </e>
-
-// <e> NRFX_RTC_ENABLED - nrfx_rtc - RTC peripheral driver
-//==========================================================
-#ifndef NRFX_RTC_ENABLED
-#define NRFX_RTC_ENABLED 1
-#endif
-// <q> NRFX_RTC0_ENABLED - Enable RTC0 instance
-
-
-#ifndef NRFX_RTC0_ENABLED
-#define NRFX_RTC0_ENABLED 1
-#endif
-
-// <q> NRFX_RTC1_ENABLED - Enable RTC1 instance
-
-
-#ifndef NRFX_RTC1_ENABLED
-#define NRFX_RTC1_ENABLED 1
-#endif
-
-// <q> NRFX_RTC2_ENABLED - Enable RTC2 instance
-
-
-#ifndef NRFX_RTC2_ENABLED
-#define NRFX_RTC2_ENABLED 1
-#endif
-
-// <o> NRFX_RTC_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt
-#ifndef NRFX_RTC_MAXIMUM_LATENCY_US
-#define NRFX_RTC_MAXIMUM_LATENCY_US 2000
-#endif
-
-// <o> NRFX_RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768>
-
-
-#ifndef NRFX_RTC_DEFAULT_CONFIG_FREQUENCY
-#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768
-#endif
-
-// <q> NRFX_RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering
-
-
-#ifndef NRFX_RTC_DEFAULT_CONFIG_RELIABLE
-#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0
-#endif
-
-// <o> NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY
-#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// <e> NRFX_RTC_CONFIG_LOG_ENABLED - Enables logging in the module.
-//==========================================================
-#ifndef NRFX_RTC_CONFIG_LOG_ENABLED
-#define NRFX_RTC_CONFIG_LOG_ENABLED 0
-#endif
-// <o> NRFX_RTC_CONFIG_LOG_LEVEL - Default Severity level
-
-// <0=> Off
-// <1=> Error
-// <2=> Warning
-// <3=> Info
-// <4=> Debug
-
-#ifndef NRFX_RTC_CONFIG_LOG_LEVEL
-#define NRFX_RTC_CONFIG_LOG_LEVEL 3
-#endif
-
-// <o> NRFX_RTC_CONFIG_INFO_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_RTC_CONFIG_INFO_COLOR
-#define NRFX_RTC_CONFIG_INFO_COLOR 0
-#endif
-
-// <o> NRFX_RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_RTC_CONFIG_DEBUG_COLOR
-#define NRFX_RTC_CONFIG_DEBUG_COLOR 0
-#endif
-
-// </e>
-
-// </e>
-
-
-// <e> NRFX_SWI_ENABLED - nrfx_swi - SWI/EGU peripheral allocator
-//==========================================================
-#ifndef NRFX_SWI_ENABLED
-#define NRFX_SWI_ENABLED 1
-#endif
-// <q> NRFX_EGU_ENABLED - Enable EGU support
-
-
-#ifndef NRFX_EGU_ENABLED
-#define NRFX_EGU_ENABLED 0
-#endif
-
-// <q> NRFX_SWI0_DISABLED - Exclude SWI0 from being utilized by the driver
-
-
-#ifndef NRFX_SWI0_DISABLED
-#define NRFX_SWI0_DISABLED 0
-#endif
-
-// <q> NRFX_SWI1_DISABLED - Exclude SWI1 from being utilized by the driver
-
-
-#ifndef NRFX_SWI1_DISABLED
-#define NRFX_SWI1_DISABLED 0
-#endif
-
-// <q> NRFX_SWI2_DISABLED - Exclude SWI2 from being utilized by the driver
-
-
-#ifndef NRFX_SWI2_DISABLED
-#define NRFX_SWI2_DISABLED 0
-#endif
-
-// <q> NRFX_SWI3_DISABLED - Exclude SWI3 from being utilized by the driver
-
-
-#ifndef NRFX_SWI3_DISABLED
-#define NRFX_SWI3_DISABLED 0
-#endif
-
-// <q> NRFX_SWI4_DISABLED - Exclude SWI4 from being utilized by the driver
-
-
-#ifndef NRFX_SWI4_DISABLED
-#define NRFX_SWI4_DISABLED 0
-#endif
-
-// <q> NRFX_SWI5_DISABLED - Exclude SWI5 from being utilized by the driver
-
-
-#ifndef NRFX_SWI5_DISABLED
-#define NRFX_SWI5_DISABLED 0
-#endif
-
-// <e> NRFX_SWI_CONFIG_LOG_ENABLED - Enables logging in the module.
-//==========================================================
-#ifndef NRFX_SWI_CONFIG_LOG_ENABLED
-#define NRFX_SWI_CONFIG_LOG_ENABLED 0
-#endif
-// <o> NRFX_SWI_CONFIG_LOG_LEVEL - Default Severity level
-
-// <0=> Off
-// <1=> Error
-// <2=> Warning
-// <3=> Info
-// <4=> Debug
-
-#ifndef NRFX_SWI_CONFIG_LOG_LEVEL
-#define NRFX_SWI_CONFIG_LOG_LEVEL 3
-#endif
-
-// <o> NRFX_SWI_CONFIG_INFO_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_SWI_CONFIG_INFO_COLOR
-#define NRFX_SWI_CONFIG_INFO_COLOR 0
-#endif
-
-// <o> NRFX_SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_SWI_CONFIG_DEBUG_COLOR
-#define NRFX_SWI_CONFIG_DEBUG_COLOR 0
-#endif
-
-// </e>
-
-// </e>
-
-// <q> NRFX_SYSTICK_ENABLED - nrfx_systick - ARM(R) SysTick driver
-
-
-#ifndef NRFX_SYSTICK_ENABLED
-#define NRFX_SYSTICK_ENABLED 1
-#endif
-
-// <e> NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver
-//==========================================================
-#ifndef NRFX_TIMER_ENABLED
-#define NRFX_TIMER_ENABLED 1
-#endif
-// <q> NRFX_TIMER0_ENABLED - Enable TIMER0 instance
-
-
-#ifndef NRFX_TIMER0_ENABLED
-#define NRFX_TIMER0_ENABLED 1
-#endif
-
-// <q> NRFX_TIMER1_ENABLED - Enable TIMER1 instance
-
-
-#ifndef NRFX_TIMER1_ENABLED
-#define NRFX_TIMER1_ENABLED 1
-#endif
-
-// <q> NRFX_TIMER2_ENABLED - Enable TIMER2 instance
-
-
-#ifndef NRFX_TIMER2_ENABLED
-#define NRFX_TIMER2_ENABLED 1
-#endif
-
-// <q> NRFX_TIMER3_ENABLED - Enable TIMER3 instance
-
-
-#ifndef NRFX_TIMER3_ENABLED
-#define NRFX_TIMER3_ENABLED 1
-#endif
-
-// <q> NRFX_TIMER4_ENABLED - Enable TIMER4 instance
-
-
-#ifndef NRFX_TIMER4_ENABLED
-#define NRFX_TIMER4_ENABLED 1
-#endif
-
-// <o> NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode
-
-// <0=> 16 MHz
-// <1=> 8 MHz
-// <2=> 4 MHz
-// <3=> 2 MHz
-// <4=> 1 MHz
-// <5=> 500 kHz
-// <6=> 250 kHz
-// <7=> 125 kHz
-// <8=> 62.5 kHz
-// <9=> 31.25 kHz
-
-#ifndef NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY
-#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0
-#endif
-
-// <o> NRFX_TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation
-
-// <0=> Timer
-// <1=> Counter
-
-#ifndef NRFX_TIMER_DEFAULT_CONFIG_MODE
-#define NRFX_TIMER_DEFAULT_CONFIG_MODE 0
-#endif
-
-// <o> NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width
-
-// <0=> 16 bit
-// <1=> 8 bit
-// <2=> 24 bit
-// <3=> 32 bit
-
-#ifndef NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH
-#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0
-#endif
-
-// <o> NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY
-#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// <e> NRFX_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module.
-//==========================================================
-#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED
-#define NRFX_TIMER_CONFIG_LOG_ENABLED 0
-#endif
-// <o> NRFX_TIMER_CONFIG_LOG_LEVEL - Default Severity level
-
-// <0=> Off
-// <1=> Error
-// <2=> Warning
-// <3=> Info
-// <4=> Debug
-
-#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL
-#define NRFX_TIMER_CONFIG_LOG_LEVEL 3
-#endif
-
-// <o> NRFX_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_TIMER_CONFIG_INFO_COLOR
-#define NRFX_TIMER_CONFIG_INFO_COLOR 0
-#endif
-
-// <o> NRFX_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_TIMER_CONFIG_DEBUG_COLOR
-#define NRFX_TIMER_CONFIG_DEBUG_COLOR 0
-#endif
-
-// </e>
-
-// <e> NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver
-//==========================================================
-#ifndef NRFX_UARTE_ENABLED
-#define NRFX_UARTE_ENABLED 1
-#endif
-// <o> NRFX_UARTE0_ENABLED - Enable UARTE0 instance
-#ifndef NRFX_UARTE0_ENABLED
-#define NRFX_UARTE0_ENABLED 1
-#endif
-
-// <o> NRFX_UARTE1_ENABLED - Enable UARTE1 instance
-#ifndef NRFX_UARTE1_ENABLED
-#define NRFX_UARTE1_ENABLED 1
-#endif
-
-// <o> NRFX_UARTE_DEFAULT_CONFIG_HWFC - Hardware Flow Control
-
-// <0=> Disabled
-// <1=> Enabled
-
-#ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC
-#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0
-#endif
-
-// <o> NRFX_UARTE_DEFAULT_CONFIG_PARITY - Parity
-
-// <0=> Excluded
-// <14=> Included
-
-#ifndef NRFX_UARTE_DEFAULT_CONFIG_PARITY
-#define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0
-#endif
-
-// <o> NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE - Default Baudrate
-
-// <323584=> 1200 baud
-// <643072=> 2400 baud
-// <1290240=> 4800 baud
-// <2576384=> 9600 baud
-// <3862528=> 14400 baud
-// <5152768=> 19200 baud
-// <7716864=> 28800 baud
-// <8388608=> 31250 baud
-// <10289152=> 38400 baud
-// <15007744=> 56000 baud
-// <15400960=> 57600 baud
-// <20615168=> 76800 baud
-// <30801920=> 115200 baud
-// <61865984=> 230400 baud
-// <67108864=> 250000 baud
-// <121634816=> 460800 baud
-// <251658240=> 921600 baud
-// <268435456=> 1000000 baud
-
-#ifndef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE
-#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920
-#endif
-
-// <o> NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY
-#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// <e> NRFX_UARTE_CONFIG_LOG_ENABLED - Enables logging in the module.
-//==========================================================
-#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED
-#define NRFX_UARTE_CONFIG_LOG_ENABLED 0
-#endif
-// <o> NRFX_UARTE_CONFIG_LOG_LEVEL - Default Severity level
-
-// <0=> Off
-// <1=> Error
-// <2=> Warning
-// <3=> Info
-// <4=> Debug
-
-#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL
-#define NRFX_UARTE_CONFIG_LOG_LEVEL 3
-#endif
-
-// <o> NRFX_UARTE_CONFIG_INFO_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_UARTE_CONFIG_INFO_COLOR
-#define NRFX_UARTE_CONFIG_INFO_COLOR 0
-#endif
-
-// <o> NRFX_UARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_UARTE_CONFIG_DEBUG_COLOR
-#define NRFX_UARTE_CONFIG_DEBUG_COLOR 0
-#endif
-
-// </e>
-
-// </e>
-
-// <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
-//==========================================================
-#ifndef NRFX_UART_ENABLED
-#define NRFX_UART_ENABLED 1
-#endif
-// <o> NRFX_UART0_ENABLED - Enable UART0 instance
-#ifndef NRFX_UART0_ENABLED
-#define NRFX_UART0_ENABLED 1
-#endif
-
-// <o> NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control
-
-// <0=> Disabled
-// <1=> Enabled
-
-#ifndef NRFX_UART_DEFAULT_CONFIG_HWFC
-#define NRFX_UART_DEFAULT_CONFIG_HWFC 0
-#endif
-
-// <o> NRFX_UART_DEFAULT_CONFIG_PARITY - Parity
-
-// <0=> Excluded
-// <14=> Included
-
-#ifndef NRFX_UART_DEFAULT_CONFIG_PARITY
-#define NRFX_UART_DEFAULT_CONFIG_PARITY 0
-#endif
-
-// <o> NRFX_UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate
-
-// <323584=> 1200 baud
-// <643072=> 2400 baud
-// <1290240=> 4800 baud
-// <2576384=> 9600 baud
-// <3866624=> 14400 baud
-// <5152768=> 19200 baud
-// <7729152=> 28800 baud
-// <8388608=> 31250 baud
-// <10309632=> 38400 baud
-// <15007744=> 56000 baud
-// <15462400=> 57600 baud
-// <20615168=> 76800 baud
-// <30924800=> 115200 baud
-// <61845504=> 230400 baud
-// <67108864=> 250000 baud
-// <123695104=> 460800 baud
-// <247386112=> 921600 baud
-// <268435456=> 1000000 baud
-
-#ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE
-#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800
-#endif
-
-// <o> NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
-
-// <0=> 0 (highest)
-// <1=> 1
-// <2=> 2
-// <3=> 3
-// <4=> 4
-// <5=> 5
-// <6=> 6
-// <7=> 7
-
-#ifndef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY
-#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 7
-#endif
-
-// <e> NRFX_UART_CONFIG_LOG_ENABLED - Enables logging in the module.
-//==========================================================
-#ifndef NRFX_UART_CONFIG_LOG_ENABLED
-#define NRFX_UART_CONFIG_LOG_ENABLED 0
-#endif
-// <o> NRFX_UART_CONFIG_LOG_LEVEL - Default Severity level
-
-// <0=> Off
-// <1=> Error
-// <2=> Warning
-// <3=> Info
-// <4=> Debug
-
-#ifndef NRFX_UART_CONFIG_LOG_LEVEL
-#define NRFX_UART_CONFIG_LOG_LEVEL 3
-#endif
-
-// <o> NRFX_UART_CONFIG_INFO_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_UART_CONFIG_INFO_COLOR
-#define NRFX_UART_CONFIG_INFO_COLOR 0
-#endif
-
-// <o> NRFX_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
-
-// <0=> Default
-// <1=> Black
-// <2=> Red
-// <3=> Green
-// <4=> Yellow
-// <5=> Blue
-// <6=> Magenta
-// <7=> Cyan
-// <8=> White
-
-#ifndef NRFX_UART_CONFIG_DEBUG_COLOR
-#define NRFX_UART_CONFIG_DEBUG_COLOR 0
-#endif
-
-// </e>
-
-
-// </e>
-
-// </e>
-
-// </h>
+#define NRFX_UARTE_ENABLED 1
+#define NRFX_UARTE0_ENABLED 1
#endif // NRFX_CONFIG_H__
diff --git a/hw/mcu/nordic/nrfx_log.h b/hw/mcu/nordic/nrfx_log.h
new file mode 100644
index 000000000..3bc1b424e
--- /dev/null
+++ b/hw/mcu/nordic/nrfx_log.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NRFX_LOG_H__
+#define NRFX_LOG_H__
+
+// THIS IS A TEMPLATE FILE.
+// It should be copied to a suitable location within the host environment into
+// which nrfx is integrated, and the following macros should be provided with
+// appropriate implementations.
+// And this comment should be removed from the customized file.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup nrfx_log nrfx_log.h
+ * @{
+ * @ingroup nrfx
+ *
+ * @brief This file contains macros that should be implemented according to
+ * the needs of the host environment into which @em nrfx is integrated.
+ */
+
+/**
+ * @brief Macro for logging a message with the severity level ERROR.
+ *
+ * @param format printf-style format string, optionally followed by arguments
+ * to be formatted and inserted in the resulting string.
+ */
+#define NRFX_LOG_ERROR(format, ...)
+
+/**
+ * @brief Macro for logging a message with the severity level WARNING.
+ *
+ * @param format printf-style format string, optionally followed by arguments
+ * to be formatted and inserted in the resulting string.
+ */
+#define NRFX_LOG_WARNING(format, ...)
+
+/**
+ * @brief Macro for logging a message with the severity level INFO.
+ *
+ * @param format printf-style format string, optionally followed by arguments
+ * to be formatted and inserted in the resulting string.
+ */
+#define NRFX_LOG_INFO(format, ...)
+
+/**
+ * @brief Macro for logging a message with the severity level DEBUG.
+ *
+ * @param format printf-style format string, optionally followed by arguments
+ * to be formatted and inserted in the resulting string.
+ */
+#define NRFX_LOG_DEBUG(format, ...)
+
+
+/**
+ * @brief Macro for logging a memory dump with the severity level ERROR.
+ *
+ * @param[in] p_memory Pointer to the memory region to be dumped.
+ * @param[in] length Length of the memory region in bytes.
+ */
+#define NRFX_LOG_HEXDUMP_ERROR(p_memory, length)
+
+/**
+ * @brief Macro for logging a memory dump with the severity level WARNING.
+ *
+ * @param[in] p_memory Pointer to the memory region to be dumped.
+ * @param[in] length Length of the memory region in bytes.
+ */
+#define NRFX_LOG_HEXDUMP_WARNING(p_memory, length)
+
+/**
+ * @brief Macro for logging a memory dump with the severity level INFO.
+ *
+ * @param[in] p_memory Pointer to the memory region to be dumped.
+ * @param[in] length Length of the memory region in bytes.
+ */
+#define NRFX_LOG_HEXDUMP_INFO(p_memory, length)
+
+/**
+ * @brief Macro for logging a memory dump with the severity level DEBUG.
+ *
+ * @param[in] p_memory Pointer to the memory region to be dumped.
+ * @param[in] length Length of the memory region in bytes.
+ */
+#define NRFX_LOG_HEXDUMP_DEBUG(p_memory, length)
+
+
+/**
+ * @brief Macro for getting the textual representation of a given error code.
+ *
+ * @param[in] error_code Error code.
+ *
+ * @return String containing the textual representation of the error code.
+ */
+#define NRFX_LOG_ERROR_STRING_GET(error_code)
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // NRFX_LOG_H__
diff --git a/hw/mcu/ti b/hw/mcu/ti
-Subproject 14fd86b9a69d7fef42d1045ef88fd8bcabe1be4
+Subproject ed52d354c99e25a5e9db2376eb5e7058c81c3eb