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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

802件の閲覧回数
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!

ラベル(1)
タグ(2)
2 返答(返信)

722件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

in C code, you can use something like:

typedef void (*func_ptr)();

(*(func_ptr)ADDRESS)();

Regards,

Lukas

721件の閲覧回数
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 件の賞賛