lpcware

reboot after ISP programming

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
Content originally posted in LPCWare by plaramee on Tue May 24 04:58:59 MST 2016
Hi, I have searched on this forum, but couldn't find an answer.

I am looking for a way to have our LPC1837 micro reboot after programming via ISP. We actually also have products that use an LPC2132 micro and we have a way that works on this micro. I tried doing the same on the 1837, but it doesn't work.

So what I did was to extract the binary of a part of the code (from flash) that resets the CPU while it is running from flash. This is actually the NVIC_SystemReset function from the CMSIS core_cm3.h file.


/** \brief  System Reset

    The function initiates a system reset request to reset the MCU.
*/
__STATIC_INLINE void NVIC_SystemReset(void)
{
  __DSB();                                                     /* Ensure all outstanding memory accesses included
                                                                  buffered write are completed before reset */
  SCB->AIRCR  = ((0x5FA << SCB_AIRCR_VECTKEY_Pos)      |
                 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
                 SCB_AIRCR_SYSRESETREQ_Msk);                   /* Keep priority group unchanged */
  __DSB();                                                     /* Ensure completion of memory access */
  while(1);                                                    /* wait until reset */
}


So I grabbed the bytes from flash that correspond to this piece of code.  I converted it into UUE encoding so it can be sent via ISP. Once in ISP, I sent it to ram with the Write To Ram ISP command. The I send the checksum (it replies OK), then I use the Go command. Then nothing.

If I use the go command on the flash address that holds this exact same piece of code, the CPU reboots. But as this piece of code my not always be at the same address, I'd rather load it to ram and use the go command from there. Again, we do this on the 2132 micro and it works.

Any ides why this method doesn't work on the LPC1837? Is there an errata sheet I missed that would tell me more about this?

Any other idea on how to make the CPU reset from ISP?

Thank you,

Outcomes