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.