Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

According to Frank so LTO works #358

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions teensy4/startup.c
Expand Up @@ -263,6 +263,8 @@ void reset_PFD()
// R1
// R0
// Code from :: https://community.nxp.com/thread/389002
void HardFault_HandlerC(unsigned int *hardfault_args) __attribute__((used));

__attribute__((naked))
void unused_interrupt_vector(void)
{
Expand All @@ -281,6 +283,8 @@ void unused_interrupt_vector(void)

__attribute__((weak))
void HardFault_HandlerC(unsigned int *hardfault_args) {
volatile unsigned int nn ;
#if defined(PRINT_DEBUG_STUFF)
volatile unsigned int stacked_r0 ;
volatile unsigned int stacked_r1 ;
volatile unsigned int stacked_r2 ;
Expand All @@ -296,7 +300,6 @@ void HardFault_HandlerC(unsigned int *hardfault_args) {
volatile unsigned int _BFAR ;
volatile unsigned int _MMAR ;
volatile unsigned int addr ;
volatile unsigned int nn ;

stacked_r0 = ((unsigned int)hardfault_args[0]) ;
stacked_r1 = ((unsigned int)hardfault_args[1]) ;
Expand Down Expand Up @@ -339,7 +342,7 @@ void HardFault_HandlerC(unsigned int *hardfault_args) {
printf_debug(" _AFSR :: %x\n", _AFSR);
printf_debug(" _BFAR :: %x\n", _BFAR);
printf_debug(" _MMAR :: %x\n", _MMAR);

#endif
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 5; // pin 13
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = IOMUXC_PAD_DSE(7);
GPIO2_GDIR |= (1 << 3);
Expand Down