USB DFU mode lost when Click on START on DFUsec tool after Reinvoke ISP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB DFU mode lost when Click on START on DFUsec tool after Reinvoke ISP

648 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fred033 on Wed Oct 15 09:59:20 MST 2014
Hello,

When I reinvoke ISP from my user code (using IAP command), my LPC4337 appear on computer and is detected by DFUSec.
I'm trying to flash a new firmware, but when I click on START on DFUsec tool, the DFU peripheral disappear and I have following log in DFUsec :

Downloading programming algorithm via DFU ROM boot
DFU programming algorithm download complete
Waiting Up to 4s for programming algorithm detection after DFU download
Board programming algorithm failed to start
Total program time:4.0232301 seconds.


I have tried to reinvoke ISP at the initialization of my software and all work fine. But when I reinvoke ISP when my software run the download is impossible.

To provoke the call of REinvoke ISP command I have done the following :
I send a VCOM command to my LPC (writing in a register)
When Core M0 detect this writting is send a command to M4 core and in this command treatment on M4 I reinvoke ISP.
On my computer my VCOM peripheral disappear and my LPC in DFU mode appear.
At this step I launch DFU SEC tool, and when I click on START to flash my board, the header seem to be download and after that my LPC in DFU disappear.   

I don't understand why.

Thank you for your help.
Labels (1)
0 Kudos
4 Replies

565 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fred033 on Tue Oct 21 01:02:12 MST 2014
Yes, I've verified the value is still in RAM after reset.
0 Kudos

565 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Oct 21 00:16:55 MST 2014

Quote: fred033
Before reinvoke ISP I save a value in RAM and I make a reset....



Are you sure your RAM value is surviving Reset?

See: http://www.lpcware.com/content/forum/lpc1769-keep-settings-after-restart-of-program
0 Kudos

565 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fred033 on Tue Oct 21 00:06:55 MST 2014
Hello,

I have consider the 32 bytes at the top of stack.
Before reinvoke ISP I save a value in RAM and I make a reset and in the main of my project I check the value in RAM and I reinvoke ISP.

Extract of my application code :

////In my M4 treatment when M0 send command of VCOM register update
LPC_CREG->ETBCFG |= 0x1;
*((uint32_t *)(0x2000C000)) = 0x12345678;

//Reset CTRL Registers
LPC_RGU->RESET_CTRL0 = 0x387F3337 ;


//// In my main
if (*((uint32_t *)(0x2000C000)) == 0x12345678)
{
__disable_irq();
                *((uint32_t *)(0x2000C000)) = 0x1EA31BE2;

                IAP iap_entry=(IAP)IAP_LOCATION ;
        command[0] = IAP_REINVOKE_ISP_CMD;
                iap_entry(command, result);
}
0 Kudos

565 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Mon Oct 20 04:12:08 MST 2014
Most likely you need to wind back to the conditions you have at startup.
At least consider to stop the M0 (put it in reset).
Did you consider the 32 bytes of stack which is used by the ROM routines?
If this is the area the M0 is using and the M0 is still running, then you could crash the system.

We can't put such a wind-back into the ROM routines, you need to do it in your own application code.

Regards,
NXP Support Team.
0 Kudos