cancel
Showing results for 
Search instead for 
Did you mean: 

A question about irqIsrEnable Function

guo qiang
Senior
Posted on September 25, 2017 at 14:53

I wrote a BootLoader program. and a APP 

program

I downloaded the BootLoader to the 0x0 address in Flash By UDE 4.8.

I downloaded the App to the 0x18000 address in Flash By UDE 4.8.

//code 1:

componentsInit();

irqIsrEnable();

SPCSetRunMode(SPC5_RUNMODE_DRUN);

 irqIsrDisable();

asm volatile (''e_lis %r3, 0x00018008@h \t\n''

''e_or2i %r3, 0x00018008@l \t\n''

''mtctr %r3 \t\n''

''se_bctrl'');

//APP:

componentsInit();

irqIsrEnable();

for ( ; ; )

{

  pal_lld_togglepad(PORT_C, PC_LED8);

  osalThreadDelayMilliseconds(1000);

}

Everything is OK.

But ,If i am use CAN in the Bootload .when the APP run to irqIsrEnable

.it will be enter 

_unhandled_irq function

//code 2:

componentsInit();

irqIsrEnable();

can_lld_start(&CAND1,&can_config_cfg0);

SPCSetRunMode(SPC5_RUNMODE_DRUN);

 irqIsrDisable();

asm volatile (''e_lis %r3, 0x00018008@h \t\n''

''e_or2i %r3, 0x00018008@l \t\n''

''mtctr %r3 \t\n''

''se_bctrl'');

//APP:

componentsInit();

irqIsrEnable();

for ( ; ; )

{

  pal_lld_togglepad(PORT_C, PC_LED8);

  osalThreadDelayMilliseconds(1000);

}0690X00000608MiQAI.png0690X00000608N2QAI.png

I think that before the jump to close the CAN, APP implementation irqIsrEnable will continue to run.but  i try call can_lld_stop.andt jump to APP ,it doesn't work..

pls help me !

3 REPLIES 3
Erwan YVIN
ST Employee
Posted on September 26, 2017 at 10:35

Hello ,

You have to switch in assembler mode in debug PLS tool

and check to the register LR (Link register) to check the cause of the issue.

              Best regards

                               Erwan

Posted on September 26, 2017 at 12:55

open fae_debg.wsx file using PLS 4.8

________________

Attachments :

SPC560B_BootLoad_APP_Test.7z.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyP7&d=%2Fa%2F0X0000000b7G%2FNIHGuTrnaQmC4F7_ZxFo8hOY898EpGBrtDa4Z_NJxBI&asPdf=false
procolo
Senior
Posted on September 26, 2017 at 16:08

Hi

please do not call can_stop . there is an issue we are tring to understand

check here:

https://community.st.com/0D50X00009XkXx9SAF