Forum Discussion
Questions About GSFI, QSPI Flash XIP Boot, and HAL API Support
Hi watanabe
watanabe wrote:However, the OCRAM capacity is only 165 KB, so there is not enough space to store both the bootloader (approximately 100 KB) and the application (approximately 100 KB) in OCRAM at the same time. Therefore, using a boot copier to load the boot software from the QSPI flash into OCRAM also seems difficult due to the limited OCRAM capacity.
If you apply the Bootloader via GSFI approach, it will XIP boot the bootloader (inside the GSFI) first, then bootloader will copy the application into OCRAM, and jump to the OCRAM.
As such, only 100KB application is present in the OCRAM as .text section.
(Not 100KM + 100KB = 200 KB for both bootloader & application)
watanabe wrote:1. Why has the boot software size increased so much when migrating from Nios II to Nios V?
It is migrating from Nios II ISA to RISC-V ISA. Thus, the compiler is different (from Altera proprietary Nios II ISA to standardized RISC-V ISA), which leads to different ELF size.
After adding the compiler optimization, did you use CMAKE_BUILD_TYPE=Release when running cmake?
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -B software/app/debug -S software/app
make -C software/app/debug
watanabe wrote:2. Is there any way to test the boot process with my current development kit?
- With the need to access flash after booting, that prevents XIP approach.
- With ELF size > OCRAM size, that prevents bootcopier (Bootloader via GSFI) approach.
The only way is to pursue the bootcopier approach.
Perhaps the following might still be possible to continue with bootcopier.
- Have an EMIF to replace the small OCRAM,
- "100KB Bootloader via GSFI is XIP booted" earlier is valid for your use case
- Ensure that CMAKE_BUILD_TYPE=Release is present to enforce the compiler optimizations
Regards,
Liang Yu