Content originally posted in LPCWare by fred033 on Tue Sep 23 01:40:17 MST 2014
Hi nerd,
[s]I've seen this API but I've not tested because in datasheet it is specified that when ISP mode is called through IAP command, the boot mode is UART0 and I need USB0 boot (DFU mode).[/s]
Externally invoking ISP mode is not possible, our products don't have this possibility.
After some tests :
In debug mode, when invoking bootloader CPU goes into HardFault, I think the problem is here, perhaps the address of bootloader entry point?
When I invoke bootloader I've specified address 0x10400000, is it the good one ??
My code for invoking bootloader is :
#define MEMMAP(*((volatile uint32_t *) 0x10400000))
void (*bootloader_entry)(void);
bootloader_entry = (void (*)(void))(MEMMAP);
bootloader_entry() ;
I've trying with IAP as follow :
#define IAP_LOCATION *(volatile unsigned int *)(0x10400100) ;
typedef void (*IAP)(unsigned int[5], unsigned int[4]);
IAP iap_entry=(IAP)IAP_LOCATION ;
uint32_t command[5], result[4];
----Select USB0 boot-----
- Configure Pin 1_1 as output and set to "1"
- Configure Pin 1_2 as output and set to "0"
- Configure Pin 2_8 as output and set to "1"
- Configure Pin 2_9 as output and set to "0"
command[0] = IAP_REINVOKE_ISP_CMD;
iap_entry(command, result);
With Reinvoke ISP, we start with UART0 boot when setting pin level by software (as mentioned above) but if pull-up and pull-down resistors are set to force Pin 1_1, 1_2, 2_8 and 2_9 after reinvoke ISP command I start in USB0 mode.
In our product we cannot have possibility to put this resistors.
What ccan we do to correct this problem?
Thank you.