Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Problem with Zip file

Hello guys,

Good day. I have problem after download zip file into flash. I already download .sof file and zip file without any error. Just warnings appear. Should appear at LCD display is " Welcome to Barcode System". However, it appear "No Database". Is there any settings that I need to consider? :(

Thank you

17 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Dear Daixiwen,

    I check the ro_zipfs_base parameter and ro_zipfs_offset. The value is same with your suggestion.

    When I run at Nios, Nios => Run As => Nios II hardware. The error occur which is failed download the elf file. The error occur at address 0x1400000 and 0x140FFFF (refer my attachment). When I check these two address at SOPC, it related with CFI_FLASH (0x1400000). While I'm not sure for address 0x140FFFF. Do you have any suggestion or ideas related with this problem ? :(
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you download your software through JTAG (which is the case when using "Run as Nios II Hardware") you should just put all your sections to the main RAM (which is SDRAM on your project). If you have some sections in Flash then the nios downloader will attempt to write data to flash and will fail with a verify error. The .text section is the one containing the software itself, .rodata is for the constants (the strings for example), .rwdata for global variables that are initialized to a specific value in the code, .bss for uninitialized global variables, .stack for the main stack and .heap is the memory section that can be allocated with malloc().

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    If you download your software through JTAG (which is the case when using "Run as Nios II Hardware") you should just put all your sections to the main RAM (which is SDRAM on your project).

    --- Quote End ---

    Hi Dixiwen,

    Thanks for your concern. First, I download my software through UART (set stdin,stdout,stderr to UART) because I have rs232 cable. I read altera document, it said that if we use rs232 cable,we have to set the stdin,stdout and stderr to UART. Is it right?

    --- Quote Start ---

    If you have some sections in Flash then the nios downloader will attempt to write data to flash and will fail with a verify error.

    --- Quote End ---

    Second, I have two sections in Flash (EPCS and CFI). I write .sof file first using EPCS. Then, I write .zip file using CFI. What do you mean by will fail with a verify error?

    Thanks in advance
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Daixiwen,

    I get to run the system using Run As Nios II Hardware. The LCD display "Price Checker" instead of " Shopping Chart Price Checker". It seem like the system not completely run. I download the software through UART. I attach the c code, hope you can give advise. Thanks in advance
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thanks for your concern. First, I download my software through UART (set stdin,stdout,stderr to UART) because I have rs232 cable. I read altera document, it said that if we use rs232 cable,we have to set the stdin,stdout and stderr to UART. Is it right?

    --- Quote End ---

    AFAIK Eclipse can't load the software through a UART. And you would need a special bootloader on the Nios system to accept the software application through a UART. You are more probably transferring the program through by JTAG through a USB blaster. Setting stdin, stdout and stderr to the UART needs to be done if you want to use a RS232 interface for text input and output. With those settings the printf() from your code will display text on the RS232 interface, and scanf() will read also form the RS232.

    --- Quote Start ---

    Second, I have two sections in Flash (EPCS and CFI). I write .sof file first using EPCS. Then, I write .zip file using CFI. What do you mean by will fail with a verify error?

    --- Quote End ---

    By sections I meant the memory zones used in the link script, such as .text, .rodata etc... Those need to be placed in RAM because when you dowload the application with Eclipse, those are the addresses that it will use to write the software to. If you place .text in flash for example, Eclipse will try to upload the software directly to the flash, which it isn't designed to do. The data will not be written, and when Eclipse verifies the written data it will report a verify error. This won't happen if you put all the sections into RAM in the BSP editor.

    --- Quote Start ---

    I get to run the system using Run As Nios II Hardware. The LCD display "Price Checker" instead of " Shopping Chart Price Checker". It seem like the system not completely run. I download the software through UART. I attach the c code, hope you can give advise. Thanks in advance

    --- Quote End ---

    I'm sorry it is difficult to see where the problem could come from just by looking at the code. You should try and debug the application. (either by using the debugger, or by adding a few printf's to the code to show you what it is doing).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Dixiwen,

    How about the setting of exeption_stack_memory_region_name and interrupt_stack_memory_region_name in bsp editor? I set them to epcs_flash_controller and onchip_mem respectively. It is due to the SOPC Builder setting wheres I set the reset vector to epcs_flash_controller, whilst exception vector to onchip_mem. Is it right? Thanks in advance
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't know what exeption_stack_memory_region_name and interrupt_stack_memory_region_name.

    As for the reset and exception vectors, the exception vector should be set to a RAM (either onchip or external SDRAM). You don't need to worry about the reset vector as long as you are using JTAG to upload your software. The day you will want to flash the software and have the Nios CPu load it at startup, then you will have to make the reset vector point to the bootloader (either the epcs_flash_controller if you want to put the software in the EPCS or the CFI flash if you'd rather have the software there).