Forum Discussion
How to set the SPL and the sdimage correctly with baremetal applications
Hi,
I'm working on cycloneV soc with the newest soceds 20.1 so the bsp-editor cant be used as a uboot setting.
I want to start the baremetal application from a sdcard.
SDimage:
A2: u-boot-with-spl.sfp
vfat: excution.bin
I set the uboot as cycloneVdefconfig and trying to use menuconfig to set the uboot settings.
I enable the FAT in SPL setting, set the File to load for U-boot from the filesystem to excution.bin.
In Boot options->Boot media, I enabled the support for booting from SD/EMMC option and let others go as default.
I make the uboot, which gave me two warning, the setting change the ECAM clk but the sfp was made successful.
Next I use the mkimage -A arm -T standalone -c 0x0100_0000 -e 0x0100_0040 to add the special head to the bin file.
The address 0x01000000 is the same as the Uboot setting called "Address in memory to use by default".
I made the image through make_sdimage_p3.py set the board correctly.
Here is the return:
U-Boot SPL 2022.10-24688-g541b6afcb1-dirty (Jun 14 2023 - 14:32:10 +0800)
DDRCAL: Scrubbing ECC RAM (1024 MiB).
DDRCAL: SDRAM-ECC initialized success with 579 ms
Trying to boot from MMC1
U-Boot SPL 2022.10-24688-g541b6afcb1-dirty (Jun 14 2023 - 14:32:10 +0800)
DDRCAL: Scrubbing ECC RAM (1024 MiB).
DDRCAL: SDRAM-ECC initialized success with 579 ms
Trying to boot from MMC1
U-Boot SPL 2022.10-24688-g541b6afcb1-dirty (Jun 14 2023 - 14:32:10 +0800)
DDRCAL: Scrubbing ECC RAM (1024 MiB).
DDRCAL: SDRAM-ECC initialized success with 579 ms
Trying to boot from MMC1
U-Boot SPL 2022.10-24688-g541b6afcb1-dirty (Jun 14 2023 - 14:32:10 +0800)
DDRCAL: Scrubbing ECC RAM (1024 MiB).
DDRCAL: SDRAM-ECC initialized success with 578 ms
Trying to boot from MMC1
The spl didnt start the uboot or the bin file.
Now I dont know how to fix that problem,
whats the correct set for the Uboot?
what's the correct -a and -e address?
Looking forward to your kindly help,please
Reguards.
25 Replies
- tehjingy_Altera
Regular Contributor
Hi Alex
Could you share a snippet of your code of how you printf?
Here is a line from the example which
printf("RESULT: Example completed successfully.\n");
For the QSPI you could reuse the binary file that you created that combine the SPL and your application binary.
You will need to flash the binary at the QSPI flash address 0, remember to swtich the BSEL to boot from QSPI.
Regards
Jingyang, Teh
- CAlex
Contributor
Hi,
that's how I did for printf , and debug shows it worked well.
About QSPI, could you please tell me how to "flash the binary at the QSPI flash address 0" ?
Does that mean I need to use mkimage to set the -a and -e to 0x0? and that's it?
Thanks.
Reguards.
- tehjingy_Altera
Regular Contributor
Hi
For the printf did you include the <stdio.h> header or the <alt_printf.h> header? Could you use the alt_printf.h one.
You do not need to mkimage it, you just flash the binary into the qspi using the command:
quartus_hps -c 1 -o pv -a 0x000000 <<application.binary>>
Regards
Jingyang, Teh
- CAlex
Contributor
Hi,
I didn't use the alt_printf.h for there will be some mutliple include issues.
I've read the alt_printf.h and found out for cycloneVsoc ALT_PRINTF() is the same as printf.
"quartus_hps -c 1 -o pv -a 0x000000 <<application.binary>>" for this order, where should I use it?
SPL or debug console? Or other places?
Reguards.
- tehjingy_Altera
Regular Contributor
Hi Alex
You use this command to flash the binary that you created into the QSPI Flash of the board.
This command is to be run in your development PC with the nios2_command_shell.sh resources.
You can refer to the steps to flash the QSPI here:
- tehjingy_Altera
Regular Contributor
Hi Alex
Any update on this case?
Regards
Jingyang, Teh
- tehjingy_Altera
Regular Contributor
Hi
Since there are no feedback for this thread, I shall set this thread to close pending. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.
If you happened to close this thread you might receive a survey. If you think you would rank your support experience less than 10 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.
Regards
Jingyang, Teh