Hardware reset

lpc1768 board or the MCB1700

does anybody know how to switch bins files using the hardware reset route, so when I press the reset button it will switch bins.

I know for software it could be something like this perharps

<

>
int main (void)
{
for (;;)
If

extern "C" void lpc1768_reset();

flash.write = binfile1

else

flash.write = binfile2

endif


}

<

>

thanks,

thomas

Parents
  • The chip can remember state after a reset - the RAM isn't automatically cleared.

    So you can store a magic signature in RAM somewhere. Or you can connect an EEPROM or F-RAM memory for telling current/next binary to run.

    You can obviously not just reprogram the flash with new binaries. But you can store more than one application and have a boot loader decide which application to start.

    So you would first have to learn how to implement a boot loader. Come back when you have managed that, and it will be meaningful to discuss the concept of selecting which application to start. A boot loader can even do a full fallback waiting for a new binary on a serial port or downloading an application from a SPI-connected flash memory. Lots can be done. But first you need a working concept with a boot loader and with applications linked for use at an address different from the address range where the boot loader is stored.

    Note that you can't catch the reset - it really do force a reset of the processor. So you have to make your decission after the processor have restarted. So whatever you do, you can't have any for loop that alternates between two applications.

Reply
  • The chip can remember state after a reset - the RAM isn't automatically cleared.

    So you can store a magic signature in RAM somewhere. Or you can connect an EEPROM or F-RAM memory for telling current/next binary to run.

    You can obviously not just reprogram the flash with new binaries. But you can store more than one application and have a boot loader decide which application to start.

    So you would first have to learn how to implement a boot loader. Come back when you have managed that, and it will be meaningful to discuss the concept of selecting which application to start. A boot loader can even do a full fallback waiting for a new binary on a serial port or downloading an application from a SPI-connected flash memory. Lots can be done. But first you need a working concept with a boot loader and with applications linked for use at an address different from the address range where the boot loader is stored.

    Note that you can't catch the reset - it really do force a reset of the processor. So you have to make your decission after the processor have restarted. So whatever you do, you can't have any for loop that alternates between two applications.

Children
More questions in this forum