Using BL instruction to jump to an absolute address in C file

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

Using BL instruction to jump to an absolute address in C file

1,123 Views
tyut-zhangjie
Contributor I

Hi Support Team:

I am using the codewarrior for one boot project using the Pictus MCU.

Now I met an problem about using BL instruction.

I want to jump to the application software when I check the condition is OK, so I write it in one C file:

#define _APPL_ENTRY    0x2004

......

if (Main_u16ApplMakrker != 0xFFFF)

{

      asm (" bl _APPL_ENTRY");

}

else

{

    /* stay at boot  */

}

but there is the fault that "illegal operand" about bl.

How I should do it?

Thanks very much!

Labels (1)
Tags (2)
2 Replies

1,043 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

in C code, you can use something like:

typedef void (*func_ptr)();

(*(func_ptr)ADDRESS)();

Regards,

Lukas

1,042 Views
tyut-zhangjie
Contributor I

Thanks very much.

In fact, I had done it what you said.

But I can not understand why the BL instruction can not work. is it must a "Lable" followed by BL instruction?

Anyway, the problem is fixed.

Thanks again for your reply.

0 Kudos
Reply