HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
Loading...
Searching...
No Matches
exceptions.h File Reference

Debug tool and helpers. More...

#include "sarmfsw.h"
Include dependency graph for exceptions.h:
This graph shows which files directly or indirectly include this file:

Macros

#define exception_Handler(e)
 Exception handler asm caller.
 

Functions

void HardFault_Handler_callback (const uint32_t stack[])
 prints informations about current Hard Fault exception
 
void Error_Handler_callback (const uint32_t stack[])
 prints informations about current Hard Fault exception
 
eResetSource Get_Reset_Source (void)
 Get the last source of reset.
 

Detailed Description

Debug tool and helpers.

Author
SMFSW

Macro Definition Documentation

◆ exception_Handler

#define exception_Handler ( e)
Value:
__ASM ( "tst lr, #4 \r\n" \
"ite EQ \r\n" \
"mrseq r0, MSP \r\n" \
"mrsne r0, PSP \r\n" \
"b " #e "_Handler_callback \r\n");

Exception handler asm caller.

Note
The exception_Handler should be called with corresponding exception name e as parameter

Function Documentation

◆ Error_Handler_callback()

void Error_Handler_callback ( const uint32_t stack[])

prints informations about current Hard Fault exception

Parameters
[in]stack- pointer to stack address
Note
HardFault_Handler_callback should not be called directly use exception_Handler() which prepares pointer to current stack instead
Warning
Depending how arm is fucked up, informations may not be printed, at least, you could inspect exception and stack through debug breakpoint
Note
Never returns (anyways, arm fubared!)

◆ Get_Reset_Source()

eResetSource Get_Reset_Source ( void )

Get the last source of reset.

Warning
This function should be called soon after reset (before or after SystemClock_Config())
Note
This function using some special macros can't be inlined, thus can't be in sarmfsw stm32 header unfortunately
Returns
Last Reset Source

◆ HardFault_Handler_callback()

void HardFault_Handler_callback ( const uint32_t stack[])

prints informations about current Hard Fault exception

Parameters
[in]stack- pointer to stack address
Note
HardFault_Handler_callback should not be called directly use exception_Handler() which prepares pointer to current stack instead
Warning
Depending how arm is fucked up, informations may not be printed, at least, you could inspect exception and stack through debug breakpoint
Note
Never returns (anyways, arm fubared!)