How to enable to generated ISR OnHardFault Code using PE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable to generated ISR OnHardFault Code using PE

Jump to solution
1,283 Views
davidzhou
Contributor V

Hi,

I have K60 tower board. I have MQX 4.2 and Code Warrior 10.6.4.

I want to generate code for Cpu_OnHardFault ISR using PE, but it is disabled. I am not sure there is any way to enable it for generate code:

pastedImage_1.png

0 Kudos
Reply
1 Solution
1,116 Views
BlackNight
NXP Employee
NXP Employee

Hi David,

I think the reason that you cannot enable it the usual way is because you have MQX in your project: MQX takes ownership of all interrupts.

I hope this helps,

Erich

View solution in original post

0 Kudos
Reply
7 Replies
1,116 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi David

This feature is automatically enabled when the hard fault property is set to "Enabled". see below screenshot.

pastedImage_1.png


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,116 Views
davidzhou
Contributor V

Hi Jennie,

Thank you for your reply. In my PE, all the interrupts are disabled, and I cannot find a way to enable them. See the screen pasted below:

pastedImage_1.png

When I left-click the OnHardFault, there is a popup menu to toggle Enable/Disable, but it is GRAYED.

it must have another level of enabling it. I don't know the small green icon with a little cross on it. Enabled ones are blue with a check.

Thank you,

David

0 Kudos
Reply
1,116 Views
BlackNight
NXP Employee
NXP Employee

Hi David,

I agree that this might be confusing. But the it means that the *property' is disabled and cannot be changed, as the HardFault cannot be disabled. So it is turned on anyway by the hardware as it is a non-maskable interrupt.

I hope this helps,

Erich

0 Kudos
Reply
1,116 Views
davidzhou
Contributor V

Hi Erich, Jennie,

Thanks for explanation. But I still don't know how to enable it as Jennie's saved screen with ENABLE to generated code for the HardFault ISR. From my screen pasted, all those functions are disabled, AND I have a no way to ENABLE them. That results in preventing me from generating code for them. I understand they are non-maskable interrupts, currently are all tied into _int_kernel_isr. Do you mean non-maskable interrupts can not generated code from PE? But then why Jennie's screen shows enable and be able to generate code?

Thank you,

David

0 Kudos
Reply
1,117 Views
BlackNight
NXP Employee
NXP Employee

Hi David,

I think the reason that you cannot enable it the usual way is because you have MQX in your project: MQX takes ownership of all interrupts.

I hope this helps,

Erich

0 Kudos
Reply
1,116 Views
davidzhou
Contributor V

Erich,

Thank you for the answer. That explains. As I have said I have manually installed the ISR, it is not a problem for me.

Best Regards,

David

0 Kudos
Reply
1,116 Views
davidzhou
Contributor V

By the way, I have created  a function CW_InstallIsrHardFault and manually installed ISR for the OnHardFault as follows:

uint32_t CW_InstallIsrHardFault(INT_ISR_FPTR isr) {
    INT_ISR_FPTR fpISR;
    fpISR = _int_install_isr(3, isr, (void *)NULL);
    if ( fpISR == (INT_ISR_FPTR) NULL ) {
        return 1;    
    }
    return 0;
}

Thanks,

David

0 Kudos
Reply