AnsweredAssumed Answered

MQX Bootloader

Question asked by Tim Hutchinson on Mar 19, 2012
Latest reply on Apr 24, 2013 by shweta v

Hi Everyone,


    I'm trying to use the Freescale example bootloader application (MQX 3.8, CW 9.2) to load a ROM image of my application to an TWR-MPC-5125 target and boot to it. I'm able to directly load my app into the NAND Flash on the target and run it that way using the "ExtNand Download Release Target" but I want to use the bootloader so I can store multiple images (variations on my app) on the target and select one at boot time with the bootloader terminal prompt.


     I'm able to flash the bootloader into the target and have it run on a reset and use the a terminal interface and tftp to store an image to the target. Here's a screenshot of my terminal after using the bootloader to store an image of my application:



     I created the ROM image of my target as I believe the Freescale NAND Bootloader User's Guide (MQXBLDUG) specified with the RAM/ROM settings from the Linker Command File of my application. Here's a clip of the MEMORY section of the *.lcf file for my application showing the rom area located at 0x0001_0000 and the ram area at 0x0200_0000:


MEMORY { //Physical layout - hardware dependent //------------------------------------------------- SDRAM:           org = 0x00000000, len = 0x10000000 SRAM:            org = 0x30000000, len = 0x00008000 IMMR:            org = 0x80000000, len = 0x00100000 FLASH:           org = 0xFFF00000, len = 0x00800000 //Logical layout - change to suit application if required //------------------------------------------------- rom:             org = 0x00010000, len = 0x01FF0000 boot_rom:        org = 0x003FEF00, len = 0x00001000 ram:             org = 0x02000000, len = 0x08000000 kernel_data:     org = 0x0A000000, len = 0x05800000 nand:            org = 0x40000000, len = 0x00000000 // Page table memory //------------------------------------------------- page_tables:     org = 0x01000000, len = 0x0 //Physical memory backing the virtual context //------------------------------------------------- virtual_ram: org = 0x01200000, len = 0x0 //Cached vs. non cached region -  //------------------------------------------------- cached_ram:      org = 0x00000000, len = 0x0A000000 uncached_ram:    org = 0x0F800000, len = 0x00800000 }


     Here's a screenshot of the CodeWarrior EPPC Linker panel where the ROM image is spec'd. Note that I've specified the same address for ROM and RAM as in the Linker Command File for my application.




     So far this is all straight out of the Freescale NAND Bootloader Users Guide but I'm not able to make it happen. The bootloader runs as it should when the target hardware is reset. The bootloader finds the stored image I had previously downloaded and confirms the checksum is ok. After the bootloader completes it's 5 second countdown I'm assuming it's attempting to copy the image of my application to RAM and run it but the target just freezes up at that point and I have to reset it. Hitting a key before the 5 second countdown to prevent the bootloader from attempting to load my app allows me to interact with the bootloader using the terminal interface and I see my image but am not able to get the bootloader to run it.


     So much of this process is working properly that I'm sure I'm missing some small step but I can't figure out what it is. Note that I'm telling the bootloader to store my image at address 0x0000_0000 with the imgload command maybe that's not correct? I've tried several other addresses with no better results. I apologize for making such a long post but if anyone can offer any insight, advice, guidance or suggestions I would sure appreciate. Thanks!