breakpoint not entering

void WriteToFlashSST26VF064B(uint32_t u_n32Address)//write function using page program upto 255 bytes at a time
{
char cName[512]={0};
char cNew[256]={0};
char cCommand[4];
char cNewStorageBuffer[1000]={0};;
int nTemp1=0;
int nF=0;
int nNewBuffer=0;
int nData=0;
int nPageBuffer=4;
int nStorageBuffer=0;
for(int nTemp=0;nTemp<256;nTemp++)
{
cName[nTemp]='a';
}

WriteUnprotect();
WriteEnable();
ChipEnable(); //chip goes low

while(u_n32Address % 256 != 0)
{
nTemp1=nData;
cCommand[0]= WRITECOMMAND;
cCommand[1] = (u_n32Address >>16) ;
cCommand[2] = (u_n32Address >>8) ;
cCommand[3] = (u_n32Address>0);

for(int nTemp2=0;nTemp2<4;nTemp2++)
{
cNew[nTemp2]=cCommand[nTemp2];
}

nStorageBuffer=nTemp1;
while(nNewBuffer<256)
{
cNew[nPageBuffer]=cName[nStorageBuffer];
cNewStorageBuffer[nNewBuffer]=cNew[nPageBuffer];
nPageBuffer++;
nStorageBuffer++;

}
nTemp1=nStorageBuffer+1;

}
u_n32Address=u_n32Address+1;
// memcpy(&command[4],name,sizeof(name));
tx_thread_sleep(1);

err_t1 = g_spi1.p_api->write(g_spi1.p_ctrl,cNewStorageBuffer,256,SPI_BIT_WIDTH_8_BITS);
if(err_t1==1)
{
while(1);
}
tx_thread_sleep(1);


ChipDisable();
WriteProtect();
}

 

 

 

This is the code which i wrote for a flash memory using SPI when i tried to debug and get into this function,its not working properly .Please help