Content originally posted in LPCWare by CodeRedSupport on Mon Aug 23 01:28:59 MST 2010
Quote: bmentink
Tell me, why does this port of the NXP secondary bootloader take up 64K !!,
the original only took two sectors (8K) ..
Using 64K makes it worthless for the smaller parts ..
The code for the RDB1768 usb secondary bootloader does not actually consume all of the first 64KB of the LPC1768 flash. It ought to be possible to fit the bootloader code into 8KB or so - particularly if the LCD related code and data were removed. However there were a number of reasons why the "flash drive" does start at 64KB. In particular....
[LIST]
[*]The project that the secondary bootloader spun out of from was actually a much more complex system, and this did actually consume ~60KB of the flash for its code. When the bootloader was developed, the same "flash drive" settings were used as the more complex system - as the target was the RDB1768 board, we did not actually consider LPC17xx parts with smaller amounts of flash.
[/LIST]
[LIST]
[*]The LPC17xx family has multi-sized flash sectors. Below 64KB, the flash has a 4KB sector size, from 64KB upwards the flash sectors are 32KB in size. However when treating the flash as a FAT flash drive, a fixed sector size has to be chosen. Having a drive sector size that is smaller than the actual sector size of the flash can cause problems, particularly if you want the flash drive to act as a real flash drive that can have multiple files written and deleted. Thus because of the requirements we had for some internal work, we chose to treat the drive sector size as 32KB, and thus to start it at 64KB in the flash, as that was where the flash sector sizes switched to 32KB in size.
[/LIST]
Note, that it should be fairly straghtforward to convert the RDB1768 bootloader to a smaller LPC17xx part by using the flash from, say, 16KB to 64KB as your "flash drive", and reducing the drive sector size to 4KB.
Regards,
CodeRedSupport