Jump from Secondary boot loader to application in IMXRT1064 is not working

cancel
Showing results for 
Search instead for 
Did you mean: 

Jump from Secondary boot loader to application in IMXRT1064 is not working

941 Views
vikram_tathe
Contributor II

I am trying to jump from Secondary boot loader to application but I am unable to do this.

In the main.c (Secondary bootloader), I have written the code shown below.

pastedImage_1.png

I have attached the bootloader and application linker files and map files here.

Here, the LED blinky code from SDK is used as application code. I have modified the memory configuration in application code as below:

pastedImage_2.png

I am expecting the primary bootloader is jumped to secondary bootloader(by default) and then the secondary bootloader will jump to application code. So, when I write bootloader binary at 0x70000000 and application at 0x70008400 location using GUI flash tool, the application should run (should blink the LED).

Could you please help me with that?

Tags (1)
12 Replies

361 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Vikram Tathe,

Thank you for your interest in NXP Semiconductor products and
the opportunity to serve you.
To provide the fastest possible support I want to point you to a
similar question which has been answered on our NXP community.
Please refer to https://community.nxp.com/thread/506445
to view the details.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

361 Views
vikram_tathe
Contributor II

Hello jeremyzhou‌,

I have gone through the mentioned thread but I didn't find any helpful information over it.

I have two separate projects, one is a bootloader project and another is an application project.

I am writing the bootloader binary first at the default location 0x70000000

and writing the application at 0x70008400 by setting the base address in the GUI flash tool. (Please correct me if I am doing wrong).

I am attaching the binary, linker and map fils for bootloader as well as application files here.

0 Kudos

361 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Vikram Tathe,

Thanks for your reply and let me clarify it.
Assume the starting address of the application project become the 0x70008400, however, it doesn't mean that the application code is placed at 0x70008400, as the image structure is Image Vector Table (IVT), it consists of a variety different of sections, besides for the application, as the Fig 1 shows. In the bootloader, you should jump to the application address to execute the application.
Hope this is clear.

pastedImage_1.png

Fig 1

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

361 Views
hippo
NXP TechSupport
NXP TechSupport

Hello jeremyzhou,

I have added IVT and related data in the secondary Bootloader only started at memory location 0x70000000.

I have not included the Image Vector Table (IVT) in the application image. So Is it mandatory to add the IVT data in the application image as well?

Regards,

Vikram

0 Kudos

361 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi hippo Employee

Thanks for your reply.
You're right, the secondary bootloader should conform to the IVT structure, however, for the application, only Application code is enough.
For your question, is it mandatory to add the IVT data in the application image as well? The answer is no.
In the SDK library, it contains a bootloader_example which illustrates how to implement the bootloader, I think it's helpful to you and please refer to it for details.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

361 Views
vikram_tathe
Contributor II

Hello,

I did not find the bootloader_example code in the SDK library. Could you please provide me the SDK link and the name of example code or path of example code in the SDK?

I am using MCUXpresso IDE v10.3.0 [Build 2200] [2018-12-03] and "SDK_2.6.1_EVK-MIMXRT1064" SDK. So, do I need to upgrade the IDE for this issue?

Thanks,

Vikram

0 Kudos

361 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Vikram Tathe,

Thanks for your reply.
Please find the bootloader_examples as the Fig 1 shows.

pastedImage_5.png

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

361 Views
vikram_tathe
Contributor II

Hello jeremyzhou

I did not find the bootloader example code in the SDK (SDK_2.6.1_EVK-MIMXRT1064).

pastedImage_1.png

Could you please confirm that your SDK is the same as mine?

If it is different SDK for imxrt1064 then please share the SDK link.

Regards,

Vikram

0 Kudos

361 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Vikram Tathe,

Thanks for your reply.

Please choose the Select All when building the SDK library.

pastedImage_20.png

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

361 Views
vikram_tathe
Contributor II

Hello,

I am facing the issues while jumping to application code from bootloader source code.

Sometimes it works as expected but sometimes it fails. I am getting the wrong values at (ADDR_IMAGE1 + HEADER_SIZE) address i.e Stack pointer and (ADDR_IMAGE1 + HEADER_SIZE + 4) address i.e. Program counter value.

JumpApplication(*(uint32_t*)(ADDR_IMAGE1 + HEADER_SIZE), *(uint32_t*)(ADDR_IMAGE1 + HEADER_SIZE + 4));

when I add some delay before jumping to application code then it works as expected. I just wanted to confirm that, is it really required to add the delay before jumping to application code?  

0 Kudos

361 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Vikram Tathe,

Thanks for your reply.

In theory, it's not necessary to add a delay before jumping to the application code, however, the MCU should implement the jumping move under all peripherals activity and software function complete.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

361 Views
vikram_tathe
Contributor II

Hello jeremyzhou‌,

I have added IVT and related data in the secondary Bootloader only started at memory location 0x70000000.

I have not included the  Image Vector Table (IVT) in the application image. So Is it mandatory to add the IVT data in the application image as well?

Regards,

Vikram

0 Kudos