Hi Anders,

Good catch, I think it is abusing touch for a recompilation.

Could you try this alternative option:

...
BOOT2CFLAGS += -Wl,--no-warn-rwx-segments

BOOT2_STAMP := $(TOPDIR)/.boot_stage2.stamp

$(BOOT2_STAMP): $(BOOT_STAGE2).elf
    $(Q) touch $@

$(BOOT_STAGE2).elf: $(BOOT2SRC)
    $(CC) -nostdlib -T$(ARCHSCRIPT) $(BOOT2CFLAGS) -o $@ $<

$(BOOT_STAGE2).S: $(BOOT_STAGE2).bin
    python3 $(BOOT2DIR)/pad_checksum -s 0xffffffff $< $@

$(BOOT_STAGE2).bin: $(BOOT_STAGE2).elf $(BOOT2_STAMP)
    $(OBJCOPY) -Obinary $< $@

EXTRADELFILE = $(BOOT_STAGE2).*

Just remember to replace the 4 spaces with \t (TAB).

Please let me know if it worked for you, then we can change the code to use
it.

BR,

Alan


On Thu, Jan 22, 2026 at 5:44 PM Anders <[email protected]> wrote:

> Building NuttX for rp2040 touches two files below the pico-sdk directory,
> as can be seen in nuttx/arch/arm/src/rp2040/boot2/Make.defs
> Soon after the (empty) files are used they are deleted.
>
> This obviously fails if there is no write access to the directory where it
> tries to write. For instance if one has installed the pico-sdk-src package
> on Debian or Ubuntu.
>
> What is the need for this method? Is it necessary to have write access to
> the pico-sdk tree?
>
> Btw, similar stuff seem to be in other makefiles elsewhere in the NuttX
> source tree.
>
> Anders

Reply via email to