fpga reboot and config file (.bit file)

(Logi bone with Ubuntu Logi bone image. Running blink led demo)

Where is the fpga config file stored after loading it to the fpga? 

I noticed the following and don't understand why:
1. Load the blink led demo (sudo ./make_demo.sh)
2. LED0 and LED1 appear to be blinking as expected
3. Power off BeagleBone Black (BBB)
4. Power on BBB
5. LED0 and LED1 no longer blink (I need to re-do the sudo ./make_demo.sh again to make the LEDs blink)

For the above step #3, if, instead of powering off BBB, I reboot BBB, then the LEDs keep blinking.

So, if the config (bit) file is stored in (fpga ?)  RAM, why rebooting BBB doesn't lose the config?  Anyway to store the bit file in flash memory so that there is no need to reload it after powering off?

I may be missing something very basic or doing something wrong.
Thanks.

Comments

  • Where is the fpga config file stored after loading it to the fpga?  

    When loaded the config data is stored in fpga RAM.


    3. Power off BeagleBone Black (BBB) 
    What do you mean by power off the BBB?  Remove power supply?  Are you powering the LOGI Bone seperately?

    5. LED0 and LED1 no longer blink (I need to re-do the sudo ./make_demo.sh again to make the LEDs blink)

    Ways the FPGA program will be reset:
    * PRGB is pulled low by the GPIO expander(connected to BBB via i2c) , effective reset and used to initiate loading a new configuration file. 
    * power is removed from the FPGA, or power supply dips below some threshold which will reset the FPGA.  

    Rebooting the BBB does not remove power for the FPGA therefore the RAM contents stay intact the program continues to run.  

    Anyway to store the bit file in flash memory so that there is no need to reload it after powering off?

    You can load the onboard flash and have the FPGA self boot.  You will need to use a xilinx jtag adapter and use the impact tools to load the flash with an *.mcs file.  You then need to set the mode pins to self boot mode (set mode pins) using the solder jumpers on the back of the LOGI-Bone.  

    Does this help?

  • As always, thanks for the quick response and the explanation. Yes, it does help. I'll research/learn the loading the onboard flash/*.mcs file part. As for xlinix jtag adapter, I have an Altera USB Blaster Jtag adapter (for an Altera MAX development board), will that work or it has to be xlinix's adapter?


    For the "power off" part ---
    Hardware setup:
    Logi bone is connected on top of BBB like a BBB "shield". Power is supplied via the 5V barrel connector of BBB.

    By "powering off BBB", I meant:
    1. sudo poweroff from BBB's command prompt,
    or
    2. sudo shutdown -h now from BBB's command prompt,

    then, remove the power cable from the BBB's 5v barrel connector or leave the power cable connected.  Either way, the result is the same.

    Thanks again.


  • Based upon removing all power from the FPGA board this is expected behavior.  You could allso write a startup script in the BBB which loads a given bit file into the FPGA each time it boots.  This would give you full control of the laoding process from the BBB.

    You will need to have a xilinx compatible jtag adapter - I don't think the altera bus blaster is compatible.  There are some low cost options avaiable on ebay.  Or here is one that support both altera and xilinx: http://www.seeedstudio.com/depot/dsjtag-2-in-1-usb-jtag-cable-for-fpgacpld-p-1040.html?cPath=174

    Here is a guide on creating the *.mcs file and loading it using jtag:

    Cheers!


  • I probably will try the startup script idea first. Appreciated the info. I'll study/research. Thanks. 
  • I tried the startup script idea, and it works. Below is the /etc/rc.local file I modified, in case anybody is interested. Thanks.


    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    sudo logi_loader /home/ubuntu/logi-apps/blink_led_app/logibone_r1_blink.bit
    exit 0

  • Glad it worked out.  Thanks for sharing!
Sign In or Register to comment.