From eee4e08dddeacb91c1e6828b3fde60dc5cf6a8ef Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 4 Jan 2025 20:41:32 +0200 Subject: [PATCH] Workaround for TT07 CB error: CTRL_SEL_nRST/CTRL_SEL_INC pins swapped --- src/ttboard/demoboard.py | 5 +++++ src/ttboard/pins/gpio_map.py | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ttboard/demoboard.py b/src/ttboard/demoboard.py index d602012..a3274e0 100644 --- a/src/ttboard/demoboard.py +++ b/src/ttboard/demoboard.py @@ -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 @@ -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 diff --git a/src/ttboard/pins/gpio_map.py b/src/ttboard/pins/gpio_map.py index 2c50796..4f60dda 100644 --- a/src/ttboard/pins/gpio_map.py +++ b/src/ttboard/pins/gpio_map.py @@ -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): @@ -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, @@ -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