Problem running software on Cyclone 3 board.

Discussion in 'The Projects Forum' started by koundinya, May 7, 2013.

  1. koundinya

    Thread Starter New Member

    Apr 9, 2013
    9
    0
    Hi all,
    I'm currently developing software application to run on my nios processor using Nios2 SBT.
    I have designed my board to glow the LED's depending on the values it reads from the register. I'm developing software to write into the register through Avalon bus interface. But, to get the BSP's and other files required i used an existing example from the templates( Hello world small) and generated BSP's and built the project. So out of curiosity i tried running Hello world small .elf file generated on my board. But i get the following message when i download the .elf on my board
    " Pausing target processor : Not responding
    Resetting and trying again : OK
    Initiating CPU cache <if present>
    OK
    Downloaded 1KB 0.0s\Verified OK
    Starting processor at address 0x00008020"
    Then when i try and run it it does not work but terminates.
    So my question is "Is it because my board is designed to function differently from the developed software or is there any other problem"
    Please help.
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Not sure, but the *.elf could have been made for a different version of the processor, or you may not have the required configuration as what the file was compiled against.

    The Altera forums would probably be of better use for this question.
     
  3. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Did you build your nios system using SOPC builder or Qsys? If so, then you export your system to the software using your SOPC_info file ( or whatever the analog is in Qsys) That is part of setting up your software. Doing this insures your BSP is right for you system, and you shouldn't have any problems.

    I suggest going back to your 'hello world' and adding the rest of the code a little at a time. Or post your code and we can take a look at it. I think you simply open the device as a file and write to the pointer that is returned from the open statement. This should work very simply.
     
  4. koundinya

    Thread Starter New Member

    Apr 9, 2013
    9
    0
    I created the SOPC using Qsys.
    Hello World message was not displayed because i had connected cpu instruction master to Jtag module instead of cpu data master. After i made the change
    its working and message gets displayed.
    Thank you.

    But now i'm facing another problem on how to scan characters from the console and writing into the register.
    Should i create a pointer to the Jtag module..?
    Please help.
     
  5. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    I'm not sure I ever tried that before. You might just get away using scanf().
     
  6. koundinya

    Thread Starter New Member

    Apr 9, 2013
    9
    0
    I cannot afford to use scanf because of memory constraints.
    Is there another alternative..?
     
  7. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Not that I know of. You'll need a library function to do console I/O. If you can't include the libraries, then I dont' have another solution.
     
  8. koundinya

    Thread Starter New Member

    Apr 9, 2013
    9
    0
    I think i can include libraries.. But i'm confused as to which to use..
     
  9. koundinya

    Thread Starter New Member

    Apr 9, 2013
    9
    0
    altera_avalon_jtag_uart_regs.h i came across this library but i couldn't find any details on how to use this library and the functions it supports..
     
  10. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    I think you need the standard C libraries, stdio and conio to use scanf. There might be a small C library option, I can't remember anymore. I only ever compiled 1 program with small RAM.
     
Loading...