firmware upgrade using FSL kinetis bootloader 1.2.0 on FRDM k22f board

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

firmware upgrade using FSL kinetis bootloader 1.2.0 on FRDM k22f board

678 Views
ronakpanchal
Contributor I

Hello,

 

I am working on fsl kinetis bootloader 1.2.0 for upgrading firmware using uart on FRDM k22f board with KDS.

I have checked it with the given kinetis updater utility and uploaded the "led_demo_FRDM-K22F_a000.bin".

It's working successfully.

 

Now , i have developed small demo application of led blinking using processor expert which is working properly when directly tested(without bootloader).

Then i have changed linker file for bootloader application.

 

Given below is linker configuration for my application:

 

HEAP_SIZE  = DEFINED(__heap_size__)  ? __heap_size__  : 0x00;

STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;

/* Specify the memory areas */

MEMORY {

  m_interrupts          (RX)  : ORIGIN = 0x0000A000 , LENGTH = 0x00000400

  m_flash_config        (RX)  : ORIGIN = 0x0000A400 , LENGTH = 0x00000010

  m_interrupts_ram      (RW)  : ORIGIN = 0x1FFF0000 , LENGTH = 0x00000400

  m_text                (RX)  : ORIGIN = 0x0000A410 , LENGTH = 0x00075BF0

  m_data                (RW)  : ORIGIN = 0x1FFF0400 , LENGTH = 0x0000FC00

  m_data_2              (RW)  : ORIGIN = 0x20000000 , LENGTH = 0x00010000

}

 

But sometimes its working and sometimes its not working.

 

During debug i have found that,

(*)  demo led app :

 

app starting address - 0xa3e1

stack pointer - 0x1fff0400

 

(*) my app :

 

app starting address - 0xa4d9

stack pointer - 0x20010000

 

1) what could be the reason for such problem?

 

2) How to set and configure the "Bootloader configuration area"?

 

any help would be appreciated.

Thanks in advance..!

Labels (1)
0 Kudos
2 Replies

405 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

I just checked the linker file of led_demo_k64f12,  application stack is defined inside range 0x1FFF0000- 0x20000000

pastedImage_0.png

However if you create a new k64 project in KDS, the default stack allocation is in m_data_2 from 0x20000000. See linker file *.ld.

m_data_2 (RW)  : ORIGIN = 0x20000000, LENGTH = 0x00030000

pastedImage_1.png

so you need modify the default ld file to allocate stack inside range 0x1FFF0000- 0x20000000

Bootloader Configuration Area is a const table at 0xa000,

If you want define the same in kds, we need do it as

__attribute__((section(".bca"))) const FlashConfig_t Config __attribute__((used)) =

{

{..., …}

};

Here section .bca is defined in ld file start from 0xa000.

Please try if this can work for you.

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

0 Kudos

405 Views
ronakpanchal
Contributor I

Hi Jennie,

Thank you for your response.

As you told,I have looked in .icf file of led demo app for frdm k22f board and seems it may not cause the problem.

Let me summarize the issue:

1-I downloaded the freescale bootloader.

2-Compiled and load bootloader using KDS.

Then there are two things which we have followed.

1-We load the default led demo apps.bin on K22F and which is working fine(on every reset/reboot).

2-I created simple led demo application.bin after uploading on the same bootloader then sometimes its working sometime not.

Note:Means not blinking anything onto the board seems in hung state.

Can you please provide your inputs/suggestion which may cause the issue.

Let me know if more information required.

Regards,

Ronak

0 Kudos