Found 5 other functions taking a
bootloader_state_t
argument:
Load the selected partition and start application. Start from partition 'start_index', if not bootable then work backwards to FACTORY_INDEX (ie try any OTA slots in descending order and then the factory partition). If still nothing, start from 'start_index + 1' and work up to highest numbered OTA partition. If still nothing, try TEST_APP_INDEX. Everything this function calls must be located in the iram_loader_seg segment.
Load partition table. Parse partition table, get useful data such as location of OTA data partition, factory app partition, and test app partition.
Return the index of the selected boot partition. This is the preferred boot partition, as determined by the partition table & any OTA sequence number found in OTA data. This partition will only be booted if it contains a valid app image, otherwise load_boot_image() will search for a valid partition using this selection as the starting point.