Hello everyone,
I currently use a K60(MK60FN1MOVLQ12) and a PE Micro programmer to program the micro-controller,Is there any way i can use a boot loader sequence so that i can program nmy uC using a simple UART port.
My apologies if i sound vague,but i have never used a boot loader before and if some one could give me some relevant documents so that i can read up on it for this particular micro-controller.
My main goal however is to program the uC through one of the UART ports.I have read up on this a little ,but its all too confusing for me !!!
Correct me if i am wrong but this is what i got so far:
1.I enter the boot loader mode by setting a particular pin low(i am planning to use a jumper here to enter the bootloader mode)
2.Send some initial parameters.
3.Copy the .elf file into the RAM at a specific address .
4.Boot the uC and erase the RAM if required.
Any help would be highly appreciated.
Thank you Hui_Ma for your reply,but i am still unclear as to how to enter into the boot mode.As per the document i should send a logic 0 on the interrupt request pin,but i am unable to find that particular IQR pin on the controller as it may not have a dedicated IQR pin,any other way of entering into boot mode?
Hello Arun:
The "send logic 0" is only mentioned in the appnote as one of the multiple traditional methods to enter bootloader mode. In a typical bootloader implementation, the user needs to press an external button connected to a pin, so the MCU stays in the bootloader code instead of jumping to the application code.
The actual method used in the AN2295 bootloader is not via push button. Instead the MCU sends an acknowledge character via serial interface to the PC software and waits for a response; if no response is received after a timeout, then the MCU jumps to the app code.
About the IRQ, there is no dedicated pin, as in Kinetis K devices all GPIO pins can generate an interrupt. But the interrupts are shared between pins of the same port, e.g. PORTA interrupt is shared between all PTAx pins, PORTB interrupt can be entered by any PTBx pin, and so on.
Hope this helps to clarify.
Regards!
Jorge Gonzalez
Thank you Santiago and Mark.
But as i said earlier i have never used a boot loader up until now,i have a few basic doubts before i begin to write some code.
Regarding Hardware:
Do i have to make any changes to enter into the bootloader mode?
Regarding software:
What address ranges are available for me to use.Is there a certain limit in the max address or can i use the whole of ROM/RAM?
Hi Kumar,
About hardware aspect, for you want to load code from UART, it need to add available UART communication port on board.
About software aspect, Kinetis chip boot from Flash address 0, it need to use bootloader code located Flash low address range and load application code to customer set address. AN2295 is a good example for your reference.
You can use the whole ROM/RAM, there without any restriction.
Wish it helps.
Best regards,
Ma Hui
Hi
The ELF file is never loaded directly to the processor since it contains a lot of debugging information as well as the binary. Usually a raw binary (for serial loaders, more commonly SREC) is loaded. Although loading to RAM would be possible the code is usually loaded to flash so that it can run after a power cycle.
Serial loader description: http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF
Serial loader software: µTasker Test Software and Demos
Regards
Mark
Hello Arun,
If you have enough RAM to fit your application, you could do that. But is more common to copy it to Flash.
You have a fully developed serial bootloader for Kinetis and other Freescale platforms explained in the App note AN2295.
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2295.pdf
Regards,
Santiago