Exemplo n.º 1
0
def probe_system():
    # run-once code to determine what hardware we are running on
    global hw_label, has_608, has_fatram, is_factory_mode

    from sigheader import RAM_BOOT_FLAGS, RBF_FACTORY_MODE
    import ckcc, callgate, stm
    from machine import Pin

    # NOTE: mk1 not supported anymore.
    # PA10 is pulled-down in Mark2, open in previous revs
    #mark2 = (Pin('MARK2', Pin.IN, pull=Pin.PULL_UP).value() == 0)
    #
    #if not mark2:
    #    has_membrane = False
    #    hw_label = 'mk1'

    hw_label = 'mk2'

    has_fatram = ckcc.is_stm32l496()

    if has_fatram:
        hw_label = 'mk3'

    has_608 = callgate.has_608()

    # Boot loader needs to tell us stuff about how we were booted, sometimes:
    # - did we just install a new version, for example
    # - are we running in "factory mode" with flash un-secured?
    is_factory_mode = bool(stm.mem32[RAM_BOOT_FLAGS] & RBF_FACTORY_MODE)
    bn = callgate.get_bag_number()
    if bn:
        # this path supports testing/dev with RDP!=2, which normal production bootroms enforce
        is_factory_mode = False
Exemplo n.º 2
0
def probe_system():
    # run-once code to determine what hardware we are running on
    global has_membrane, hw_label, has_608

    import ckcc, callgate
    from machine import Pin

    # PA10 is pulled-down in Mark2, open in previous revs
    mark2 = (Pin('MARK2', Pin.IN, pull=Pin.PULL_UP).value() == 0)

    if not mark2:
        has_membrane = False
        hw_label = 'mk1'
    else:
        has_membrane = True
        hw_label = 'mk2'

    if ckcc.is_stm32l496():
        hw_label = 'mk3'

    has_608 = callgate.has_608()
Exemplo n.º 3
0
def probe_system():
    # run-once code to determine what hardware we are running on
    global hw_label, has_608, has_fatram

    import ckcc, callgate
    from machine import Pin

    # NOTE: mk1 not supported anymore.
    # PA10 is pulled-down in Mark2, open in previous revs
    #mark2 = (Pin('MARK2', Pin.IN, pull=Pin.PULL_UP).value() == 0)
    #
    #if not mark2:
    #    has_membrane = False
    #    hw_label = 'mk1'

    hw_label = 'mk2'

    has_fatram = ckcc.is_stm32l496()

    if has_fatram:
        hw_label = 'mk3'

    has_608 = callgate.has_608()