Re: bare metal app
Posted: Mon Jun 15, 2015 11:40 pm
i hope i manage all those modifications in the lscript.ld linkerscript. can you comment on that too nils?
Code: Select all
the_ROM_image:
{
[bootloader] zynq_fsbl.elf
../project_1/project_1.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit
u-boot.elf
../project_1/project_1.sdk/app_cpu1/Debug/app_cpu1.elf
}
Code: Select all
echo "img:{[bootloader] tmp/red_pitaya_0_92.fsbl/executable.elf tmp/red_pitaya_0_92.bit tmp/u-boot.elf app_cpu1.elf}" > tmp/boot.bif
bootgen -image tmp/boot.bif -w -o i boot.bin
Code: Select all
source /opt/Xilinx/Vivado/2015.1/settings64.sh
source /opt/Xilinx/SDK/2015.1/settings64.sh
git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes
make NAME=red_pitaya_0_92 all
mkdir tmp/red_pitaya_0_92.sdk
cp tmp/red_pitaya_0_92.hwdef tmp/red_pitaya_0_92.sdk/red_pitaya_0_92.hdf
Code: Select all
sudo apt-get install libgtk2.0-0
Code: Select all
xsdk -workspace tmp/red_pitaya_0_92.sdk -hwspec tmp/red_pitaya_0_92.sdk/red_pitaya_0_92.hdf
Create the BSP for CPU1
Select File->New->Board_Support_Package
Enter the project name 'app_cpu1_bsp'
Change CPU to ps7_cortexa9_1.
Notice that Board Support Package OS defaults to standalone and the description starts with 'Modified Standalone based on ....' This description
lets you know that the modified BSP is used from the local repository that was configured.
Select Finish
In the 'Board Support Package Settings' Select Overview->standalone and change stdin and stdout to None
Select Overview->drivers->ps7_cortexa9_1 and change the extra_compiler_flags value to contain '-g -DUSE_AMP=1 -DSTDOUT_REDIR=1'
Select OK
Create the Application that will run on CPU1
Select File->New->Application_Project
Enter the project name 'app_cpu1'
Change Processor to ps7_cortexa9_1
Change 'Board Support Package' to 'Use existing' 'app_cpu1_bsp' and select Next
Select the template 'Empty Application' then select Finish.
Import the C and linkerscript file for app_cpu1 by navigating to SDK Project Explorer and right clicking on app_cpu1/src and select 'Import'
Select General->File_System then select Next
In the 'From directory', browse to and select <xapp1078_2014.4>/design/src/apps/app_cpu1
In the right window, select all .c, .h and lscript.ld then select Finish. Answer Yes to overwrite lscript.ld
Note: instead of using Import, the files could be dragged from MS Windows File Explorer to the SDK Project Explorer app_cpu1/src
directory. Select 'Copy files' when prompted and 'Yes' to overwrite lscript.ld
Then I suppose that you should try to follow the second part of the "Vivado instructions.txt"When the script finishes running it will open SDK. In the SDK workspace a hardware platform project is
created automatically.
Code: Select all
#define IRQ_PCORE_GEN_BASE XPAR_IRQ_GEN_0_BASEADDR
Code: Select all
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x2000;
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
/* Define Memories in the system */
MEMORY
{
ps7_ddr_0_S_AXI_BASEADDR : ORIGIN = 0x30000000, LENGTH = 0x10000000
ps7_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00030000
ps7_ram_1_S_AXI_BASEADDR : ORIGIN = 0xFFFF0000, LENGTH = 0x0000FE00
}
I don't think that I could help you more than what I have already. It's your turn to find a working solution and share it with usMike1010 wrote:Im not sure about those settings! Any help?