@@ -482,9 +482,12 @@ static void set_cache_and_start_app(
482
482
483
483
#include <stdbool.h>
484
484
#include <sys/param.h>
485
+ #include <string.h>
485
486
486
487
#include "bootloader_config.h"
487
488
#include "bootloader_utility.h"
489
+ #include "bootloader_flash.h"
490
+ #include "bootloader_common.h"
488
491
489
492
#include "esp_err.h"
490
493
#include "esp_log.h"
@@ -536,7 +539,7 @@ bool bootloader_utility_load_partition_table(bootloader_state_t* bs)
536
539
esp_partition_info_t partiton_local ;
537
540
esp_partition_info_t * partition = & partiton_local ;
538
541
539
- memcpy (& partiton_local , (intptr_t )partitions + i * sizeof (esp_partition_info_t ), sizeof (esp_partition_info_t ));
542
+ memcpy (& partiton_local , (void * )(( intptr_t )partitions + i * sizeof (esp_partition_info_t ) ), sizeof (esp_partition_info_t ));
540
543
541
544
ESP_LOGD (TAG , "load partition table entry 0x%x" , (intptr_t )partition );
542
545
ESP_LOGD (TAG , "type=%x subtype=%x" , partition -> type , partition -> subtype );
@@ -774,6 +777,9 @@ bool bootloader_utility_load_boot_image(const bootloader_state_t *bs, int start_
774
777
775
778
void bootloader_utility_load_image (const esp_image_metadata_t * image_data )
776
779
{
780
+ void (* user_start )(size_t start_addr , size_t map );
781
+ extern void Cache_Read_Enable (uint8_t map , uint8_t p , uint8_t v );
782
+
777
783
#if defined(CONFIG_SECURE_BOOT_ENABLED ) || defined(CONFIG_FLASH_ENCRYPTION_ENABLED )
778
784
esp_err_t err ;
779
785
#endif
@@ -834,8 +840,6 @@ void bootloader_utility_load_image(const esp_image_metadata_t* image_data)
834
840
835
841
Cache_Read_Enable (map , 0 , 0 );
836
842
837
- void (* user_start )(size_t start_addr , size_t map );
838
-
839
843
user_start = (void * )image_data -> image .entry_addr ;
840
844
user_start (image_data -> start_addr , map );
841
845
#endif /* BOOTLOADER_UNPACK_APP */
0 commit comments