newaetech / cw310-bergen-board

CW310 - Kintex FPGA ('Bergen Board') Target
3 stars 4 forks source link

PLL / i2c hang-up #3

Closed colinoflynn closed 3 years ago

colinoflynn commented 3 years ago

Issues report w/ the PLL set - not sure if just by chance or that is the real culprit. Based on their description (one write works, 2nd fails) I suspect the I2C code is locking up & blocks the USB processing from then on.

See https://github.com/lowRISC/opentitan/issues/6878

Should setup a stress test to slam PLL config messages. Is the PLL config message colliding with a random I2C read/write from temp?

colinoflynn commented 3 years ago

Confirmed it happens with:

import chipwhisperer as cw
from chipwhisperer.capture.targets.CW310 import CW310

import time

def main():

    target = cw.target(None, CW310, bsfile=None, slurp=False)

    print("CW310 Board Found:")

    int i = 0
    while(True):
        print("Round %d"%i)
        target.pll.pll_enable_set(True)
        target.pll.pll_outenable_set(False, 0)
        # Note: 1 and 2 seem to be reversed.
        target.pll.pll_outenable_set(True, 1)
        target.pll.pll_outenable_set(False, 2)

        # Note: both 1 and 2 need to be set, even if only 1 is enabled.
        target.pll.pll_outfreq_set(100E6, 1)
        target.pll.pll_outfreq_set(100E6, 2)

        i += 1

        time.sleep(0.5)

    print("Loading done.")

if __name__ == "__main__":
    main()
colinoflynn commented 3 years ago

Fixed by Alex - currently requires 'husky' branch of chipwhisperer, will close this one done in main develop branch.