UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer bugra_bakirel
Observer
8,434 Views
Registered: ‎05-14-2013

Invoking bootloader again

Jump to solution

Hello everyone,

 

I have written an application which opens a tcp socket and buffering incoming .srec file and write it to the flash memory with ML507 Development board using xilkernel on PPC440. After terminating my project and running srec bootloader project, the application that I had written into the flash memory, successfully runs.

 

I want to implement this automatically. I mean, after I write .srec file into the flash memory I want to invoke bootloader again.

 

I have an hardware platform that calls bootloader on power on and opens application in the flash memory. I want to add a feature to this application that after writing another application (.srec file) to the flash memory, invoke bootloader again and run a different application.

 

Hard-reset will invoke bootloader again but I don't want to configure the hardware again. I just want to use same hardware and run different application. How can I manage this?

 

Thanks,

Bugra

 

Note: I do not know the exact sequence but FPGA configuration file (.bit) has bootloader project  inside and on the power on it runs bootloader in BRAM. This bootloader project takes application from PPC440's flash and open it to PPC440's ram.

0 Kudos
1 Solution

Accepted Solutions
Observer bugra_bakirel
Observer
11,736 Views
Registered: ‎05-14-2013

Re: Invoking bootloader again

Jump to solution

Hi,

 

Actually "myApp" should work on the ddr therefore I did not specify to execute on BRAM in the linker.

 

But good news that I found the solution. In the Embedded System Reference Manual (known as est_rm.pdf), I found an paragraph that how can I run bootloader again for powerpc proccessors.

 

I paste the exact paragraph from manual. (page 133,UG111 (v14.6) June 19, 2013)

 

Modifying Startup Files for Bootstrapping an Application


If your application is going to be loaded from a bootloader, you might not want to
overwrite the processor reset vector of the bootloader with that of your application. This
re-executes the bootloader on a processor reset instead of your application. To achieve this,
your application must not bring in boot.o as a startup file. Unlike other compiler startup
files, boot.o is not explicitly linked in by the compiler. Instead, the default linker scripts
and the tools for generating the linker scripts specify boot.o as a startup file. You must
remove the STARTUP directive in such linker scripts. You must also modify the ENTRY
directive to be _start instead of _boot.

 

I followed the directives and jump to the boot address of the processor and finally instead of "myApp" bootloader is invoked. (Before these directives, when I jumped to boot address  myApp was restarted.)

Thanks,

Bugra

0 Kudos
9 Replies
Xilinx Employee
Xilinx Employee
8,419 Views
Registered: ‎08-02-2007

Re: Invoking bootloader again

Jump to solution

Hi,

 

Did you refer to the program flash utility as documented here?

 

If you would want to convert the download.bit to bin/mcs refer to http://www.xilinx.com/support/answers/47911.htm

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Observer bugra_bakirel
Observer
8,195 Views
Registered: ‎05-14-2013

Re: Invoking bootloader again

Jump to solution

Hi Hem,

 

Sorry for the late reply. I examine the post you share with me and I think that is not a case for me.

First of all, my application should run on the ddr where I need to create large buffers using bufmalloc.

Here is my sequence;

  - In block ram I have a simple srec bootlader project. that checks the flash base address (without offset) and  decode the srec file and jumps to the ddr.

  - In my application, I made lot of things and if I get a command through the ethernet, I buffered the incomming file and write it to the flash.

  - After write finished and verified with read, I jumped to boot address in the linker script ( which is 0xFFFFFFFC for my ML507 application) with an funtion pointer like in the bootlader as follows;

 

   void (*jump)();

   jump = (void(*)())(0xFFFFFFFC);

   (*jump)();

 

  - This kind of jump starts the bootlader project again (which should read flash and execute) but bootloader open the application which was earlier written to flash, not the latest written application. ( I mean restarts the current application)

 

  - But if stop the processor using SDK by running bootloader project again ( I mean by terminating the last launch), at this time bootloader project loads my newly written project. This means I successfully write the flash but bootloader cannot boot this application with jump?

 

What can cause this situation? Is there any solution to resetting the powerpc proccessor from code?

 

Thanks,

Buğra

0 Kudos
Explorer
Explorer
8,182 Views
Registered: ‎11-24-2013

Re: Invoking bootloader again

Jump to solution

@bugra_bakirel wrote:

I have an hardware platform that calls bootloader on power on and opens application in the flash memory. I want to add a feature to this application that after writing another application (.srec file) to the flash memory, invoke bootloader again and run a different application.

 


Do you mean you exported the project to ISE? How did you do this hardware?

 

