How to jump to the function using the address of it?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
XiaoPing_Yang
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hi  Sir ,

     Now I have a question , How to jump to the function  using the address of it?

    In my project ,I find out  the address one of  a function in the map file. for example ,  

    void Test(void)

    {

       static  unsigned char i=0;

     

    }

   the address of it is  0x00001000,

  

   I  try the code as follows:

     (*(void(*)(void))((uint32)0x00001000))();

   but it jump  to

#ifdef CY_BOOT_INT_DEFAULT_HANDLER_EXCEPTION_ENTRY_CALLBACK

                CyBoot_IntDefaultHandler_Exception_EntryCallback();

            #endif /* CY_BOOT_INT_DEFAULT_HANDLER_EXCEPTION_ENTRY_CALLBACK */

            while(1)

            {

            }

I  cannot find out why.

Please help me!

Thanks a lot.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Have a look into this manual.

Bob

0 Likes

Thanks.

0 Likes