1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-21 22:08:08 +00:00

fix(core/prodtest): fix failing optiga communication

[no changelog]
This commit is contained in:
tychovrahe 2023-10-12 16:03:34 +02:00 committed by matejcik
parent f26a2e909e
commit a16fbe6237

View File

@ -35,6 +35,7 @@
#include "sbu.h" #include "sbu.h"
#include "sdcard.h" #include "sdcard.h"
#include "secbool.h" #include "secbool.h"
#include "supervise.h"
#include "touch.h" #include "touch.h"
#include "usb.h" #include "usb.h"
@ -666,4 +667,28 @@ int main(void) {
return 0; return 0;
} }
void SVC_C_Handler(uint32_t *stack) {
uint8_t svc_number = ((uint8_t *)stack[6])[-2];
switch (svc_number) {
case SVC_GET_SYSTICK_VAL: {
systick_val_copy = SysTick->VAL;
} break;
default:
stack[0] = 0xffffffff;
break;
}
}
__attribute__((naked)) void SVC_Handler(void) {
__asm volatile(
" tst lr, #4 \n" // Test Bit 3 to see which stack pointer we should
// use.
" ite eq \n" // Tell the assembler that the nest 2 instructions
// are if-then-else
" mrseq r0, msp \n" // Make R0 point to main stack pointer
" mrsne r0, psp \n" // Make R0 point to process stack pointer
" b SVC_C_Handler \n" // Off to C land
);
}
void HardFault_Handler(void) { error_shutdown("INTERNAL ERROR!", "(HF)"); } void HardFault_Handler(void) { error_shutdown("INTERNAL ERROR!", "(HF)"); }