GithubHelp home page GithubHelp logo

quartiq / kasli-i2c Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 5.0 115 KB

Utilities to access the Sinara I2C tree via Kasli, including Sinara EEPROM deployment, firmware flashing for Fastino, Banker

Python 97.91% Shell 2.09%
sinara-hw fpga i2c

kasli-i2c's People

Contributors

jordens avatar kaolpr avatar nkrackow avatar timboski avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kasli-i2c's Issues

EEPROM contents

What content is intended to be placed in the following EEPROM fields:

  • vendor_data
  • project_data
  • user_data
  • board_data?

According to comments in the code, the vendor_data field might be used for storing board serial number or data. However, I see no suggestion what to place in the other three fields. Were they reserved with something specific in mind and if so, has any specific format for it been developed? Or perhaps those fields were created just for 'future development'?

Fastino configuration issue

I guess I found the reason why the FPGA couldn't load its configuration from flash when reset (see the no CDONE issue sinara-hw/Fastino#48 (comment))

The lines below need to be swapped - according to the expander datasheet (p. 9) after the enable command is sent, the GPIO ports are configured as quasi-bidirectional, so when the creload function is invoked the CDONE pin is strongly driven low so the FPGA is not able to finish its configuration.

self.spi.gpio_config(0b00, 0b01, 0b10, 0b01)
self.spi.gpio_enable(0b1110) # use as GPIO

I2C NAK

Trying to use kasli-i2c on a Kasli v1.1 since 1b86a25 gives errors like

Traceback (most recent call last):
  File "/miniconda/envs/devenv/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/miniconda/envs/devenv/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/workspace/kasli_get_mac.py", line 21, in <module>
    with bus.enabled("LOC0"):
  File "/miniconda/envs/devenv/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/workspace/kasli.py", line 44, in enabled
    self.enable(*ports)
  File "/workspace/kasli.py", line 40, in enable
    self.write_single(addr, bits[addr])
  File "/workspace/i2c_bitbang.py", line 221, in write_single
    raise I2CNACK("Address Write NACK", addr)
pyftdi.i2c.I2cNackError: [Errno Address Write NACK] 112

@jordens am I right in thinking that this relates to hardware changes for v2.0? AFAICT for v2.0 we added a second I2C reset line going to the FPGA. This is ORd with the FT232 RESET line using FETs, resulting in a polarity inversion compared with v1.x. i.e. on v1.1 BDBUS 5 directly drives the active-low TCA9548 reset, while on v2.x it drives it via an inverter, so BDBUS 5 is active-high reset.

image

The current code reflects an active-high reset

kasli-i2c/i2c_bitbang.py

Lines 33 to 38 in 1b86a25

def reset(self):
self.write(self.EN | self.RESET)
self.tick()
self.write(self.EN)
self.tick()
time.sleep(.01)

The previous code reflects an active-low reset

kasli-i2c/i2c_bitbang.py

Lines 33 to 38 in df6a2de

def reset_switch(self):
self.write(self.EN)
self.tick()
self.write(self.EN | self.RESET_B)
self.tick()
time.sleep(.01)

Does that sound about right @jordens or have I got the wrong end of the stick? If so, do you have preferences on a fix (e.g. pass a reset polarity param into I2C's constructor that's set based on a kasli hw-rev)?

phaser flashing

what's the status of phaser flashing here? The code looks to be implemented (although missing a nice CLI, but that's easy to add) but this with False makes it look like the codepath can never be reached unless I'm missing something?

if False:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.