[FL-1558] Technical Debt: console, bootloader, targets, stdglue, etc... (#590)
* ApiHal: console abstraction, change uart baud rate to 230400. Bootloader: drop F5. Furi: prevent thread local output to serial console in stdglue. * ApiHal: take control over system initialization, reorder some subsystems in a hope of fixing USB issues. * Main: cleanup dead code. ISR: take care of HSECSS by our self. USB: leave clock configuration alone. * F6 cube: switch RCC to LL. * Cli: rollback return behavior.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "shci.h"
|
||||
#include "tl.h"
|
||||
#include "dbg_trace.h"
|
||||
#include <api-hal.h>
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -53,24 +54,11 @@ typedef PACKED_STRUCT
|
||||
#define BLE_DTB_CFG 0
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PV */
|
||||
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static SHCI_C2_DEBUG_TracesConfig_t APPD_TracesConfig={0, 0, 0, 0};
|
||||
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static SHCI_C2_DEBUG_GeneralConfig_t APPD_GeneralConfig={BLE_DTB_CFG, {0, 0, 0}};
|
||||
|
||||
#ifdef CFG_DEBUG_TRACE_UART
|
||||
#if(CFG_HW_LPUART1_ENABLED == 1)
|
||||
extern void MX_LPUART1_UART_Init(void);
|
||||
#endif
|
||||
#if(CFG_HW_USART1_ENABLED == 1)
|
||||
extern void MX_USART1_UART_Init(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* THE DEBUG ON GPIO FOR CPU2 IS INTENDED TO BE USED ONLY ON REQUEST FROM ST SUPPORT
|
||||
* It provides timing information on the CPU2 activity.
|
||||
@@ -366,36 +354,12 @@ static void APPD_BleDtbCfg( void )
|
||||
#if(CFG_DEBUG_TRACE != 0)
|
||||
void DbgOutputInit( void )
|
||||
{
|
||||
/* USER CODE BEGIN DbgOutputInit */
|
||||
#ifdef CFG_DEBUG_TRACE_UART
|
||||
if (CFG_DEBUG_TRACE_UART == hw_lpuart1)
|
||||
{
|
||||
#if(CFG_HW_LPUART1_ENABLED == 1)
|
||||
MX_LPUART1_UART_Init();
|
||||
#endif
|
||||
}
|
||||
else if (CFG_DEBUG_TRACE_UART == hw_uart1)
|
||||
{
|
||||
#if(CFG_HW_USART1_ENABLED == 1)
|
||||
MX_USART1_UART_Init();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* USER CODE END DbgOutputInit */
|
||||
return;
|
||||
}
|
||||
|
||||
extern UART_HandleTypeDef DEBUG_UART;
|
||||
|
||||
void DbgOutputTraces( uint8_t *p_data, uint16_t size, void (*cb)(void) )
|
||||
{
|
||||
/* USER CODE END DbgOutputTraces */
|
||||
// HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb);
|
||||
HAL_UART_Transmit(&DEBUG_UART, (uint8_t*)p_data, (uint16_t)size, HAL_MAX_DELAY);
|
||||
api_hal_console_tx(p_data, size);
|
||||
cb();
|
||||
/* USER CODE END DbgOutputTraces */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -34,8 +34,6 @@ extern "C" {
|
||||
#include "dbg_trace.h"
|
||||
#include "hw_if.h"
|
||||
|
||||
extern UART_HandleTypeDef DEBUG_UART;
|
||||
|
||||
/**
|
||||
* Enable or Disable traces
|
||||
* The raw data output is the hci binary packet format as specified by the BT specification *
|
||||
@@ -68,7 +66,7 @@ extern UART_HandleTypeDef DEBUG_UART;
|
||||
#endif
|
||||
|
||||
#if (TL_SHCI_CMD_DBG_RAW_EN != 0)
|
||||
#define TL_SHCI_CMD_DBG_RAW(_PDATA_, _SIZE_) HAL_UART_Transmit(&DEBUG_UART, (uint8_t*)_PDATA_, _SIZE_, (~0))
|
||||
#define TL_SHCI_CMD_DBG_RAW(_PDATA_, _SIZE_) api_hal_console_tx(_PDATA_, _SIZE_)
|
||||
#else
|
||||
#define TL_SHCI_CMD_DBG_RAW(...)
|
||||
#endif
|
||||
@@ -82,7 +80,7 @@ extern UART_HandleTypeDef DEBUG_UART;
|
||||
#endif
|
||||
|
||||
#if (TL_SHCI_EVT_DBG_RAW_EN != 0)
|
||||
#define TL_SHCI_EVT_DBG_RAW(_PDATA_, _SIZE_) HAL_UART_Transmit(&DEBUG_UART, (uint8_t*)_PDATA_, _SIZE_, (~0))
|
||||
#define TL_SHCI_EVT_DBG_RAW(_PDATA_, _SIZE_) api_hal_console_tx(_PDATA_, _SIZE_)
|
||||
#else
|
||||
#define TL_SHCI_EVT_DBG_RAW(...)
|
||||
#endif
|
||||
@@ -99,7 +97,7 @@ extern UART_HandleTypeDef DEBUG_UART;
|
||||
#endif
|
||||
|
||||
#if (TL_HCI_CMD_DBG_RAW_EN != 0)
|
||||
#define TL_HCI_CMD_DBG_RAW(_PDATA_, _SIZE_) HAL_UART_Transmit(&DEBUG_UART, (uint8_t*)_PDATA_, _SIZE_, (~0))
|
||||
#define TL_HCI_CMD_DBG_RAW(_PDATA_, _SIZE_) api_hal_console_tx(_PDATA_, _SIZE_)
|
||||
#else
|
||||
#define TL_HCI_CMD_DBG_RAW(...)
|
||||
#endif
|
||||
@@ -113,7 +111,7 @@ extern UART_HandleTypeDef DEBUG_UART;
|
||||
#endif
|
||||
|
||||
#if (TL_HCI_EVT_DBG_RAW_EN != 0)
|
||||
#define TL_HCI_EVT_DBG_RAW(_PDATA_, _SIZE_) HAL_UART_Transmit(&DEBUG_UART, (uint8_t*)_PDATA_, _SIZE_, (~0))
|
||||
#define TL_HCI_EVT_DBG_RAW(_PDATA_, _SIZE_) api_hal_console_tx(_PDATA_, _SIZE_)
|
||||
#else
|
||||
#define TL_HCI_EVT_DBG_RAW(...)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user