Kashub's Code Barn - "asddas"

podświetlone jako text (dodał(a) dsaasd @ 2023-01-26 08:23:26)

Twoja wyszukiwarka
Podświetl ten kod w:
Ostatnio dodane:
Losowe wpisy:
/**
  * @brief  This function handles Hard Fault exception.
  * @param  None
  * @retval None
  */
__attribute__( ( naked ) ) void HardFault_Handler(void)
{
	LED_ERROR_ON;
	sysLogFAULT(HFAULT, "HardFault_Handler");
 
    __asm volatile
    (
        " tst lr, #4                                                \n"
        " ite eq                                                    \n"
        " mrseq r0, msp                                             \n"
        " mrsne r0, psp                                             \n"
        " ldr r1, [r0, #24]                                         \n"
        " ldr r2, handler2_address_const                            \n"
        " bx r2                                                     \n"
        " handler2_address_const: .word prvGetRegistersFromStack    \n"
    );
 
}
 
void prvGetRegistersFromStack( uint32_t *pulFaultStackAddress )
{
 
 
	sysLogFAULT(HFAULT, "HardFault_Handler");
	sysLogFAULT(HFAULT, "Skopiuj i wyslij programiscie");
/* These are volatile to try and prevent the compiler/linker optimising them
away as the variables never actually get used.  If the debugger won't show the
values of the variables, make them global my moving their declaration outside
of this function. */
volatile uint32_t r0;
volatile uint32_t r1;
volatile uint32_t r2;
volatile uint32_t r3;
volatile uint32_t r12;
volatile uint32_t lr; /* Link register. */
volatile uint32_t pc; /* Program counter. */
volatile uint32_t psr;/* Program status register. */
 
    r0 = pulFaultStackAddress[ 0 ];
    r1 = pulFaultStackAddress[ 1 ];
    r2 = pulFaultStackAddress[ 2 ];
    r3 = pulFaultStackAddress[ 3 ];
 
    r12 = pulFaultStackAddress[ 4 ];
    lr = pulFaultStackAddress[ 5 ];
    pc = pulFaultStackAddress[ 6 ];
    psr = pulFaultStackAddress[ 7 ];
//    sysLogFAULT(HFAULT, "R0          0x%08lx\n", r0);
//    sysLogFAULT(HFAULT, "R1          0x%08lx\n", r1);
//    sysLogFAULT(HFAULT, "R2          0x%08lx\n", r2);
//    sysLogFAULT(HFAULT, "R3          0x%08lx\n", r3);
//    sysLogFAULT(HFAULT, "R12          0x%08lx\n", r12);
//    sysLogFAULT(HFAULT, "lr          0x%08lx\n", lr);
//    sysLogFAULT(HFAULT, "pc          0x%08lx (program counter)\n", pc);
//    sysLogFAULT(HFAULT, "psr          0x%08lx\n", psr);
 
    sysLogFAULT(HFAULT, "R0          %x", r0);
    sysLogFAULT(HFAULT, "R1          %x", r1);
    sysLogFAULT(HFAULT, "R2          %x", r2);
    sysLogFAULT(HFAULT, "R3          %x", r3);
    sysLogFAULT(HFAULT, "R12         %x", r12);
    sysLogFAULT(HFAULT, "lr          %x", lr);
    sysLogFAULT(HFAULT, "pc          %x (program counter)\n", pc);
    sysLogFAULT(HFAULT, "psr         %x", psr);
 
	uint32_t cfsr  = SCB->CFSR;
	uint32_t hfsr  = SCB->HFSR;
	uint32_t mmfar = SCB->MMFAR;
	uint32_t bfar  = SCB->BFAR;
//	sysLogFAULT(HFAULT, "SCB->CFSR   0x%08lx\n", cfsr);
//	sysLogFAULT(HFAULT, "SCB->HFSR   0x%08lx\n", hfsr);
//	sysLogFAULT(HFAULT, "SCB->MMFAR  0x%08lx\n", mmfar);
//	sysLogFAULT(HFAULT, "SCB->BFAR   0x%08lx\n", bfar);
 
	sysLogFAULT(HFAULT, "SCB->CFSR   %x", cfsr);
	sysLogFAULT(HFAULT, "SCB->HFSR   %x", hfsr);
	sysLogFAULT(HFAULT, "SCB->MMFAR  %x", mmfar);
	sysLogFAULT(HFAULT, "SCB->BFAR   %x", bfar);
    /* When the following line is hit, the variables contain the register values. */
    for( ;; );
}
| Sklepy internetowe | | Sklep z artykułami dla dzieci | | Wózki dla dzieci | | Dyskretny sexshop internetowy | | Skracacz linków | | Blog o książkach | | Darmowe Blogi | | Jak przenieść bloga | | Gnieżdżewo | | Opisy na Facebooka |