Content originally posted in LPCWare by renan on Thu Jun 10 13:56:46 MST 2010 I'm modifying the USB bootloader for the LPC1768 / RDB1768. I need to write to a specifc area of the flash depending on what the file is.
There are, for now 3 areas in my flash: 1. bootloader 2. interpreter 3. user data (starts at 0x40000)
So, if the file I'm writing is a interpreter, the bootloader should erase only the interpreter area, if it is user data, the user data area should be erased only. The example defines the area after the bootloader until the end of the flash. Until now, I have been able to write to any area, defining what kind of file I was going to copy before start debugging the bootloader. I have created a function that reads the file that is being copied and can decide what kind it is. I tried to change it in the beginning of this function:
int BlockDevWrite (U32 dwAddress, U8 * pbBuf)
in the file blockdev_flash.c
If I try to write a "user data" (0x40000), and change the user_start_sector to 21 in that function, my data is going to be at 0x50000.
So where should I change the definition USER_START_SECTOR to avoid this from happening?