Added missing files + cosmetics as per review

- Added missing `test-app/app_sim_scattered.c`
- Added missing `test-app/sim_scattered.ld`
- Fixed comments at the end of define blocks for consistency
- Removed unused constants as indicated
pull/562/head
Daniele Lacamera 2025-04-11 15:50:10 +02:00
parent 9c3e86241a
commit ea0b4fb935
4 changed files with 79 additions and 4 deletions

View File

@ -312,7 +312,6 @@ extern "C" {
#define IMG_STATE_FINAL_FLAGS 0x30
/* ELF loading state - only valid on boot partition so doesn't conflict with
* IMAGE_STATE_UPDATING */
#define IMG_STATE_ELF_LOADING 0x70
#define IMG_STATE_TESTING 0x10
#define IMG_STATE_SUCCESS 0x00
#define FLASH_BYTE_ERASED 0xFF
@ -322,7 +321,6 @@ extern "C" {
#define IMG_STATE_UPDATING 0x8F
#define IMG_STATE_TESTING 0xEF
#define IMG_STATE_FINAL_FLAGS 0xBF
#define IMG_STATE_ELF_LOADING 0x70
#define IMG_STATE_SUCCESS 0xFF
#define FLASH_BYTE_ERASED 0x00
#define FLASH_WORD_ERASED 0x00000000UL

View File

@ -149,7 +149,7 @@ int elf_load_image_mmu(uint8_t *image, uintptr_t *entry, elf_mmu_map_cb mmu_cb)
return 0;
}
#endif /* MMU */
#endif /* MMU || WOLFBOOT_FSP || ARCH_PPC */
int elf_open(const unsigned char *ehdr, int *is_elf32)
{
@ -281,7 +281,7 @@ int elf_store_image_scattered(const unsigned char *hdr, unsigned long *entry_out
}
return 0;
}
#endif
#endif /* !defined(MMU) && !defined(WOLFBOOT_FSP) && !defined(ARCH_PPC) && defined (WOLFBOOT_ELF_SCATTERED) */
int elf_load_image(uint8_t *image, uintptr_t *entry, int ext_flash)

View File

@ -0,0 +1,49 @@
/* app_sim_scattered.c
*
* Test bare-metal boot-led-on application
*
* Copyright (C) 2025 wolfSSL Inc.
*
* This file is part of wolfBoot.
*
* wolfBoot is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include "target.h"
#include "wolfboot/wolfboot.h"
#ifdef TARGET_sim
__attribute__((section(".r3text")))
int do_cmd(const char *cmd)
{
/* Do nothing */
return 0;
}
__attribute__((section(".r2text")))
int do_exec_cmd(char *name)
{
return do_cmd(name);
}
__attribute__((section(".r1text")))
int main(int argc, char *argv[]) {
do_exec_cmd((void *)0);
return 0;
}
#endif /** TARGET_sim **/

View File

@ -0,0 +1,28 @@
ENTRY(main)
SECTIONS
{
. = 0x100000;
__r1_start = .;
.r1text : { *(.r1text) }
.r1data : { *(.r1data) }
__r1_end = .;
. = 0x140000;
__r2_start = .;
.r2text : { *(.r2text) }
.r2data : { *(.r2data) }
__r2_end = .;
. = 0x180000;
__r3_start = .;
.r3text : { *(.r3text) }
.r3data : { *(.r3data) }
.text : { *(.text*) }
.rodata : { *(.rodata*) }
__r3_end = .;
PROVIDE(__image_start = 0x100000);
PROVIDE(__image_end = .);
}