Reply
Posts: 48
Registered: ‎01-06-2017
Accepted Solution

EFM8LB12F64E bootloader bigger than 512 bytes

Hi,

 

I created my own bootloader by following the UART0 Bootloader example.

Now the bootloader has grown bigger than 512 bytes so it does not fit inside the 

code security page starting at 0xFA00 any more. What can I do?

 

Thank you,

Ron

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,173
Registered: ‎04-27-2004

Re: EFM8LB12F64E bootloader bigger than 512 bytes

[ Edited ]

What can I do? 


 

Make it smaller ?   Robot wink

 

More usefully, the BOOT area can reside in 2 pages if it has to. (USB loader is > 1 page)

Posts: 48
Registered: ‎01-06-2017

Re: EFM8LB12F64E bootloader bigger than 512 bytes

Thank you for pointing out the bootloader can reside in 2 pages. Is there a ink with documentation on how to do it? Is there an example? 

 

I changed the BL_EXTRA segment to 0xF900. The first address in the hex file is 0xF900 but it jumped immediately to 0xFA00 to start executing there. All codes are placed above 0xFA00. I don't know how to set up the linker to place code in the extra space between 0xF900 and 0xFA00.

 

Thank you,

Ron 

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,173
Registered: ‎04-27-2004

Re: EFM8LB12F64E bootloader bigger than 512 bytes


I changed the BL_EXTRA segment to 0xF900. The first address in the hex file is 0xF900 but it jumped immediately to 0xFA00 to start executing there. All codes are placed above 0xFA00. I don't know how to set up the linker to place code in the extra space between 0xF900 and 0xFA00. 


The Boot entry point will be fixed, so that complicates things a little.

In ASM this is simple use of ORG, I've not tried it in C, but if the linker is the means used, maybe try placing code at 0xF900 with the linker and offset to 0xFA00.

Or you could try in-line ASM, which I think then needs a post-compile assemble, then link.

Posts: 3,097
Registered: ‎02-07-2002

Re: EFM8LB12F64E bootloader bigger than 512 bytes

[ Edited ]

0xF900 is only half a flash sector down! Make that a full sector or you will get into trouble when the application grows into that area.

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,173
Registered: ‎04-27-2004

Re: EFM8LB12F64E bootloader bigger than 512 bytes


0xF900 is only half a flash sector down! Make that a full sector or you will get into trouble when the application grows into that area.


Good point.

 


Are you saying there is no entry in the bootloader at address 0? Then how is it supposed to get into the bootloader? Just hope the whole rest of flash is erased and thus a reset will eventually reach 0xFA00? That doesn't sound too good.


The EFM8 series parts with bootloader inbuilt, have special Boot-branch handling on the Reset vector.

ie they have the jump to 0xFA00 here managed for the user.

(as also do the Atmel parts with Bootloaders)

I presume the OP is using Bootloader-included-parts, as they are now standard, & wants to replace the boot loader with their own.

Posts: 3,097
Registered: ‎02-07-2002

Re: EFM8LB12F64E bootloader bigger than 512 bytes

[ Edited ]

Have a look in the EFM8UB2 USB bootloader to see how this is done. Esp. efm8_device.h defines how the memory is organized with BL_PAGE_COUNT the most important one.

 

Also look in the .slsproj file for the extra linker flags to link all segments.

Posts: 48
Registered: ‎01-06-2017

Re: EFM8LB12F64E bootloader bigger than 512 bytes

Yes. You are right. I have changed to F800.

 

Thank you.

Posts: 48
Registered: ‎01-06-2017

Re: EFM8LB12F64E bootloader bigger than 512 bytes

I suppose the OP is me? Robot Happy

 

Yes, the new bootloader reads the new firmware from the BLE co-processor after it has been saved there.

Posts: 48
Registered: ‎01-06-2017

Re: EFM8LB12F64E bootloader bigger than 512 bytes

Thank you. I found the project. It should help.

Posts: 3,097
Registered: ‎02-07-2002

Re: EFM8LB12F64E bootloader bigger than 512 bytes


jmg wrote:

The EFM8 series parts with bootloader inbuilt, have special Boot-branch handling on the Reset vector.

ie they have the jump to 0xFA00 here managed for the user.

(as also do the Atmel parts with Bootloaders)

I presume the OP is using Bootloader-included-parts, as they are now standard, & wants to replace the boot loader with their own.


@jmg, Sorry, I found that out as well and had deleted this part. But you were quicker in responding than I was in deleting, I guess Smiley Happy

 

@ronyip, yes, OP stands for Original Poster.

Highlighted
Posts: 48
Registered: ‎01-06-2017

Re: EFM8LB12F64E bootloader bigger than 512 bytes

@vanmierlo It seems to be working. Thank you.