Regards,

Ignacio.

Tags (6)
0 Kudos
Observer bugra_bakirel
Observer
8,154 Views
Registered: ‎05-14-2013

Re: Invoking bootloader again

Jump to solution

Hi,

 

In the ISE, embedded processor file is added and bootloader.elf file is added as a source to this embedded processor block. Hope this is useful.

 

Buğra

0 Kudos
Highlighted
Explorer
Explorer
8,147 Views
Registered: ‎11-24-2013

Re: Invoking bootloader again

Jump to solution

Hello,

 

if I understood well what you want to do is to write the flash with another project and then not having to program the board again with all the hardware and the bootloader. If this is the case, then what you have to do is:

 

  • Add the embedded processor to the project in ISE. (You already did this).
  • Add the .elf as its source. (You already did this).
  • Generate the .bit with ISE.
  • Open an iMPACT project and create a PROM File (you can choose this on the left. in "iMPACT FLows". You must follow the steps and choose the .bit that you previously generated with ISE (with the bootloader .elf). You will create a .mcs file.
  • Program your PROM with this .mcs and configure the board to boot from the PROOM.
  • Program your PROM in SDK, but instead of 0, you will have to put an offset for the beginning: use the last position that iMPACT used + a security space.

If you do this, every time you put a new program in the PROM you just have to reset the board, and the bootloader will execute this new program.

 

Here you have an example for another board that can help you with these steps:

 

http://www.xilinx.com/support/answers/43615.htm

 

Regards,

Ignacio.

0 Kudos
Observer bugra_bakirel
Observer
8,139 Views
Registered: ‎05-14-2013

Re: Invoking bootloader again

Jump to solution

Hi again,

 

You got it right and I did exactly what you said. But what I want to manage is, without resetting the board writing another application to the flash(with an application in SDK and I managed this also) and run it just invoking bootloader again with a jump in the application. (when I reset the board my newly written project into flash works well.) In my application here is the sequence;

-I buffered the .elf.srec file and write it to the flash, ( lets call it myApp)

-After that I jump to the boot address of the processor (0xFFFFFFFC in my case) with a function pointer,

- I expect of running bootloader project but what I get is restarting of myApp.

 

Hope I can tell clearly, thanks for your help.

Bugra

 

0 Kudos
Explorer
Explorer
8,128 Views
Registered: ‎11-24-2013

Re: Invoking bootloader again

Jump to solution

In the linker file of "myApp", do you specify to execute that app from the BRAM?

 

Regards,

Ignacio.

0 Kudos
Observer bugra_bakirel
Observer
11,737 Views
Registered: ‎05-14-2013

Re: Invoking bootloader again

Jump to solution

Hi,

 

Actually "myApp" should work on the ddr therefore I did not specify to execute on BRAM in the linker.

 

But good news that I found the solution. In the Embedded System Reference Manual (known as est_rm.pdf), I found an paragraph that how can I run bootloader again for powerpc proccessors.

 

I paste the exact paragraph from manual. (page 133,UG111 (v14.6) June 19, 2013)

 

Modifying Startup Files for Bootstrapping an Application


If your application is going to be loaded from a bootloader, you might not want to
overwrite the processor reset vector of the bootloader with that of your application. This
re-executes the bootloader on a processor reset instead of your application. To achieve this,
your application must not bring in boot.o as a startup file. Unlike other compiler startup
files, boot.o is not explicitly linked in by the compiler. Instead, the default linker scripts
and the tools for generating the linker scripts specify boot.o as a startup file. You must
remove the STARTUP directive in such linker scripts. You must also modify the ENTRY
directive to be _start instead of _boot.

 

I followed the directives and jump to the boot address of the processor and finally instead of "myApp" bootloader is invoked. (Before these directives, when I jumped to boot address  myApp was restarted.)

Thanks,

Bugra

0 Kudos
Visitor laosanfeng
Visitor
6,620 Views
Registered: ‎03-28-2015

can you give a bootloader.c file for ML507

Jump to solution

hello,friends

       I need a SPI flash bootloader for ML507 board.  In the last week, I got a bootloader.c file from internet, and I succeeded in a board with spartan 6 chip, the file is just  the attachment file. But when I used it to ML507, it failed. In the board , the spi flash is  W25P32. When I debugged the project in SDK , I found in the step "XIsf_Initialize(&Isf, &Spi, ISF_SPI_SELECT, IsfWriteBuffer); the XIsf can not get the information about the flash. I do not know the reason . I will be very grateful if anyone can give me a bootloader for ML507! Thanks a lot.

0 Kudos