def mcu_config(config): config.query_enum_key("Architecture", list_of_archs(config)) if config.get_config("Architecture") != "Native": config.query_enum_key("Vendor", list_of_vendors(config)) config.query_enum_key("Device_Family", list_of_families(config)) config.query_enum_key("Device_Name", list_of_devices(config)) device = config.get_config("Device_Name") if device.startswith("STM32F4"): core = "ARM Cortex-M4F" elif device.startswith("STM32F7"): core = "ARM Cortex-M7F" elif device.startswith("nRF51"): core = "ARM Cortex-M0" elif device.startswith("FE3"): core = "RISC-V32" config.set_config_string_key("CPU_Core", core, "mcu definition") family = config.get_config("Device_Family") if family.startswith("STM32"): config.query_integer_key("High_Speed_External_Clock", 1000000, 32000000) elif family.startswith("FE310"): config.query_integer_key("FLASH_SIZE") load_cpu_config(config) load_device_config(config)
def mcu_config(config, source_dir): config.query_enum_key("Architecture", list_of_archs(config)) if config.get_config("Architecture") != "Native": config.query_enum_key("Vendor", list_of_vendors(config)) config.query_enum_key("Device_Family", list_of_families(config)) config.query_enum_key("Device_Name", list_of_devices(config)) device = config.get_config("Device_Name") if device.startswith("STM32F4"): core = "ARM Cortex-M4F" elif device.startswith("STM32F7"): core = "ARM Cortex-M7F" elif device.startswith("nRF51"): core = "ARM Cortex-M0" elif device.startswith("nRF52"): core = "ARM Cortex-M4F" elif device.startswith("FE3"): core = "RISC-V32" elif device.startswith("U5"): core = "RISC-V64" config.set_config_string_key("CPU_Core", core, "mcu definition") family = config.get_config("Device_Family") if family.startswith("STM32"): config.query_integer_key("High_Speed_External_Clock", 1000000, 32000000) elif family.startswith("FE3"): config.query_integer_key("hifive1_uart_root") config.query_bool_key("qemu_sifive_test_exit") load_cpu_config(config) load_device_config(config, source_dir) config.query_integer_key("Number_Of_Interrupts", default=0)