AnsweredAssumed Answered

Initcode as part of the application

Question asked by Gabor.Varga on Oct 5, 2011
Latest reply on Oct 12, 2011 by Prashant

Hi,

 

I have a problem with the initcode of a BF527 processor. The processor is booting from an SPI Flash. The initcode initializes the PLL and the SDRAM.

 

There are two ways to insert an initcode into the application from the viewpoint of the elfloader.exe:

1. Creating a separate project only for the initcode. (Initcode.dxe is created)

In the application project I set the followings:

Project Options->Load->Options->Initialization file: C:\.......\Initcode.dxe (equivalent to elfloader.exe -init initcode.dxe)

This works well.

 

2. Making the initcode the part of the application. I use the same initcode function as before inserted into my application code.

Project settings:

Load->Options->Additional options: -initcall sym=_initcode at=_main

This kind of approach doesn’t work. It is compiled but it doesn’t run from the SPI Flash.

 

The initcode is written in C, it doesn’t contain function calls (only system ROM call bfrom_SysControl()).

 

Why doesn’t the 2nd variant work? Is it the startup code inserted in my application?

 

I would like the initcode to be the part of my application. I have to make changes in initcode and in my application quite often and it’s uncomfortable to work with 2 projects at a time.

 

So what is the problem with the 2nd variant?

 

Regards,

Gabor

Outcomes