lpc17xx update FW with RTOS via IAP
Posted by Valentí
on October 23, 2012
I need to do a firmware with RTOS, able to update itself. This FW would update flash memory with the new FW sent before via remote communications (saved temporally in a portion of flash memory). The FW would be composed with an custom bootloader, the RTOS and the user's firmware. The bootloader, on boot, would looking for a new FW valid on reserved flash memory. If so, it will update the actual firmware via IAP commands and then will delete the reserved flash memory.
I did that with more simple plataforms with 8 bits MCUs like PF81C51RD2 or P89LPC932 and without RTOS. But I'm newbie working with 32bits MCUs and also with RTOS. So any ideas or suggestions would be very appreciated.
Is there an easy way to do that? How could affect the RTOS in this process?
Thanks in advance.
PD: We use...
LPCXpresso: v4.2.3 [Build 292]
RTOS: FreeRTOS 7.2
RE: lpc17xx update FW with RTOS via IAP
Posted by Richard
on October 23, 2012
Applications that use FreeRTOS are statically linked - they are just executable programs like any other program so there is no difference using a bootloader with FreeRTOS than without.
If you bootloader is always the first thing to run then the RTOS tick interrupt won't be installed, so you need do nothing to stop it. If the bootloader can run after the kernel has stared, then you will need to stop the tick interrupt first, to ensure the kernel does not attempt a context switch. The consideration is the same for all interrupts though, so again this is not FreeRTOS specific.
Other things you have to do are map the interrupt vectors correctly, so the bootloader has its vector table, then you remap the vector table when the application starts running so it has its own vector table (including the RTOS handlers). Again, that would need to be done with or without an RTOS though.
Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd..
See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.