Porting BootLoader CODE for MK20DX256VLL10

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

Porting BootLoader CODE for MK20DX256VLL10

Jump to solution
3,315 Views
harshpatel
Contributor IV

Hello Every One...

Is there Boot loader CODE for MK20DX256VLL10  provided by Freescale ?

If Not than i want Suggestion..

Freescale provides Bootloader code for MK22f25612,MK12810,Mk22F51212 and others.  So which Code i have to use as reference to port Bootloader code for MK20Dx256VLL10 thus i can port straight away??

if any one have tried  before than help me to port as soon as possible...

Thanks to all

Labels (1)
1 Solution
2,337 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Patel,


Here is the description for each of the project types:

1. tower_bootloader – bootloader designed to execute from target flash memory on the Tower platform.

2. freedom_bootloader – bootloader designed to execute from target flash memory on the Freedom platform.

3. flashloader – bootloader designed to execute from target RAM memory on either the Freedom or Tower platform.

4. flashloader_loader – bootstrap loader designed to execute from flash memory on either the Freedom or Tower platform. This loader copies an image of the flashloader into RAM, then executes the flashloader from RAM.

Regarding the device you should use as reference, as Mark mentions if you plan to use the MK20Dx256VLL10 MCU it would be better to use the TWR-K60D100M board which is more compatible with the K20D10 devices instead of the FRDM-K20D50M board.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

View solution in original post

13 Replies
2,337 Views
harshpatel
Contributor IV

Thank you both for your valuable reply

i want one more help in this topic...

I required to use FRDM-k20d50 board with KSDK library 1.2.0 or 1.1.0.

while creating project  in  KDS  no such board ( "FRDM-k20d50" ) is available but  processor ("MK20DX128xxx5") is available.

Now  for this processor ("MK20DX128xxx5") if i want to create project using KSDk library 1.2.0  than how can i do this..?

0 Kudos
Reply
2,337 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Patel,

Please notice that the K20D50 MCUs are not supported by KSDK 1.2, only the K20D10 MCUS are supported via the TWR-K60D100M board.

If you want to use the K20D50 MCUs with KSDK 1.2 you will have to port the code from a supported device to the K20D50 MCU, you could use as base the MK21DX128Axxx5 device. Attached is a document that explains how to port the SDK package to a new MCU.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos
Reply
2,337 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Patel,

Unfortunately the K20D10 MCUs are not supported by the Kinetis Bootloader 1.2 but you can port the bootloader from the MK22F12810 MCU following the steps described in the chapter 10 "Kinetis bootloader porting" of the Kinetis Bootloader v1.2.0 Reference Manual:

http://cache.freescale.com/files/soft_dev_tools/doc/ref_manual/KBTLDR120RM.pdf#page=96

Please notice that if you are going to use the USB bootloader then you will have to configure the device to run from the External oscillator, this is because the K20 MCU does not have a high-precision internal reference clock (IRC), also make sure to update the Bootloader memory map configuration.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,337 Views
harshpatel
Contributor IV

Thank you carlos_mendoza   for your reply

you have suggested MK2F12810 as a refrence  is fine.

i am going to port for FRDM MK20D50 board but in freescalr bootloader there is no refrence code for freedom Mk22f12810... means freescale provides flashloader, flashloader_loader and twr_bootloader...there is no code for freedom_bootloader".

SO which code i have to use for porting ?

flashloader ?

flashloader_loader ?

twr_bootloader?

Also can you explain what is what is difference beetween "flashloader and flashloader_loader"!!

waiting for your valueable reply....

Thanks

0 Kudos
Reply
2,338 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Patel,


Here is the description for each of the project types:

1. tower_bootloader – bootloader designed to execute from target flash memory on the Tower platform.

2. freedom_bootloader – bootloader designed to execute from target flash memory on the Freedom platform.

3. flashloader – bootloader designed to execute from target RAM memory on either the Freedom or Tower platform.

4. flashloader_loader – bootstrap loader designed to execute from flash memory on either the Freedom or Tower platform. This loader copies an image of the flashloader into RAM, then executes the flashloader from RAM.

Regarding the device you should use as reference, as Mark mentions if you plan to use the MK20Dx256VLL10 MCU it would be better to use the TWR-K60D100M board which is more compatible with the K20D10 devices instead of the FRDM-K20D50M board.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

2,337 Views
harshpatel
Contributor IV

Thank you Carlos _Mendoza  for your input...

I have ported serial Boot loader  for K20D128xx50 successfully.

Now want to know one more thing .....as per your suggestion I have successfully ported bootloader for KL26Z128VLH4 (FRDM KL26z board)  from KL25z128 (FRDM KL25 board)  and its working fine.  While porting for KL26 from KL25 i have not changed any memory related code in memory_map_<device>.c

but now I want bootloader for KL26z256VLH4 from last KL26Z128VLH4 (FRDM KL26z board) bootloader code.

So my Question is ..is there any change required in memory_map_<device>.c  to port code for KL26Z256VLH4?

waiting for your input.....

Thank  you....

0 Kudos
Reply
2,337 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Patel,

Yes, you need to update the device memory map is defined in the g_memoryMap[] structure of the memory_map_<device>.c file to reflect the new Flash and SRAM memory sizes.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

2,337 Views
harshpatel
Contributor IV

Thank you  Carlos

But i required more info about this...

This is a g_memoryMap[]  i have written in my Bootloader code for KL26Z128VLH4 ..

