Beispiel #1
0
 def test_all_supported_can_speed(self, bl, canSpeed):
     # Change the can speed
     bl.set_CAN_parameters(canSpeed)
     common_util.reset_with_check(bl)
     # 1. Get available flash region
     availableRegionStartAddress, availableRegionEndAddress, availableRegionSize = common_util.get_available_memory_region(bl, 'flash')
      
     # 2. Erase all the available flash region
     status, results = bl.flash_erase_region(availableRegionStartAddress, availableRegionSize)
     assert status == bootloader.status.kStatus_Success
      
     # 3. Program all the available flash region
     randomFile = common_util.generate_random_data_file(bl, availableRegionStartAddress, availableRegionSize)
     status, results = bl.write_memory(availableRegionStartAddress, randomFile)
     assert status == bootloader.status.kStatus_Success
      
     # 4. Read back the data
     readFile = os.path.join(bl.vectorsDir, 'read_data_from_memory.bin')
     status, results = bl.read_memory(availableRegionStartAddress, availableRegionSize, readFile)
     assert status == bootloader.status.kStatus_Success
      
     # 5. Verify data
     randomFileObj = file(randomFile, 'rb')
     data1 = randomFileObj.read()
     readFileObj = file(readFile, 'rb')
     data2 = readFileObj.read()
     assert data1 == data2
    def setup(self, bl, request):
        common_util.reset_with_check(bl)

        def teardown():
            pass

        request.addfinalizer(teardown)
Beispiel #3
0
    def setup(self, bl, request):
        common_util.reset_with_check(bl)

        def teardown():
            common_util.erase_all_available_flash_unsecure(bl)

        request.addfinalizer(teardown)
 def setup(self, bl, request):
     if (bltest_config.projectName.lower() == 'rom_bootloader_tower') or \
        (bltest_config.projectName.lower() == 'rom_bootloader_freedom'):
         pytest.skip('Does not support flash_resident bootloader.' ) 
     common_util.reset_with_check(bl)
     def teardown_method():
         pass
     request.addfinalizer(teardown_method)
    def setup(self, bl, request):
        common_util.reset_with_check(bl)
        # Write QSPI config block data to RAM and config QSPI module.
        config_QSPI_flash(bl, kQspiConfigBlockFile, 'ram')

        def teardown():
            pass

        request.addfinalizer(teardown)
 def setup(self, bl, request):
     if not bl.target.isSwReliableUpdateSupported:
         pytest.skip('%s does not support SW reliable update.' %
                     (bl.target.targetName))
     common_util.reset_with_check(bl)
     #erase app vector region
     status, result = bl.flash_erase_region(
         bl.target.BL_APP_VECTOR_TABLE_ADDRESS, 0x1000)
     assert status == bootloader.status.kStatus_Success
Beispiel #7
0
    def setup(self, bl, request):
        common_util.reset_with_check(bl)
        initOtfadDecryption()

        def teardown():
            # We should use JLink to unlock the device so that JLink can connect with the device and reset the device.
            bl.target.unlock()
            common_util.reset_without_check(bl)

        request.addfinalizer(teardown)
    def setup(self, request, bl):
        common_util.reset_with_check(bl)
        common_util.erase_all_available_flash_unsecure(bl)

        def teardown():
            if bl.target.hasErasableIFR:
                bl.target.unlock()
            else:
                pass

        request.addfinalizer(teardown)
    def setup(self, request, bl):

        common_util.reset_with_check(bl)
        common_util.erase_all_available_flash_unsecure(bl)
        status, results = bl.reset()
        time.sleep(3)
        assert status == bootloader.status.kStatus_Success

        def teardown():
            common_util.erase_all_available_flash_unsecure(bl)

        request.addfinalizer(teardown)
 def setup(self, request, bl):
     common_util.reset_with_check(bl)
def skipif(bl, request):
    common_util.reset_with_check(bl)
    if (commands.kCommandMask_call
            & common_util.get_available_commands(bl)) == 0:
        pytest.skip('%s does not support call command.' %
                    (bl.target['targetName']))
def skipif(bl, request):
    common_util.reset_with_check(bl)
    if (commands.kCommandMask_receiveSbFile
            & common_util.get_available_commands(bl)) == 0:
        pytest.skip('%s does not support the receive-sb-file command.' %
                    (bl.target.targetName))
Beispiel #13
0
 def setup(self, request, bl):
     common_util.reset_with_check(bl)
     bl.flash_erase_region(bl.target.BL_APP_VECTOR_TABLE_ADDRESS, 0x1000)
     time.sleep(2)
def skipif(bl, request):
    common_util.reset_with_check(bl)
    if (commands.kCommandMask_fillMemory
            & common_util.get_available_commands(bl)) == 0:
        pytest.skip('%s does not support the fill-memory command.' %
                    (bl.target.targetName))