Forum Discussion
SDRAM NIOSV ash-riscv-gdb-server error
- 5 months ago
Hi ETang2
You could solve this error b increasing the OCRAM size in the Quartus project.
Once you do this you would need to regenerate the BSP again.
Hi
Would like to confirm with you are you trying out the boot method of OCRAM?
From the view of your objdump, it seems like you did not select the OCRAM for all the fields in the linker in the BSP Editor.
If you are selecting the OCRAM boot method, which boot method are you trying out?
Regards
tehjingy
Hi, i confirm i'm trying to boot from OCRAM. I did the modification indicated and now i obtain a compilation error :
[proc] Exécution de la commande : C:\altera_standard\25.1std\riscfree\build_tools\cmake\bin\cmake.exe --version
[proc] Exécution de la commande : C:\altera_standard\25.1std\riscfree\build_tools\cmake\bin\cmake.exe -E capabilities
[kit] Chargement réussi de 2 kits à partir de C:\Users\tanguy-e\AppData\Local\CMakeTools\cmake-tools-kits.json
[variant] Chargement effectué du nouvel ensemble de variantes
[main] Configuration du projet : app
[proc] Exécution de la commande : C:\altera_standard\25.1std\riscfree\build_tools\cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=C:\altera_standard\25.1std\riscfree\toolchain\riscv32-unknown-elf\bin\riscv32-unknown-elf-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\altera_standard\25.1std\riscfree\toolchain\riscv32-unknown-elf\bin\riscv32-unknown-elf-g++.exe -DCMAKE_ASM_COMPILER:FILEPATH=C:\altera_standard\25.1std\riscfree\toolchain\riscv32-unknown-elf\bin\riscv32-unknown-elf-gcc.exe --no-warn-unused-cli -S C:/Users/tanguy-e/Downloads/test/software/app -B c:/Users/tanguy-e/Downloads/test/software/app/build -G "Unix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is GNU 13.2.0
[cmake] -- The CXX compiler identification is GNU 13.2.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/altera_standard/25.1std/riscfree/toolchain/riscv32-unknown-elf/bin/riscv32-unknown-elf-gcc.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/altera_standard/25.1std/riscfree/toolchain/riscv32-unknown-elf/bin/riscv32-unknown-elf-g++.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- The ASM compiler identification is GNU
[cmake] -- Found assembler: C:/altera_standard/25.1std/riscfree/toolchain/riscv32-unknown-elf/bin/riscv32-unknown-elf-gcc.exe
[cmake] -- Configuring done (5.5s)
[cmake] -- Generating done (0.2s)
[cmake] -- Build files have been written to: C:/Users/tanguy-e/Downloads/test/software/app/build
[main] Génération du dossier : c:/Users/tanguy-e/Downloads/test/software/app/build
[build] Démarrage de la build
[proc] Exécution de la commande : chcp
[proc] Exécution de la commande : C:\altera_standard\25.1std\riscfree\build_tools\cmake\bin\cmake.exe --build c:/Users/tanguy-e/Downloads/test/software/app/build --config Debug --target all -j 8 --
[build] [ 1%] Building ASM object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_ecc_exception_entry.S.obj
[build] [ 2%] Building ASM object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_log_macro.S.obj
[build] [ 3%] Building ASM object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_mcount.S.obj
[build] [ 4%] Building ASM object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_vic_vector_table.S.obj
[build] [ 5%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_alarm_start.c.obj
[build] [ 6%] Building ASM object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/machine_trap.S.obj
[build] [ 8%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_busy_sleep.c.obj
[build] [ 8%] Building ASM object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/crt0.S.obj
[build] [ 9%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_close.c.obj
[build] [ 10%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dcache_flush_all.c.obj
[build] [ 11%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dcache_flush_no_writeback.c.obj
[build] [ 13%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dev.c.obj
[build] [ 13%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dcache_flush.c.obj
[build] [ 14%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dev_llist_insert.c.obj
[build] [ 15%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dma_rxchan_open.c.obj
[build] [ 16%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_dma_txchan_open.c.obj
[build] [ 17%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_do_ctors.c.obj
[build] [ 18%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_ecc_error_inject.c.obj
[build] [ 19%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_do_dtors.c.obj
[build] [ 20%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_ecc_exception.c.obj
[build] [ 22%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_errno.c.obj
[build] [ 21%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_env_lock.c.obj
[build] [ 23%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_environ.c.obj
[build] [ 24%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_execve.c.obj
[build] [ 25%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_exit.c.obj
[build] [ 26%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_fd_lock.c.obj
[build] [ 27%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_fcntl.c.obj
[build] [ 28%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_fd_unlock.c.obj
[build] [ 29%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_find_dev.c.obj
[build] [ 30%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_flash_dev.c.obj
[build] [ 31%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_find_file.c.obj
[build] [ 32%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_fork.c.obj
[build] [ 33%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_fs_reg.c.obj
[build] [ 34%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_fstat.c.obj
[build] [ 35%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_get_fd.c.obj
[build] [ 36%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_getchar.c.obj
[build] [ 37%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_getpid.c.obj
[build] [ 38%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_gettod.c.obj
[build] [ 39%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_gmon.c.obj
[build] [ 40%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_icache_flush.c.obj
[build] [ 41%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_icache_flush_all.c.obj
[build] [ 42%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_iic.c.obj
[build] [ 43%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_iic_isr_register.c.obj
[build] [ 44%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_instruction_exception_register.c.obj
[build] [ 45%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_io_redirect.c.obj
[build] [ 46%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_ioctl.c.obj
[build] [ 46%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_irq_handler.c.obj
[build] [ 47%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_isatty.c.obj
[build] [ 48%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_kill.c.obj
[build] [ 49%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_link.c.obj
[build] [ 50%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_load.c.obj
[build] [ 51%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_log_printf.c.obj
[build] [ 52%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_lseek.c.obj
[build] [ 53%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_main.c.obj
[build] [ 54%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_malloc_lock.c.obj
[build] [ 55%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_open.c.obj
[build] [ 56%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_printf.c.obj
[build] [ 57%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_putstr.c.obj
[build] [ 58%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_putchar.c.obj
[build] [ 59%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_putcharbuf.c.obj
[build] [ 60%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_read.c.obj
[build] [ 61%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_remap_cached.c.obj
[build] [ 62%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_release_fd.c.obj
[build] [ 63%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_remap_uncached.c.obj
[build] [ 64%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_rename.c.obj
[build] [ 66%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_sbrk.c.obj
[build] [ 65%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_settod.c.obj
[build] [ 67%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_stat.c.obj
[build] [ 68%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_tick.c.obj
[build] [ 70%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_times.c.obj
[build] [ 70%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_tls.c.obj
[build] [ 71%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_uncached_free.c.obj
[build] [ 72%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_uncached_malloc.c.obj
[build] [ 73%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_unlink.c.obj
[build] [ 74%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_usleep.c.obj
[build] [ 75%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_vic_isr_wrapper.c.obj
[build] [ 76%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_wait.c.obj
[build] [ 77%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/intel_fpga_api_cmn_dfl.c.obj
[build] [ 78%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/alt_write.c.obj
[build] [ 79%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/intel_fpga_api_cmn_inf.c.obj
[build] [ 80%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/intel_fpga_api_cmn_msg.c.obj
[build] [ 81%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/intel_fpga_api_niosv.c.obj
[build] [ 82%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/intel_fpga_platform_api_niosv.c.obj
[build] [ 83%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/intel_niosv_irq.c.obj
[build] [ 84%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/HAL/src/mtimer.c.obj
[build] [ 85%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/alt_sys_init.c.obj
[build] [ 86%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_jtag_uart_fd.c.obj
[build] [ 87%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_jtag_uart_init.c.obj
[build] [ 88%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_jtag_uart_ioctl.c.obj
[build] [ 89%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_jtag_uart_read.c.obj
[build] [ 90%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_jtag_uart_write.c.obj
[build] [ 91%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_sysid_qsys.c.obj
[build] [ 92%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_timer_sc.c.obj
[build] [ 94%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_timer_ts.c.obj
[build] [ 94%] Building C object hal_bsp/CMakeFiles/hal2_bsp.dir/drivers/src/altera_avalon_timer_vars.c.obj
[build] [ 95%] Linking C static library libhal2_bsp.a
[build] [ 95%] Built target hal2_bsp
[build] [ 95%] Building C object CMakeFiles/app.elf.dir/hello_world.c.obj
[build] [ 96%] Linking C executable app.elf
[build] C:/altera_standard/25.1std/riscfree/toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/13.2.0/../../../../riscv32-unknown-elf/bin/ld.exe: address 0x4019500 of app.elf section `.bss' is not within region `onchip_memory2'
[build] C:/altera_standard/25.1std/riscfree/toolchain/riscv32-unknown-elf/bin/../lib/gcc/riscv32-unknown-elf/13.2.0/../../../../riscv32-unknown-elf/bin/ld.exe: address 0x4019500 of app.elf section `.bss' is not within region `onchip_memory2'
[build] collect2.exe: error: ld returned 1 exit status
[build] make[2]: *** [CMakeFiles/app.elf.dir/build.make:101: app.elf] Error 1
[build] make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/app.elf.dir/all] Error 2
[build] make: *** [Makefile:91: all] Error 2
[proc] La commande « C:\altera_standard\25.1std\riscfree\build_tools\cmake\bin\cmake.exe --build c:/Users/tanguy-e/Downloads/test/software/app/build --config Debug --target all -j 8 -- » s’est arrêtée avec le code 2.
[driver] Build terminée : 00:00:12.693
[build] La build s'est achevée avec le code de sortie 2
- tehjingy_Altera5 months ago
Regular Contributor
Hi ETang2
You could solve this error b increasing the OCRAM size in the Quartus project.
Once you do this you would need to regenerate the BSP again.