nios cpu
182 TopicsMailbox Client HAL API: Erroneous behavior in flash erase boundary checks (Agilex 3 / Nios V)
Hi, I am currently working on an Agilex 3 platform using the Nios V in Quartus Prime Pro 25.3. I discovered unexpected behavior in the Mailbox Client HAL API when trying to erase 32K blocks of flash. In the file intel_mailbox_client_flash.c in function mailbox_client_flash_erase_block: The function receives a dynamic block_size as an argument but ignores it during the boundary check, relying instead on the global dev_info->region_info.block_size. Because it checks against the maximum hardware block_size (i.e., 64K) instead of the actual block_size parameter passed to the function, it mistakenly blocks legitimate erase commands at the final sectors of the region. Below is the code snippet: int mailbox_client_flash_erase_block(intel_mailbox_client* fd, int block_offset, int block_size) { if(block_offset < 0 || block_offset > dev_info->region_info.region_size - dev_info->region_info.block_size || (block_offset & (SZ_4K - 1)) != 0) { return -EINVAL; } } I suggest changing the boundary check to use the local block_size parameter that was explicitly passed to the function: if(block_offset < 0 || block_offset > dev_info->region_info.region_size - block_size || (block_offset & (SZ_4K - 1)) != 0) { return -EINVAL; } A similar logic flaw exists in the caller function mailbox_client_flash_erase. The input validation check uses the static hardware block size (dev_info->region_info.block_size) instead of taking the requested length into account. I suppose this check should prevent out-of-bounds erases in the first place, so checking if there is one 64K block left in the flash is actually pointless. int mailbox_client_flash_erase(intel_mailbox_client* fd, int offset, int length) { if(offset < 0 || offset > dev_info->region_info.region_size - dev_info->region_info.block_size) { return -EINVAL; } } I suggest using: if(offset < 0 || offset > dev_info->region_info.region_size - length) { return -EINVAL; } Any feedback on this behavior would be appreciated. Thanks!Solved121Views1like4CommentsDual Port Nios V BSP error
I've created a Nios V qsys with dual port onchip memory in Quartus Pro 26.1 True dual port, first port connected to instruction manager, second - to data manager. Base addresses automatically assigned the same to both. But i'am unable to create the BSP due to memory regions overlapping error! Of course the addresses are same - its the same physical onchip memory! Any solytion, please? Regards, Vlad.347Views0likes12CommentsSOPC Builder reports missing DB9000 Avalon components, but Quartus compilation does not
I am troubleshooting a legacy FPGA design in Quartus II 12.1 SP1 using SOPC Builder.During SOPC Builder system generation, I receive the following errors: db9000avln_mstr_0: Component db9000avln_mstr 1.0 not found or could not be instantiated db9000avln_slv_0: Component db9000avln_slv 1.0 not found or could not be instantiated Additional errors report that the custom Avalon master has no waitrequest signal, cannot be connected to an SDRAM slave that supports backpressure, has a data-width mismatch, and has missing or invalid address-unit settings (SYMBOLS / WORDS). I have located the generated db9000avln.vqm file and copies of the component PTF files. One important observation: although SOPC Builder reports these errors, the Quartus FPGA compilation flow does not report the same component-discovery and Avalon interface errors. I would like to understand the reason for this difference and the correct way to resolve it. My questions are: Why does SOPC Builder report that these components cannot be found or instantiated? Is this typically caused by missing component registration/metadata, an incompatible component definition, or something else? Why can Quartus compilation proceed without reporting these errors? Could it be because the generated db9000avln.vqm netlist is already available and included directly in the Quartus project, allowing Quartus to compile the existing hardware implementation without regenerating the SOPC system? If that is the case, does successful Quartus compilation mean the existing DB9000 logic is being compiled from the .vqm, while SOPC Builder is failing only when it tries to reconstruct or regenerate the system? What is the correct way to restore SOPC Builder generation so that these components can be discovered and their Avalon interfaces validated? How can I determine whether the reported waitrequest, data-width and address-unit errors reflect a genuine hardware-interface incompatibility or only incorrect/missing component metadata? I want to preserve the existing hardware behavior and avoid unnecessary changes to the Avalon interfaces or generated netlist. So can I ignore the SOPC builder issues and move ahead with compilation and programming file generation in Quartus, will that have the functionality of the DB9000 IP implemented. Thank you for your help.108Views0likes7CommentsNios V XIP boot from UFM does not work with dual configuration on FPGA 10M50 Evaluation Kit
Hello, I am currently testing a project using Nios V on the "FPGA 10M50 Evaluation Kit". I am trying to boot the Nios V application from UFM using XIP (Execute In Place) with the dual configuration setting. However, I have not been able to successfully boot from UFM, even after checking the following items: * FPGA and board wiring * BSP Editor configuration * Standalone execution of the Nios V application (a simple LED blinking application) The Nios V application runs correctly as a standalone project, but it does not boot from UFM. I suspect that the issue may be related to my BSP Editor configuration. (I previously had some difficulties with a similar boot configuration when using Nios II.) I have attached my project files. If possible, could someone please review my project files and advise what might be causing the issue? *Note: The project was created under the D: drive on my PC.* ----------------------------------------------------------------------------------------------------------------- This is not directly related to the boot issue, but I also noticed another behavior with the Nios V application. When I tried to use "usleep()" in the application, the build completed successfully, but during execution the delay seemed to be ignored. If there is any required configuration or setting for "usleep()" to work correctly with Nios V, I would appreciate any advice. Thank you very much for your help.117Views0likes3CommentsCyclone 10 GX Nios V Ethernet Ping Issue - UC/TCP-IP Error 20012 and TSE/mSGDMA Debugging ;
Hello , I am developing Ethernet communication on a Cyclone 10 GX FPGA using Nios V/m, the Triple-Speed Ethernet (TSE) IP, msgDMA, a Marvell Alaska 88E1111 PHY, UC-OS-II, and the recommended UC-TCP-IP software components. I am using the recommended UC/TCP-IP .c and .h source files, but I am facing an initialization error before I can complete ping testing. Hardware/software configuration: FPGA: Cyclone 10 GX, Processor: Nios V/m at 50 MHz, Quartus Prime Pro: 26.1.0, Ethernet: TSE with TX/RX mSGDMA, PHY: Marvell Alaska 88E1111 over SGMII, Network stack: UC/TCP-IP, RTOS: UC/OS-II, Board IP: 10.0.0.2/24, PC-to-board ping: Not working Current initialization error The network initialization fails at: NetSock_Init(&err); The returned error is: NET_SOCK_ERR_INIT_CONN_REQ_FAULT (20012) I am using the recommended MicroC/TCP-IP source files with MicroC/OS-II. Before calling NetSock_Init(&err), the following initialization functions execute successfully: Net_InitDflt(); NetCtr_Init(); NetStat_Init(); Net_KAL_Init(); NetTmr_Init(); NetBuf_Init(); NetConn_Init(); NetMgr_Init(&err); NetICMP_Init(&err); NetIP_Init(&err); NetIGMP_Init(); NetUDP_Init(); NetTCP_Init(&err); After these initialization functions complete, I call: NetSock_Init(err); While debugging the recommended KAL implementation, I found that semaphore creation fails inside NetSock_Init(): p_sem = OSSemCreate(0u if (p_sem == (OS_EVENT *)0) { *p_err = RTOS_ERR_CREATE_FAIL; return (handle); } The eighth call to OSSemCreate(0u) specifically within NetSock_Init() returns NULL. The preceding calls return valid semaphore pointers. OS_MAX_EVENTS = 60 OS_LOWEST_PRIO = 80 Additional debugging information – MDIO and PHY detection I have also verified MDIO access to both the internal PCS and the external Marvell Alaska 88E1111 PHY. MDIO space 0: Internal PCS registers. MDIO space 1: External Marvell 88E1111 PHY registers. I can successfully read the registers from both spaces. The external PHY identification registers return PHY ID1 = 0x0141 and PHY ID2 = 0x0CC2. This confirms that I can access the internal PCS and identify the external PHY through MDIO. However, the complete Ethernet packet path and ping communication are not yet verified. TSE MAC debugging : I have verified access to the TSE MAC registers and checked the MAC configuration registers, including COMMAND_CONFIG, MAC address registers, frame length, pause settings, and inter-packet gap. TX/RX mSGDMA debugging: I have separate TX and RX mSGDMA controllers, descriptor memory, and descriptor prefetchers configured in Platform Designer. TSE: 0x00112000, TX mSGDMA CSR: 0x00112480, RX mSGDMA CSR: 0x001124A0, TX descriptor prefetcher: 0x00112440, RX descriptor prefetcher: 0x00112460, Descriptor memory: 0x00110000 I have verified descriptor-memory read/write access using test patterns. However, I have not yet confirmed that complete TX and RX packet transfers work correctly. I need guidance on validating the descriptor format, buffer addresses, descriptor ownership, DMA status registers, and completion/error status. I would also like to know the recommended procedure for validating TX and RX independently before integrating them with the TCP/IP stack. My current blocking issue is MicroC/TCP-IP initialization error 20012 (NET_SOCK_ERR_INIT_CONN_REQ_FAULT). During debugging, I found that the eighth OSSemCreate(0u) call within NetSock_Init() returns NULL, causing semaphore creation to fail. I would like to understand why semaphore creation fails even though the recommended networking source files are being used. Thank you,Solved160Views0likes4CommentsNIOS V Core Not Recognized in RiscFree IDE 25.2.1 Run Configuration
I am trying to run software that I developed using Quartus Prime Lite version 25.1 and RiscFree IDE version 25.2.1. However, in Run As > Run Configurations > Ashling RISC-V Hardware Debugging, the NIOS V core is not recognized in the Core Selection field under Target Configuration. The PIC is recognized correctly in the Device/TAP Selection field. I have found that this issue has occurred with some previous versions, but I would like to know whether this problem can also occur with RiscFree IDE version 25.2.1. If there is a known solution or workaround, I would appreciate any advice. I have attached screenshots of the issue for reference.99Views0likes4CommentsIntroducing the Altera Community AI Responder — Beta
Altera is introducing the AI Responder, an assistant built into the Altera Community to help provide faster, context-aware guidance for Altera product questions. It uses relevant public Altera documentation and Knowledge Database content, with coverage continuing to expand. The AI Responder may provide source references and can hand off complex or out-of-scope questions to an Altera subject-matter expert. As a beta feature, responses may contain errors or omissions, so please review the sources and verify technical guidance against official Altera documentation before implementation. If the response does not fully address your question, add more context and tag ai_responder to continue the discussion. We welcome your feedback as we improve the Community experience.26Views0likes0CommentsNIOS-V-64bit - why no double precision FPU ?
We need the 64 bit NIOS for several projects and must have a double precision FPU option. But the documentation so far lists only a single precision FPU Is this correct ? a 64 bit processor not having a (64 bit) double precision native FPU option seems unbeleiveable . It is about as strange as say, not having an 64 bit ALU. Altera- please explain ? page 3 : https://docs.altera.com/v/u/docs/759484/nios-v-processors-for-agilextm-5-fpgas-e-series-technology-brief Or please add this to the basic feature provision ? With thanks Glen. (Experienced Xilinx user consideriing migrating-defecting to Altera )Solved338Views0likes7CommentsNios V/g load-writeback hazard
Summary On a NiosV/g core, a long-latency load from an on-chip memory immediately followed by a short-latency load from the core's own TCM returns the TCM load's data in both destination registers. The first load's writeback is lost. lw a0, 0(t0) # t0 -> On-chip memory lw a1, 0(t1) # t1 -> DTCM (core-local) # a0 and a1 both end up holding the DTCM value Inserting a single instruction between the two loads is enough to avoid it. Two on-chip memory loads back to back are fine, and so is the reverse order (TCM load first, then the on-chip memory load). Minimal reproducer Assembly: _start: lui t0, 0x40 # t0 = 0x00040000 on-chip memory ("input memory") lui t1, 0x10 # t1 = 0x00010000 DTCM (core-local) lui t2, 0xe0 # t2 = 0x000e0000 2nd on-chip memory ("output memory") li a2, 0x47414c47 # a value distinct from the DTCM sentinel sw a2, 0(t0) # ...store it into input_mem nop # let the store retire. The hazard is about two nop # adjacent *loads*; keep everything else well nop # clear of the pair below so the test stays nop # unambiguous. lw a0, 0(t0) # long-latency load: on-chip memory (input memory) lw a1, 0(t1) # short-latency load: DTCM, immediately after sw a0, 0(t2) # output_memory[0] = result of the AXI load sw a1, 4(t2) # output_memory[1] = result of the DTCM load spin: j spin System details NiosV/g data_manager (AXI master) is directly connected to on-chip memories and pipeline stages are limited to 3 in Platform Designer.293Views0likes6CommentsRun-time errors using EMIF in Agilex 5 NIOS-V design
Hello, I am using Quartus Prime Pro 26.1.1, with the Agilex 5 development board (AXE5-Eagle). I am trying to run the NIOS-V code from the LPDDR4 memory, using JTAG to download/debug. The reset and exception vectors are set to the On-Chip RAM. I used the sample design provided for that board - AXE5 Eagle mipi_hdmi_mira220 and removed everything related to MIPI and HDMI. Added JTAG Uart IP. The resulting sample design is attached (mipi_hdmi_mira220.zip). In the software/ directory you can also see the FreeRTOS BSP I used. I created a simple FreeRTOS application that just prints some string to stdout. What I am seeing is - the RISC-V processor throws exceptions - one of the following - Misaligned Read Address, Misaligned Write Address or Invalid Instruction. This happens in alt_load_section(). If I execute step-by-step, no exception is thrown. But if I just run the application it fails. Is there something else that need to be added/updated/changed, in order to be able and execute code from LPDDR4 using the EMIF IP? I could not find any existing sample design, using NIOS-V and EMIF, with code execution from EMIF. Thank you, D.531Views0likes5Comments