Skip to content

Commit

Permalink
Workaround for TT07 CB error: CTRL_SEL_nRST/CTRL_SEL_INC pins swapped
Browse files Browse the repository at this point in the history
  • Loading branch information
urish committed Jan 5, 2025
1 parent 38a8061 commit eee4e08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ttboard/demoboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import ttboard.util.time as time
from ttboard.globals import Globals
from ttboard.mode import RPMode
from ttboard.pins.gpio_map import GPIOMapTT06
from ttboard.pins.pins import Pins
from ttboard.project_mux import Design
from ttboard.config.user_config import UserConfig
Expand Down Expand Up @@ -139,6 +140,10 @@ def __init__(self,
setattr(self, p, getattr(self.pins, p))

self.shuttle = Globals.project_mux(self.user_config.force_shuttle)
if self.shuttle.run == 'tt07':
pins_mode = self.pins.mode
GPIOMapTT06.tt07_cb_fix = True
self.pins.mode = pins_mode # force re-init of pins to apply new pin map

# config
self.apply_configs = apply_user_config
Expand Down
9 changes: 8 additions & 1 deletion src/ttboard/pins/gpio_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ class GPIOMapTT06(GPIOMapBase):
UIO6 = 27
UIO7 = 28
RPIO29 = 29

# Enable a workaround for a PCB error in TT07 carrier board, which swapped the ctrl_sel_inc and ctrl_sel_nrst lines:
tt07_cb_fix = False

@classmethod
def project_clock(cls):
Expand Down Expand Up @@ -304,7 +307,7 @@ def always_outputs(cls):
@classmethod
def all(cls):
retDict = cls.all_common()
#retDict = GPIOMapBase.all(cls)

retDict.update({
'nprojectrst': cls.PROJECT_nRST,
'cinc': cls.CTRL_SEL_INC,
Expand All @@ -315,6 +318,10 @@ def all(cls):
'uo_out2': cls.UO_OUT2,
'uo_out3': cls.UO_OUT3
})

if cls.tt07_cb_fix:
retDict['cinc'], retDict['ncrst'] = retDict['ncrst'], retDict['cinc']

return retDict

GPIOMap = GPIOMapTT04

0 comments on commit eee4e08

Please sign in to comment.