apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.78k stars 1.15k forks source link

[BUG] Error: Image size (0x5000004c) + trailer (0x630) exceeds requested size 0x150000 #14151

Open metarutaiga opened 1 week ago

metarutaiga commented 1 week ago

Description / Steps to reproduce the issue

LD: nuttx                                                
CP: nuttx.hex
MKIMAGE: NuttX binary
imgtool sign --pad --confirm --align 4 -v 0 -s auto -H 32 --pad-header -S 0x150000 nuttx.hex nuttx.bin
Usage: imgtool sign [OPTIONS] INFILE OUTFILE
Try 'imgtool sign -h' for help.

Error: Image size (0x5000004c) + trailer (0x630) exceeds requested size 0x150000
make: *** [nuttx] Error 2

I found it miss AT > ROM

diff --git a/boards/risc-v/esp32c3/common/scripts/esp32c3_sections.ld b/boards/risc-v/esp32c3/common/scripts/esp32c3_sections.ld
index cc2661327c..485f24a7f8 100644
--- a/boards/risc-v/esp32c3/common/scripts/esp32c3_sections.ld
+++ b/boards/risc-v/esp32c3/common/scripts/esp32c3_sections.ld
@@ -451,7 +451,7 @@ SECTIONS
   {
     . = ALIGN(4);
     *(.rtc.literal .rtc.text)
-  } >rtc_iram_seg
+  } >rtc_iram_seg AT > ROM

   /* RTC BSS section. */

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS

NuttX Version

12.7.0

Issue Architecture

[Arch: risc-v]

Issue Area

[Area: Build System]

Verification

acassis commented 1 week ago

@fdcavalcanti @tmedicci @eren-terzioglu please take a look ^

fdcavalcanti commented 1 week ago

Thanks for reporting. This was addressed for C6 already on #13795. We'll check on C3.

fdcavalcanti commented 21 hours ago

Hi @metarutaiga please give us details on how to reproduce the issue. Which defconfig you used, steps, all that.

metarutaiga commented 15 hours ago
./tools/configure.sh esp32c3-generic:sta_softap
make menuconfig # Enable MCUboot-bootable format (ESPRESSIF_BOOTLOADER_MCUBOOT)
make

and some codes must be patch like this

diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c
index 2f8f280d5..d53a33c38 100644
--- a/netutils/dhcpd/dhcpd.c
+++ b/netutils/dhcpd/dhcpd.c
@@ -516,7 +516,7 @@ static in_addr_t dhcpd_allocipaddr(void)
       lease = dhcpd_findbyipaddr(ipaddr);
       if ((!lease || dhcpd_leaseexpired(lease)))
         {
-#ifdef CONFIG_CPP_HAVE_WARNING
+#ifdef CONFIG_CPP_HAVE_WARNING_PASS
 #  warning "FIXME: Should check if anything responds to an ARP request or ping"
 #  warning "       to verify that there is no other user of this IP address"
 #endif