BIG problem using FLASH_Write_Word on an STM32L151RDT6.
This code works correctly (I can see AABBCCDD at all adresses)
Code: Select all
#pragma orgall 0x200
//------------------------------------------------------------------------------
void FLASH_EraseWritePage(unsigned long address)
{
char x1,y1=0;
unsigned int x2=0,y2;
unsigned long dataToWrite,x4,y4,z4;
Flash_Unlock();
FLASH_ErasePage(address);
for(x2=0;x2<0x800;x2=x2+4)
{
FLASH_Write_Word(x2+address, 0xAABBCCDD);
p_WDC=~p_WDC;
}
Flash_Lock();
}
void main()
{
InitSetUp();
FLASH_EraseWritePage([b][u]0x3000[/u][/b])
}
In the following code , I can see it write only 255 bytes at destination address
Code: Select all
#pragma orgall 0x2A000
//------------------------------------------------------------------------------
void FLASH_EraseWritePage(unsigned long address)
{
char x1,y1=0;
unsigned int x2=0,y2;
unsigned long dataToWrite,x4,y4,z4;
Flash_Unlock();
FLASH_ErasePage(address);
for(x2=0;x2<0x800;x2=x2+4)
{
FLASH_Write_Word(x2+address, 0xAABBCCDD);
p_WDC=~p_WDC;
}
Flash_Lock();
}
void main()
{
InitSetUp();
FLASH_EraseWritePage(0x800)
}