cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tamaraist
Visitor
Visitor
12,763 Views
Registered: ‎02-26-2008

Executing MicroBlaze code from the NOR-Flash on Spartan 3e

hi,
I want compile my project and execute from NOR-flash directly. I dont want copy code from flash to DDR-Ram and execute from DDR-Ram. Thats why i dont need any bootloader.

I think i need startup code for initialize somethings. I guess crt0.O will done well and need Nor-Flash memory initialize for execute code.

My scenario is this: When power on the board, FPGA will take configuration from Platform Flash (XC04f). And jump to startup program on Block Ram. When it finished startup code, it jump to NOR-Flash and execute code from there.

Is it possible? if yes, how can i do this?

Regards,
Murat
0 Kudos
Reply
8 Replies
barriet
Xilinx Employee
Xilinx Employee
12,752 Views
Registered: ‎08-13-2007

Murat,
 
You may find this helpful:
http://www.xilinx.com/support/answers/23748.htm (9.2i EDK - How can I execute MicroBlaze code directly from flash?)
I haven't personally done this yet so I can't be of more help here than pointing you to that resource.
 
Cheers,
bt
 
== edit
I should have mentioned XAPP983 as well

 


Message Edited by timpe on 03-06-2008 09:31 AM
0 Kudos
Reply
tamaraist
Visitor
Visitor
12,741 Views
Registered: ‎02-26-2008

Thanks for helpful documents and link. I read all of them especially  AR#23748 answer  (9.2i EDK - How can I execute MicroBlaze code directly from flash?)

And i did what it said step by step. The step 1 is say
     "1. Using "Generate Linker Script," assign read-only sections of the software project to the flash memory and all other sections to block RAM."

This is what i did in the General Linker Script:
    .text       FLASH_16Mx8_C_MEMO_BASEADDR
    .rodata   FLASH_16Mx8_C_MEMO_BASEADDR
    .sdata2   FLASH_16Mx8_C_MEMO_BASEADDR
    .sbss2   FLASH_16Mx8_C_MEMO_BASEADDR
    .data      imb_cntrl_dlmb_cntrl
    .sdata   imb_cntrl_dlmb_cntrl
    .sbss    imb_cntrl_dlmb_cntrl
    .bss      imb_cntrl_dlmb_cntrl

and i follow all steps carefully. Finally i created flash.bin file. But there is something wrong becouse flash.bin file size is 1GB.

if i make all segment "imb_cntrl_dlmb_cntrl" then flash.bin size is acceptable. But it doesn't work from flash.

I am using EDK 9.1 and my board is SPARTAN-3E Starter Kit.

Do you have any idea why flash.bin size is huge or what's happend?
Thanks for your help.

Regard
Murat

0 Kudos
Reply
barriet
Xilinx Employee
Xilinx Employee
12,739 Views
Registered: ‎08-13-2007

Sorry I can't be of more help here.
 
I would open a webcase (http://www.xilinx.com/support/clearexpress/websupport.htm) on this issue so the appropriate people can weigh in.
 
Good luck.
 
bt
0 Kudos
Reply
goran
Xilinx Employee
Xilinx Employee
12,716 Views
Registered: ‎08-06-2007

Hi,
 
The reason why you have a 1Gbyte .bin file is that the bin format can't have address holes.
You have placed the flash memory high up in the address map and the bin file will contain all addresses between LMB and the flash.
Just map the flash interface much closer to LMB in the address map and the .bin file size will be drastically reduced.
 
Göran
0 Kudos
Reply
goran
Xilinx Employee
Xilinx Employee
12,715 Views
Registered: ‎08-06-2007

Hi,
 
Another approach is to create two .bin files from the .elf file
You have option for the mb-objcopy to just get the information for the flash interface.
 
Göran Bilski
0 Kudos
Reply
tamaraist
Visitor
Visitor
12,710 Views
Registered: ‎02-26-2008

Hi Göran,

1) How can i map the flash interface much closer to LMB in the address map?
Should i change FLASH_BASE address? is this address deticated for SPARTAN-3E board?

FLASH_16Mx8 Base Address  : 0x4300_0000 and Program at Offset is 0x0010_0000
ILMB_CNTRL Base Address    : 0x0000_0000

2)  This is my shell-script :

# Create binary image for FLASH mapped sections for download by Flash Writer
mb-objcopy -O binary \
-j .text \
-j .init \
-j .fini \
-j .rodata \
-j .sbss2 \
-j .vectors.reset \
-j .vectors.sw_exception \
-j .vectors.interrupt \
-j .vectors.hw_exception \
./TestApp_Memory/executable.elf ./TestApp_Memory/flash.bin
echo "Stage 2...Done!"

What you mean  "option for the mb-objcopy to just get the information for the flash interface"?

Regards
Murat
0 Kudos
Reply
goran
Xilinx Employee
Xilinx Employee
12,703 Views
Registered: ‎08-06-2007

Hi,
 
Yes, you can lower the address of the flash controller.
or
remove all the sections in your mb-objdump command that is not placed in the flash memory.
 
Göran Bilski
0 Kudos
Reply
joshi_prashant
Observer
Observer
11,780 Views
Registered: ‎04-09-2008

Hi Murat,

 

Are you able to successfully able to do the required task of executing Microblaze code from the NOR flash??

 

I have the same application,In fact my FPGA boots from same NOR flash.

 

Could I request you to send some reference document which you might have prepared??

 

Thanks

Prashant

Message Edited by joshi_prashant on 05-22-2008 10:28 PM
0 Kudos
Reply