[FL-3302] ble: attempt to handle hardfaulted c2 (#2653)
* ble: attempt to handle hardfaulted c2 * MfKey32: nicer macros * FuriHal: slightly different core2 hardfault message * Update ReadMe Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		
							parent
							
								
									d5403a089c
								
							
						
					
					
						commit
						eebc6241b7
					
				| @ -99,7 +99,6 @@ Make sure your Flipper is on, and your firmware is functioning. Connect your Fli | |||||||
| - `applications`    - applications and services used in firmware | - `applications`    - applications and services used in firmware | ||||||
| - `assets`          - assets used by applications and services | - `assets`          - assets used by applications and services | ||||||
| - `furi`            - Furi Core: OS-level primitives and helpers | - `furi`            - Furi Core: OS-level primitives and helpers | ||||||
| - `debug`           - debug tool: GDB plugins, an SVD file, etc. |  | ||||||
| - `documentation`   - documentation generation system configs and input files | - `documentation`   - documentation generation system configs and input files | ||||||
| - `firmware`        - firmware source code | - `firmware`        - firmware source code | ||||||
| - `lib`             - our and 3rd party libraries, drivers, etc. | - `lib`             - our and 3rd party libraries, drivers, etc. | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								applications/external/mfkey32/mfkey32.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								applications/external/mfkey32/mfkey32.c
									
									
									
									
										vendored
									
									
								
							| @ -41,7 +41,7 @@ | |||||||
| #define BIT(x, n) ((x) >> (n)&1) | #define BIT(x, n) ((x) >> (n)&1) | ||||||
| #define BEBIT(x, n) BIT(x, (n) ^ 24) | #define BEBIT(x, n) BIT(x, (n) ^ 24) | ||||||
| #define SWAPENDIAN(x) \ | #define SWAPENDIAN(x) \ | ||||||
|     (x = (x >> 8 & 0xff00ff) | (x & 0xff00ff) << 8, x = x >> 16 | x << 16) //-V1003
 |     ((x) = ((x) >> 8 & 0xff00ff) | ((x)&0xff00ff) << 8, (x) = (x) >> 16 | (x) << 16) | ||||||
| //#define SIZEOF(arr) sizeof(arr) / sizeof(*arr)
 | //#define SIZEOF(arr) sizeof(arr) / sizeof(*arr)
 | ||||||
| 
 | 
 | ||||||
| static int eta_round_time = 56; | static int eta_round_time = 56; | ||||||
|  | |||||||
| @ -54,6 +54,26 @@ void ble_glue_set_key_storage_changed_callback( | |||||||
|     ble_glue->context = context; |     ble_glue->context = context; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | ///////////////////////////////////////////////////////////////////////////////
 | ||||||
|  | 
 | ||||||
|  | /* TL hook to catch hardfaults */ | ||||||
|  | 
 | ||||||
|  | int32_t ble_glue_TL_SYS_SendCmd(uint8_t* buffer, uint16_t size) { | ||||||
|  |     if(furi_hal_bt_get_hardfault_info()) { | ||||||
|  |         furi_crash("ST(R) Copro(R) HardFault"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     return TL_SYS_SendCmd(buffer, size); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void shci_register_io_bus(tSHciIO* fops) { | ||||||
|  |     /* Register IO bus services */ | ||||||
|  |     fops->Init = TL_SYS_Init; | ||||||
|  |     fops->Send = ble_glue_TL_SYS_SendCmd; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | ///////////////////////////////////////////////////////////////////////////////
 | ||||||
|  | 
 | ||||||
| void ble_glue_init() { | void ble_glue_init() { | ||||||
|     ble_glue = malloc(sizeof(BleGlue)); |     ble_glue = malloc(sizeof(BleGlue)); | ||||||
|     ble_glue->status = BleGlueStatusStartup; |     ble_glue->status = BleGlueStatusStartup; | ||||||
|  | |||||||
| @ -1,27 +1,38 @@ | |||||||
| # Structure | # Structure | ||||||
| 
 | 
 | ||||||
| - `app-scened-template` - Scened template app library | - `FreeRTOS-Kernel`     - FreeRTOS kernel source code | ||||||
| - `app-template`        - Template app library | - `FreeRTOS-glue`       - Extra glue to hold together FreeRTOS kernel and flipper firmware | ||||||
|  | - `ST25RFAL002`         - ST25R3916 Driver and protocol stack | ||||||
|  | - `app-scened-template` - C++ app library | ||||||
| - `callback-connector`  - Callback connector library | - `callback-connector`  - Callback connector library | ||||||
| - `drivers`             - Drivers that we wrote | - `cmsis_core`          - CMSIS Core package, contain cortex-m core headers | ||||||
| - `fatfs`               - External storage file system | - `cxxheaderparser`     - C++ headers parser, used by SDK bundler | ||||||
|  | - `digital_signal`      - Digital signal library: used by NFC for software implemented protocols | ||||||
|  | - `drivers`             - Various flipper drivers | ||||||
|  | - `fatfs`               - FatFS file system driver | ||||||
|  | - `flipper_application` - Flipper application library, used for FAPs | ||||||
| - `flipper_format`      - Flipper File Format library | - `flipper_format`      - Flipper File Format library | ||||||
| - `fnv1a-hash`          - Fnv1a hash library | - `fnv1a-hash`          - FNV-1a hash library | ||||||
| - `heatshrink`          - Image compression library | - `heatshrink`          - Heatshrink compression library | ||||||
| - `infrared`            - Infrared library | - `ibutton`             - ibutton library, used by iButton application | ||||||
| - `libusb_stm32`        - STM32 USB library | - `infrared`            - Infrared library, used by Infrared application | ||||||
| - `littlefs`            - Internal storage file system | - `lfrfid`              - LF-RFID library, used by LF RFID application | ||||||
| - `micro-ecc`           - Elliptic Curve Crytography library | - `libusb_stm32`        - LibUSB for STM32 series MCU | ||||||
| - `microtar`            - TAR archive support library | - `littlefs`            - LittleFS file system driver, used by internal storage | ||||||
| - `mlib`                - Algorithms and containers | - `mbedtls`             - MbedTLS cryptography library | ||||||
| - `nanopb`              - Nano Protobuf library | - `micro-ecc`           - MicroECC cryptography library | ||||||
| - `nfc`                 - Nfc library | - `microtar`            - MicroTAR library | ||||||
| - `one_wire`            - One wire library | - `mlib`                - M-Lib C containers library | ||||||
| - `qrcode`              - Qr code generator library | - `nanopb`              - NanoPB library, protobuf implementation for MCU | ||||||
| - `ST25RFAL002`         - ST253916 driver and NFC hal | - `nfc`                 - NFC library, used by NFC application | ||||||
| - `stm32wb_cmsis`       - STM32WB series CMSIS component | - `one_wire`            - OneWire library, used by iButton application | ||||||
| - `stm32wb_copro`       - STM32WB Coprocessor fimrware + WPAN library | - `print`               - Tiny printf implementation | ||||||
| - `stm32wb_hal_driver`  - STM32WB series HAL | - `pulse_reader`        - Pulse Reader library used by NFC for software implemented protocols | ||||||
| - `subghz`              - SubGhz library | - `qrcode`              - QR-Code library | ||||||
| - `toolbox`             - Toolbox of things that we are using but don't place in core | - `stm32wb_cmsis`       - STM32WB series CMSIS headers, extends CMSIS Core | ||||||
| - `u8g2`                - Graphics library that we use to draw GUI | - `stm32wb_copro`       - STM32WB Copro library: contains WPAN and radio co-processor firmware | ||||||
|  | - `stm32wb_hal`         - STM32WB HAL library, extends STM32WB CMSIS and provides HAL | ||||||
|  | - `subghz`              - Subghz library, used by SubGhz application | ||||||
|  | - `toolbox`             - Toolbox library, contains various things that is used by flipper firmware | ||||||
|  | - `u8g2`                - u8g2 graphics library, used by GUI subsystem | ||||||
|  | - `update_util`         - update utilities library, used by updater | ||||||
| @ -48,6 +48,7 @@ sources += Glob( | |||||||
| ) | ) | ||||||
| sources += Glob( | sources += Glob( | ||||||
|     "stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c", |     "stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c", | ||||||
|  |     exclude="stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c", | ||||||
|     source=True, |     source=True, | ||||||
| ) | ) | ||||||
| sources += [ | sources += [ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 hedger
						hedger