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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,643 次查看
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 回复数

1,563 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

in C code, you can use something like:

typedef void (*func_ptr)();

(*(func_ptr)ADDRESS)();

Regards,

Lukas

1,562 次查看
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 项奖励
回复