I want to Port kinetis bootloader(Kboot) for K20dx256xxx10 so "which is suitable controller i have to use as a reference"?

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

I want to Port kinetis bootloader(Kboot) for K20dx256xxx10 so "which is suitable controller i have to use as a reference"?

Jump to solution
1,713 Views
harshpatel
Contributor IV

Hello every one

         I need to prepare kinetis bootloader for K20DX256xxx10.

  • Is there any support in kinetis bootloader for this controller(k20dx256xxx10)?

If not than suggest me equivalent controller supported by kinetis bootloader so that i can port it for  required controller.

waiting for your valuable response.....

Thank you

Regards,

Harsh

Labels (1)
1 Solution
866 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Harsh,

The KBOOT hasn't support the K20_100 now, and I'd like to suggest that you should port the K22_120 demo to the K20 by referring to the Chapter 10 Kinetis bootloader porting.

2016-04-12_9-30-15.jpg
Have a great day,
Ping

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

View solution in original post

13 Replies
866 Views
harshpatel
Contributor IV

Finally i have ported it successfully....:smileyhappy:

Thank you both for your inputs....

Thanks & regards

Harsh

0 Kudos
866 Views
mjbcswitzerland
Specialist V

Hi

As mentioned originally this includes KBOOT USB and UART compatibility.

Regards

Mark

0 Kudos
866 Views
harshpatel
Contributor IV

Hello

Well i  have taken reference of K22FN256 flashloader . Linker file of  flashloder code is "MK22FN256xxx12_ram_flashloader.ld". Now if i use linker file  "MK22FN256xxx12_flashloader_loader.ld"   its gives error of STACK_TOP.  I am adding " __STACK_TOP = .;" in "MK22FN256xxx12_flashloader_loader.ld" to remove error. But after changing this large application is not working only small application is working with this code.

So i want to know

1]  Is it fine to use  "MK22FN256xxx12_flashloader_loader.ld" to load bootloader in flash memory rather than RAM?

2] I have taken reference of flashloader rather than flashloader_loader. So is it fine to take reference of it?

image.png

Thank you once again...

Waiting for your response..

Regards,

Harsh

0 Kudos
866 Views
mjbcswitzerland
Specialist V

Hi

Note that NXP has cleaned-up and upgraded the KBOOT V1.0 to V2.0 [ Introducing Kinetis Bootloader v2 ]

with additional features which may be a better starting point for you.

It doesn't look to support the K20 still but rather more recent silicon releases.

Remember that for people who prefer to have a immediate solution rather then investing weeks (I think you have taken 3 weeks to date without a working solution yet) the uTasker boot loader supports about 16'000 combinations of loading/chips and IDEs in order to save time and money.

Regards

Mark

0 Kudos
866 Views
harshpatel
Contributor IV

Hi Mark Butcher

you are right but we have dependency for Kboot. In our product all 4 controllers have kboot bootloader and we have to port it on android so we are not willing to use other bootloader for one controller. So we are using too much bandwidth on it.

Thank you

Regards

Harsh

0 Kudos
866 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Harsh,

Thanks for your information.

Actually, I've not find something wrong with implementation currently, and I will move on to dig deeper.

However can the bootloader code jump to the application code successful after you program the application code to the chip manually by using the external programmer?
Have a great day,
Ping

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

0 Kudos
866 Views
harshpatel
Contributor IV

Hello jeremyzhou

Greetings of the day.....

we have already ported bootloader for other controllers.we know there is predefined application address.In bootloader application code predefined application address is 0xA000.  So in my demo application i have changed linker file according to that means assigned offset of 0xA000. But after flashing demo application using bootloader application address found 0xA4D9 means  when bootloader completes its work than it jump to ADDRESS 0xA4D9 rather than 0xA000. 

in bootloader config.h file :

#if !defined(BL_APP_VECTOR_TABLE_ADDRESS)

#define BL_APP_VECTOR_TABLE_ADDRESS 0xA000

#endif

in my demo application i have changed linker file as follows:

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

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

M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;

/* Specify the memory areas */

MEMORY

{

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

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

  m_text                (RX)  : ORIGIN = 0x0000A410, LENGTH = 0x0003FBF0                            //ORIGIN=0x00000410

  m_data                (RW)  : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000

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

}

so just i want to know which thing can change this application jump address?

Let me know any more information required...

Thank you once again...

Regards,

Harsh

0 Kudos
866 Views
harshpatel
Contributor IV

thank you jeremyzhou​  for your suggestion

Application address is 0xA000 but  in code during execution found applicationAddress  0xA4D9 rather than 0xA000 means it jumps to other location.

Can anyone give suggestion why this happening?

waiting for your inputs...

0 Kudos
866 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Harsh,

The jump application address is predefined in the bootloader application code, you'd better to figure out the exactly value of the address.
Have a great day,
Ping

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

0 Kudos
866 Views
harshpatel
Contributor IV

First of all thank you for your valuable reply....

I have ported for MK20dx256vll10. Its UART is working means i can flash a code using bootloader.

But there is a issue :

If i flash large application (.bin) of 100 kb than its not working  but if i flash small application (.bin) of 34kb its works. 

so please any one suggest me to fix the problem...

Linker file settings are as follows:

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

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

M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;

/* Specify the memory areas */

MEMORY

{

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

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

  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0

  m_data                (RW)  : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000

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

}

memory_map_K20D256:

memory_map_entry_t g_memoryMap[] = {

    { 0x00000000, 0x0003ffff, &g_flashMemoryInterface },   // Flash array (256KB)

  { 0x1fff8000, 0x20007fff, &g_normalMemoryInterface },  // SRAM (64KB)

    { 0x40080000, 0x400fefff, &g_deviceMemoryInterface },  // AIPS peripherals

    { 0x42000000, 0x43ffffff, &g_deviceMemoryInterface },  // GPIO

    { 0xe0000000, 0xe00fffff, &g_deviceMemoryInterface },  // M4 private peripherals

    { 0 } // Terminator

};

0 Kudos
866 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Harsh,

I'm glad to hear that you had already finished the porting job.

About the current issue, I'd like to suggest that you can compare the read-back data after program the MCU through the programmer and bootloader application, for instance, the Jlink supports to read back the data on the chip and create a new data file to store this information.

After the comparison, I think you can figure out the root cause of the issue.
Have a great day,
Ping

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

0 Kudos
866 Views
mjbcswitzerland
Specialist V

Hi

If you prefer to avoid porting there is KBOOT USB and UART support for K20 50, 72, 100 and 120MHz at http://www.utasker.com/kinetis.html

Regards

Mark

867 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Harsh,

The KBOOT hasn't support the K20_100 now, and I'd like to suggest that you should port the K22_120 demo to the K20 by referring to the Chapter 10 Kinetis bootloader porting.

2016-04-12_9-30-15.jpg
Have a great day,
Ping

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