memory_map_entry_t g_memoryMap[] = {

    { 0x00000000, 0x0001ffff, &g_flashMemoryInterface },   // Flash array

    { 0x1ffff000, 0x20002fff, &g_normalMemoryInterface },  // SRAM (SRAM_L + SRAM_U)

#if !defined(BL_TARGET_RAM)

    { 0x40000000, 0x4007ffff, &g_deviceMemoryInterface },  // AIPS peripherals

    { 0x400ff000, 0x400fffff, &g_deviceMemoryInterface },  // GPIO

    { 0x44000000, 0x5fffffff, &g_deviceMemoryInterface },  // BME

    { 0xe0000000, 0xe00fffff, &g_deviceMemoryInterface },  // M0+ private peripherals

    { 0xf0003000, 0xf0003fff, &g_deviceMemoryInterface },  // MCM

    { 0xf8000000, 0xffffffff, &g_deviceMemoryInterface },  // IOPORT (single-cycle GPIO)

#endif // !BL_TARGET_RAM

Now i want to change in this array for KL26z256VLH4...

so it will be...

memory_map_entry_t g_memoryMap[] = {

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

    { 0x1ffff000, 0x20006fff, &g_normalMemoryInterface },  // SRAM (SRAM_L + SRAM_U) for 32Kb SRAM

and   remaining array will remain same..

#if !defined(BL_TARGET_RAM)

    { 0x40000000, 0x4007ffff, &g_deviceMemoryInterface },  // AIPS peripherals

    { 0x400ff000, 0x400fffff, &g_deviceMemoryInterface },  // GPIO

    { 0x44000000, 0x5fffffff, &g_deviceMemoryInterface },  // BME

    { 0xe0000000, 0xe00fffff, &g_deviceMemoryInterface },  // M0+ private peripherals

    { 0xf0003000, 0xf0003fff, &g_deviceMemoryInterface },  // MCM

    { 0xf8000000, 0xffffffff, &g_deviceMemoryInterface },  // IOPORT (single-cycle GPIO)

IS there any changes required in array...??

waiting for your valuable input...

Thanks once again ...

Regards

Harsh

0 Kudos
Reply
2,337 Views
mjbcswitzerland
Specialist V

Harsh

256k Flash / 32k Ram KL requires:

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

    { 0x1fffe000, 0x20005fff, &g_normalMemoryInterface },  // SRAM (SRAM_L + SRAM_U) for 32Kb SRAM

If you however have a boot loader running on a 128k/16k part you can use that - there is no need for changes in the liker script file (it will run the same in the original area of RAM).

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

KL26: http://www.utasker.com/kinetis/FRDM-KL26Z.html / http://www.utasker.com/kinetis/TEENSY_LC.html

For the complete "out-of-the-box" Kinetis experience and faster time to market

:smileyinfo: Out-of-the-box boot loader support for 46 Kinetis boards, 8 modes and 10 IDEs (over 15'000 combinations from a single code source with no porting required)

2,337 Views
harshpatel
Contributor IV

Thank you Mark

May i know why SRAM config for (256 flash/32Kb RAM )is..

{ 0x1fffe000, 0x20005fff, &g_normalMemoryInterface },  // SRAM (SRAM_L + SRAM_U) for 32Kb SRAM

rather than...

{ 0x1ffff000, 0x20006fff, &g_normalMemoryInterface },  // SRAM (SRAM_L + SRAM_U) for 32Kb SRAM   ??

Thanks once again..

0 Kudos
Reply
2,337 Views
mjbcswitzerland
Specialist V

Harsh

This is standard information - you just need to look in the KL26 User's Manual:

pastedImage_0.pngpastedImage_1.png

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

KL26: http://www.utasker.com/kinetis/FRDM-KL26Z.html / http://www.utasker.com/kinetis/TEENSY_LC.html

For the complete "out-of-the-box" Kinetis experience and faster time to market

:smileyinfo: Out-of-the-box boot loader support for 46 Kinetis boards, 8 modes and 10 IDEs (over 15'000 combinations from a single code source with no porting required)

2,337 Views
mjbcswitzerland
Specialist V

Harsh

Beware when porting from K22D100 to K20D50, and later for the MK20DX256VLL10 since these parts have some big differences between them - also the K20D50 and K20D100 are not compatible in a number or critical respects. It may be advisable to start with a K60D100 reference, which is much more compatible with the K20D100.

If you take the uTasker serial loader and build for targets FRDM_K20D50M, TWR_K20D72M, TEENSY_3_1, K20FX512_120 and TWR_K60D100M, which allow AN2295 or Kboot USB and UART to operate on these parts/boards, you can then see the differences required. Having a working reference for comparisons may save you a few days of development effort in case you hit some difficulties in the process of the porting task(s) in hand.

Regards

Mark

2,337 Views
mjbcswitzerland
Specialist V

Hello

Just a heads up for professionals who don't want to budget porting KBOOT to other processors in their projects - there is a complete set of K, KL, KV, KW, KE, KEA versions which can be built and modified using KDS, CW, GCC, IAR, Keil, Rowley, Atollic, CooCox, Greenhills or GCC at µTasker Kinetis support

The KBOOT operation (UART and USB) can also be combined with Ethernet, USB-MSD (composite), SD card or other UART protocols (SREC and AN2295 mode).

Regards

Mark

Kinetis: µTasker Kinetis support

Serial Bootloader (Ethernet, USB, MSD, KBOOT, AN2295, SREC, SD-card): KBOOT Loader Compatibilty and extra features  / http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF 

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
Reply