Ejemplo n.º 1
0
def test_nor_flash_fcb(cpu_params: CpuParams, fcb: bool) -> None:
    """Test unsigned image with FCB NOR FLASH block

    :param cpu_params: processor specific parameters of the test
    :param fcb: True to include FCB block to output image; False to exclude
    """
    image_name = f'{cpu_params.board}_iled_blinky_ext_FLASH'
    # create bootable image object
    app_data = load_binary(cpu_params.data_dir, image_name + '.bin')
    boot_img = BootImgRT(EXT_FLASH_ADDR)
    boot_img.add_image(app_data)
    if fcb:
        boot_img.set_flexspi_fcb(load_binary(cpu_params.data_dir, 'flex_spi.fcb'))
    else:
        boot_img.fcb = PaddingFCB(0, enabled=False)

    # write image to disk and to processor
    suffix = '_unsigned_fcb.bin' if fcb else '_unsigned_nofcb.bin'
    write_image(cpu_params, image_name + suffix, boot_img)
Ejemplo n.º 2
0
def test_nor_flash_fcb(cpu_params: CpuParams, fcb: bool) -> None:
    """Test unsigned image with FCB NOR FLASH block

    :param cpu_params: processor specific parameters of the test
    :param fcb: True to include FCB block to output image; False to exclude
    """
    if (cpu_params.id != ID_RT1050) and (cpu_params.id != ID_RT1060):
        return  # this test case is supported only for RT1050 and RT1060

    image_name = f"{cpu_params.board}_iled_blinky_ext_FLASH"
    # create bootable image object
    app_data = load_binary(cpu_params.data_dir, image_name + ".bin")
    boot_img = BootImgRT(EXT_FLASH_ADDR)
    boot_img.add_image(app_data)
    if fcb:
        boot_img.set_flexspi_fcb(
            load_binary(cpu_params.data_dir, "flex_spi.fcb"))
    else:
        boot_img.fcb = PaddingFCB(0, enabled=False)

    # write image to disk and to processor
    suffix = "_unsigned_fcb.bin" if fcb else "_unsigned_nofcb.bin"
    write_image(cpu_params, image_name + suffix, boot_img)