Forum Discussion
Hello,
BSEL switch is absent so the setting is the default one by Terrasic.
Hi,
Can you load the preloader first to make sure the SDRAM has been calibrated successfully? Only then you are to create and apply the scatter file, since the SDRAM has been brought up from preloader.
Replying back to your first posts, can you direct me to the TR-manual which demonstrate the scatter file that you mentioned?
This is the link to locate the bare metal application in the SDRAM by creating a new scatter file, is this the examples you tried to follow?:
https://www.intel.com/content/www/us/en/programmable/documentation/lro1424280108409.html#lro1424311442722
- AJama47 years ago
Occasional Contributor
Hi,
The scatter file was being written by me after reading the default SDRAM base address (starting) and ending address in MPU address space. I am first loading the preloader and then trying to run the bare-metal.
I have already followed the aforementioned example and its not working.
After, making some changes, now my preloader works fine without error; but still the bare.metal program doesn't load from the SDRAM.
Here is the output in the terminal (for preloader):
U-Boot SPL 2013.01.01 (Aug 27 2019 - 08:37:10)
BOARD : Altera SOCFPGA Cyclone V Board
CLOCK: EOSC1 clock 25000 KHz
CLOCK: EOSC2 clock 25000 KHz
CLOCK: F2S_SDR_REF clock 0 KHz
CLOCK: F2S_PER_REF clock 0 KHz
CLOCK: MPU clock 925 MHz
CLOCK: DDR clock 400 MHz
CLOCK: UART clock 100000 KHz
CLOCK: MMC clock 50000 KHz
CLOCK: QSPI clock 370000 KHz
RESET: COLD
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
SDRAM: 1024 MiB
SDRAM: Ensuring specified SDRAM size is correct ...passed
SDRAM: Running EMIF Diagnostic Test ...Passed
- AJama47 years ago
Occasional Contributor
Have you tested the example you mentioned on any De1-SoC Board?
- EBERLAZARE_I_Intel7 years ago
Regular Contributor
Hi,
I did the example a month ago, followed all the steps and able to see the entry points stops at the point of the scatter file which was 0x02000000,
Can you edit you scatter file to this:
SDRAM 0x02000000 0x02000000 ;
{
APP_CODE + 0
{
* (+ RO , + RW , + ZI )
}
ARM_LIB_STACKHEAP 0x03000000 EMPTY 0x0x01000000 ; Application heap and stack
{ }
}
- AJama47 years ago
Occasional Contributor
Hi,
I have run the Hello World program (compiled through ARM Compiler 5) with a debugger script as well as through first running the preloader by importing it and then running bare-metal program, in both cases it doesn't work.
Here is the output in Commands tab when I run the preloader in DS5;
______________________________________________________________________________________________________________
Connected to running target Altera - Cyclone V SoC (Single Core) on TCP:localhost
Stopping running target Altera - Cyclone V SoC (Single Core) on TCP:localhost on connection
Execution stopped in SVC mode at S:0x00002FA8
S:0x00002FA8 TST r1,#4
cd "C:\Users\stable\Documents\DS-5 Workspace"
Working directory "C:\Users\stable\Documents\DS-5 Workspace"
Execution stopped in SVC mode at S:0x00002FA8
S:0x00002FA8 TST r1,#4
source /v "C:\altera\16.0\embedded\ds-5\sw\debugger\configdb\Scripts\altera_target_check.py"
No SYSID registers could be found. Has a peripheral description file been supplied?
Loaded section .text: S:0xFFFF0000 ~ S:0xFFFF7D4B (size 0x7D4C)
Loaded section .rodata: S:0xFFFF7D4C ~ S:0xFFFFA104 (size 0x23B9)
Loaded section .data: S:0xFFFFA108 ~ S:0xFFFFAFDB (size 0xED4)
Entry point S:0xFFFF0000
set debug-from *$ENTRYPOINT
start
Starting target with no symbolic information loaded
wait
Execution stopped in SVC mode at S:0xFFFF0000
S:0xFFFF0000 B {pc}+0x70 ; 0xffff0070
Run
Starting target with no symbolic information loaded
Pause 1s
Interrupt
Quit
Execution stopped in UND mode at S:0xFFFF0004
S:0xFFFF0004 LDR pc,[pc,#20] ; [0xFFFF0020] = 0xFFFF0020
Disconnected from stopped target Altera - Cyclone V SoC (Single Core) on TCP:localhost
______________________________________________________________________________________________________________
And here is the output when I run bare-metal program;
______________________________________________________________________________________________________________
Connected to stopped target Altera - Cyclone V SoC (Dual Core) on TCP:localhost
cd "C:\Users\stable\Documents\DS-5 Workspace"
Working directory "C:\Users\stable\Documents\DS-5 Workspace"
Execution stopped in UND mode at S:0xFFFF0004
S:0xFFFF0004 LDR pc,[pc,#20] ; [0xFFFF0020] = 0xFFFF0020
source /v "C:\altera\16.0\embedded\ds-5\sw\debugger\configdb\Scripts\altera_target_check.py"
No SYSID registers could be found. Has a peripheral description file been supplied?
loadfile "C:\Users\stable\Documents\DS-5 Workspace\HelloWorldARM\Debug\HelloWorldARM.axf"
ERROR(CMD16-TAD11-NAL22):
! Failed to load "HelloWorldARM.axf"
! Failed to write 3,132 bytes to address S:0x02000000
! General error on memory or register access.
set debug-from main
start
WARNING(CMD399-COR168):
! Failed to start the target
! No function named "main" could be found
WARNING(CMD407): Trying the entry point instead
ERROR(CMD426): Cannot find symbol to start or entrypoint, the file or load commands may be used to set the entrypoint
wait
Target Message: Could not determine target state
Target Message: Could not determine target state
- AJama47 years ago
Occasional Contributor
I should mention that using the same preloader, I am able to run the program compiled through Altera Bare-metal GCC toolchain from SDRAM using the cycloneV-dk-oc-ram-hosted.ld script.
- EBERLAZARE_I_Intel7 years ago
Regular Contributor
Hi,
Seems that the SDRAM calibration is successful.
Was there any error when loading the bare metal application? Is the bare metal program a "Hello World" as in the example or your own?
Can you share the log when loading the bare metal application?