Puzzle on the 4MB Modules

How do I configure the 4MB modules?

  1. I changed the customize.ldr to say:

#define FLASH_SIZE 4M

Do I also need to change MAX_CODE_SIZE?

  1. I changed the bootldr.dat to have
    MaxFileSize 0x100000

But I seem to get write errors when I go past sector 21.

-Erik

Well, it seems to work, but is it Kosher?

You will have to change two things:

customize.ldr - Contains the definitions for start and size for FLASH, RAM, NVRAM, File System, etc…
(change FLASH_SIZE)

bootldr.dat - Contains all the definitions for the image generation during compile/link
(change MaxFileSize to a bigger value, because now your
system can support a bigger size)

Always recompile BSP and application every time you change those files.

I hope this helps, PC

What about BLBOOTLDR.DAT? The BSP Porting Guide states “…You must set the ramAddress in the bootldr.dat to the value of BOOTLOADER_CODE_START in the customize.ldr file…” However, since the RAM portion of the bootloader itself is going to be decompressed at the location specified by ramAddress in BLBOOTLDR.DAT (not BOOTLDR.DAT) shouldn’t this be the one to be modified?

Am I wrong, but it seems that if one doesn’t modify ramAddress in BLBOOTLDR.DAT (its default value is 0x00204000), I suspect that when the application is being decompressed to RAM that once it exceeds the 2M mark that it will start overwriting the RAM portion of the bootloader… (?)

Thanks,
Darrin

The BLBOOTLDR.DAT refers to the bootloader image.
The BOOTLDR.DAT refers to the application image.

So, in my opinion, you should not change the BLBOOTLDR.DAT
but only the BOOTLDR.DAT.

Actually, we’ve confirmed that if your application image exceeds 2M in size uncompressed, that if you don’t modify BLBOOTLDR.DAT to move the RAM portion of the bootloader (and download ROM.BIN, of course) that it will indeed crash. Otherwise, the application decompression code will overwrite itself when it hits that mark.

I’m surprised there is no documentation regarding BLBOOTLDR.DAT anywhere!

For the WiME these are the settings:
blbbootldr.dat
WriteToFlash Yes
Compressed Yes
ExecuteFromRom No
flashOffset 0x0
ramAddress 0x204000

bootldr.dat
WriteToFlash Yes
Compressed Yes
ExecuteFromRom No
flashOffset 0x10000
ramAddress 0x8004000
MaxFileSize 0x200000

Dredging up an old topic…

Using 7.4.2, my app exceeds 2M, so I adjusted MAX_CODE_SIZE to 2M + 256K and now I compile.

What changes need to be made in BLBOOTLDR.DAT and BOOTLDR.DAT to correspond to this change?

Just go through and change any flash reference to 4M to 2M. Remember that the RAM is 8M and don’t touch that.

IE, if you see 0x2XXXXXXX, change it to 0x1XXXXXXX.

-Erik

That seems counter-intuitive. My app takes more room, so I redefine things to be smaller?

You also need to increase the ramAddress value in blbootldr.dat to match how much you’ve increased your MAX_CODE_SIZE, otherwise you run the risk of your bootloader overwriting itself in RAM when it attempts to load the application image into RAM

Except that they were Decreasing MAX_CODE_SIZE.

I’m still confused. I think I’ll try to figure out how to get my code back under 2M and avoid this entirely if I can.

I’m not sure why this isn’t handled automatically in the first place. Setting MAX_CODE_SIZE should be sufficient, all the others should adjust accordingly, in a perfect world. In an even more perfect world, you wouldn’t even have to set MAX_CODE_SIZE.

I see now why my project was going over 2M. Simply create a new NET+OS project for the ME, select HTTP server and HTTPS server (which will automatically include SSL) and try to compile and it will fail. Removing HTTPS and the project compiles.

So to allow a 3M app instead of 2M, are the following changes correct and sufficient?

In customize.ldr:

Change:
#define MAX_CODE_SIZE 2M

To:
#define MAX_CODE_SIZE 3M

In blbootldr.dat:

Change:
ramAddress 0x204000

To:
ramAddress 0x304000

In bootldr.dat:

No Changes