Other Parts Discussed in Thread: C2000WARE
Hi
I am trying to use the flashapi_ex2_sci_kernel to flash bank 0 via the sci interface.
I have built a simple application that runs from flash bank 0 and works when I download the code via XDS110 debug probe and the code successfully runs from flash when I power up the chip.
On configuring the boot pins so that the unit boots from SCI (boot 0 = 1 boot 1 = 0 ) I can successfully download the kernel via the SCI interface and gain autobaud lock with it. I can send down the first 22 bytes from my simple app and receive a checksum from the kernel which is correct.
However when I send down my first block it hits the following infinite while loop in flashapi_ex2_ldfu.c @ line 685
#ifdef BANK0
//
// Check if the destination address is less than B1_RESERVED
//
if(BlockHeader.DestAddr < (uint32_t)B1_RESERVED)
{
//
// Loop Forever. In the terminal of the Serial Flash Programmer,
// new bytes will stop showing
//
while(1){}; ///Line 685 *******
}
#endif
//
// For the BANK1 configuration, the destination address cannot be less
// than B0_RESERVED. This is to prevent overwriting of the flash kernel
//
#ifdef BANK1
//
// Check if the destination address is less than B0_RESERVED
//
if(BlockHeader.DestAddr < (uint32_t)B0_RESERVED)
{
//
// Loop Forever. In the terminal of the Serial Flash Programmer,
// new bytes will stop showing
//
while(1){}; ///Line 705 *******
}
#endif
My destination address (0x81628) is definitely less than B1_RESERVED (0x92008) as it is in bank 0. In fact all destination addresses will be less than this as 0x92008 is the top address of Bank 1 !!
If I change the kernel to be configured as Bank 1 I hit the second infinite while loop at line 705 because my destination address is less than B0_RESERVED (0x82008 ) because I am trying to program bank 0 which sits at 0x81000 to 0x82007 and my destination address is within this boundary.
I am some what confused by how I get this to work. Can anyone shed some light on how I build the flash kernel so that it will except my hex2000 file for code that runs from bank 0 ??
Kind regards
Phil Webb