[FL-1473, FL-1651] Update STM32CubeWB to latest version. Radio firmware bundle. (#642)

* FuriHal: update STM32CubeWB to latest version.
* Makefile: debug other script
* FuriHal: correctly handle 0 size transfers in VCP
* Dolphin: cleanup and minor timer tuning.
* FuriHal: update FreeRTOS config with bigger timer command queue.
* FuriHal: delayed irq enabling, fixes missing ticks.
* FuriHal: use SFSA to determine free space for internal FS, update linker script to use as much space as theoretically possible.
* Scripts: update core2 flashing scripts and OB data.
* Github: bundle resources, core2 firmware and supplementary data.
* GitHub: versioning for supplemental artifacts
This commit is contained in:
あく
2021-08-17 12:41:08 +03:00
committed by GitHub
parent 1f192c4a48
commit f02cec45a0
15 changed files with 115 additions and 49 deletions

View File

@@ -51,17 +51,16 @@
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
#include <stdint.h>
extern uint32_t SystemCoreClock;
void xPortSysTickHandler(void);
/* USER CODE BEGIN 0 */
extern void configureTimerForRunTimeStats(void);
extern unsigned long getRunTimeCounterValue(void);
/* USER CODE END 0 */
#endif
#ifndef CMSIS_device_header
#define CMSIS_device_header "stm32wbxx.h"
#endif /* CMSIS_device_header */
#define configENABLE_FPU 1
#define configENABLE_MPU 1
#define configUSE_PREEMPTION 1
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_STATIC_ALLOCATION 0
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
@@ -100,22 +99,24 @@
/* Software timer definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 10
#define configTIMER_QUEUE_LENGTH 32
#define configTIMER_TASK_STACK_DEPTH 256
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskDelay 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_eTaskGetState 1
/*
* The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
@@ -159,9 +160,13 @@ standard names. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
/* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick,
to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */
/* #define xPortSysTickHandler SysTick_Handler */
#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1
/* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */
/* USER CODE END Defines */
#endif /* FREERTOS_CONFIG_H */

View File

@@ -241,7 +241,9 @@ static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length)
static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len)
{
/* USER CODE BEGIN 6 */
_furi_hal_vcp_rx_callback((char*)Buf, *Len);
if (*Len) {
_furi_hal_vcp_rx_callback((char*)Buf, *Len);
}
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
return (USBD_OK);
/* USER CODE END 6 */

View File

@@ -52,12 +52,13 @@ typedef PACKED_STRUCT
* THIS SHALL BE SET TO A VALUE DIFFERENT FROM 0 ONLY ON REQUEST FROM ST SUPPORT
*/
#define BLE_DTB_CFG 0
#define SYS_DBG_CFG1 (SHCI_C2_DEBUG_OPTIONS_IPCORE_LP | SHCI_C2_DEBUG_OPTIONS_CPU2_STOP_EN)
/* USER CODE END PD */
/* 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}};
PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static SHCI_C2_DEBUG_GeneralConfig_t APPD_GeneralConfig={BLE_DTB_CFG, SYS_DBG_CFG1, {0, 0}};
/**
* THE DEBUG ON GPIO FOR CPU2 IS INTENDED TO BE USED ONLY ON REQUEST FROM ST SUPPORT

View File

@@ -5,7 +5,6 @@
/* Free flash space borders, exported by linker */
extern const void __free_flash_start__;
extern const void __free_flash_end__;
#define FURI_HAL_FLASH_READ_BLOCK 8
#define FURI_HAL_FLASH_WRITE_BLOCK 8
@@ -37,7 +36,9 @@ const void* furi_hal_flash_get_free_start_address() {
}
const void* furi_hal_flash_get_free_end_address() {
return &__free_flash_end__;
FLASH_OBProgramInitTypeDef pOBInit;
HAL_FLASHEx_OBGetConfig(&pOBInit);
return (const void *)pOBInit.SecureFlashStartAddr;
}
size_t furi_hal_flash_get_free_page_start_address() {

View File

@@ -26,6 +26,8 @@ void furi_hal_os_timer_callback() {
}
#endif
extern void xPortSysTickHandler();
volatile uint32_t furi_hal_os_skew = 0;
void furi_hal_os_init() {
@@ -122,9 +124,6 @@ void vPortSuppressTicksAndSleep(TickType_t expected_idle_ticks) {
// Sleep and track how much ticks we spent sleeping
uint32_t completed_ticks = furi_hal_os_sleep(expected_idle_ticks);
// Reenable IRQ
__enable_irq();
// Notify system about time spent in sleep
if (completed_ticks > 0) {
if (completed_ticks > expected_idle_ticks) {
@@ -133,6 +132,9 @@ void vPortSuppressTicksAndSleep(TickType_t expected_idle_ticks) {
vTaskStepTick(completed_ticks);
}
}
// Reenable IRQ
__enable_irq();
}
void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) {

View File

@@ -55,7 +55,7 @@ _Min_Stack_Size = 0x1000; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 780K
FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 992K
RAM1 (xrw) : ORIGIN = 0x20000004, LENGTH = 0x2FFFC
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
}
@@ -173,7 +173,6 @@ SECTIONS
{
__free_flash_start__ = .;
. = ORIGIN(FLASH) + LENGTH(FLASH);
__free_flash_end__ = .;
} >FLASH
/* Remove information from the standard libraries */

View File

@@ -55,7 +55,7 @@ _Min_Stack_Size = 0x1000; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 812K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
RAM1 (xrw) : ORIGIN = 0x20000004, LENGTH = 0x2FFFC
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
}
@@ -173,7 +173,6 @@ SECTIONS
{
__free_flash_start__ = .;
. = ORIGIN(FLASH) + LENGTH(FLASH);
__free_flash_end__ = .;
} >FLASH
/* Remove information from the standard libraries */