Skip to content

Conversation

@extinguish
Copy link

@extinguish extinguish commented Nov 28, 2025

Summary

Since the directory structure of the examples/elf project has been reorganized, the corresponding ROMFS_IMAGEFILE path also needs to be adjusted.
this pull request is depends on: apache/nuttx-apps#3224

Impact

has no impact on non-elf operations

Testing

  1. has passed the ostest:
End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena     4000000  4000000
ordblks         5        4
mxordblk  3e1e5e8  3e70e10
uordblks   17aed0   17aed0
fordblks  3e85130  3e85130

Final memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena     4000000  4000000
ordblks         1        4
mxordblk  3e95de8  3e70e10
uordblks   16a218   17aed0
fordblks  3e95de8  3e85130
user_main: Exiting
ostest_main: Exiting with status 0
stdio_test: Standard I/O Check: fprintf to stderr
  1. elf test
nsh> elf
Initial memory usage: 16416
Registering romdisk at /dev/ram0

Memory Usage after romdisk_register:
  Before:    16416 After:    16480 Change:       64
Mounting ROMFS filesystem at target=/mnt/elf/romfs with source=/dev/ram0

Memory Usage after mount:
  Before:    16480 After:    17776 Change:     1296

****************************************************************************
* Executing errno
****************************************************************************


Memory Usage after exec:
  Before:    17776 After:    22960 Change:     5184
Wait a bit for test completion
Hello, World on stderr
We failed to open "aflav-sautga-ay!" errno is 2
Hello, World on stdout

Memory Usage after program execution:
  Before:    22960 After:    22776 Change:     -184

****************************************************************************
* Executing hello
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    22960 Change:      184
Wait a bit for test completion
Getting ready to say "Hello, world"

Hello, world!
It has been said.

argc	= 1
argv	= 0x1009160
argv[0]	= (0x1009168) "hello"
argv[1]	= 0
Goodbye, world!

Memory Usage after program execution:
  Before:    22960 After:    22776 Change:     -184

****************************************************************************
* Executing signal
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    22984 Change:      208
Wait a bit for test completion
Setting up signal handlers from pid=5
Old SIGUSR1 sighandler at 0
New SIGUSR1 sighandler at 0x2100045d
Old SIGUSR2 sighandler at 0
New SIGUSR2 sighandler at 0x2100045d
Raising SIGUSR1 from pid=5
Kill-ing SIGUSR1 from pid=5
siguser_action: Received signo=10 siginfo=0x1001e88 arg=0
  SIGUSR1 received
siginfo:
  si_signo  = 10
  si_code   = 0
  si_errno  = 4
  si_value  = 0
SIGUSR1 raised from pid=5
SIGUSR1 not received

Memory Usage after program execution:
  Before:    22984 After:    22776 Change:     -208

****************************************************************************
* Executing struct
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    22984 Change:      208
Wait a bit for test completion
Calling getstruct()
getstruct returned 0x21000f7c
  n = 42 (vs 42) PASS
  pn = 0x1008bc8 (vs 0x1008bc8) PASS
 *pn = 87 (vs 87) PASS
  ps = 0x21000f78 (vs 0x21000f78) PASS
  ps->n = 117 (vs 117) PASS
  pf = 0x21000e4d (vs 0x21000e4d) PASS
Calling mystruct->pf()
In dummyfunc() -- PASS
Exit-ing

Memory Usage after program execution:
  Before:    22984 After:    22776 Change:     -208

****************************************************************************
* Executing hello++1
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    22960 Change:      184
Wait a bit for test completion
Hello, World!

Memory Usage after program execution:
  Before:    22960 After:    22776 Change:     -184

****************************************************************************
* Executing hello++2
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    22960 Change:      184
Wait a bit for test completion
main: Started.  Creating MyThingSayer
CThingSayer::CThingSayer: I am!
main: Created MyThingSayer=0x01008a58
main: Calling MyThingSayer->Initialize
CThingSayer::Initialize: When told, I will say 'Hello, World!'
main: Calling MyThingSayer->SayThing
CThingSayer::SayThing: I am now saying 'Hello, World!'
main: Destroying MyThingSayer
CThingSayer::~CThingSayer: I cease to be
CThingSayer::~CThingSayer: I will never say 'Hello, World!' again
main: Returning

Memory Usage after program execution:
  Before:    22960 After:    22776 Change:     -184

****************************************************************************
* Executing hello++3
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    22984 Change:      208
Wait a bit for test completion
CThingSayer::CThingSayer: I am!
main: Started.  MyThingSayer should already exist
main: Calling MyThingSayer.Initialize
CThingSayer::Initialize: When told, I will say 'Hello, World!'
main: Calling MyThingSayer.SayThing
CThingSayer::SayThing: I am now saying 'Hello, World!'
main: Returning.  MyThingSayer should be destroyed

Memory Usage after program execution:
  Before:    22984 After:    22776 Change:     -208

****************************************************************************
* Executing mutex
****************************************************************************


Memory Usage after exec:
  Before:    22776 After:    23016 Change:      240
Wait a bit for test completion
Starting thread 1
Starting thread 2
Stopping threads
	Thread1	Thread2
Loops	11	10
Errors	0	0

Memory Usage after program execution:
  Before:    23016 After:    31416 Change:     8400

****************************************************************************
* Executing pthread
****************************************************************************


Memory Usage after exec:
  Before:    31416 After:    22960 Change:    -8456
Wait a bit for test completion
PARENT: started

PARENT: calling pthread_start with arg=305419896
CHILD: started with arg=305419896
CHILD: returning -2023406815
PARENT child exitted with -2023406815
PARENT returning success


Memory Usage after program execution:
  Before:    22960 After:    27096 Change:     4136

****************************************************************************
* Executing task
****************************************************************************


Memory Usage after exec:
  Before:    27096 After:    23016 Change:    -4080
Wait a bit for test completion
Parent: Started, pid=14
Parent: Calling task_create()
Parent: Waiting for child (pid=20)
Child: execv was successful!
Child: argc=2
Child: argv[0]="child"
Child: argv[1]="Hello from your parent!"
Child: Exit-ting with status=0
Parent: Exit-ing

Memory Usage after program execution:
  Before:    23016 After:    25728 Change:     2712

Memory Usage End-of-Test:
  Before:    25728 After:    25728 Change:        0

Since the directory structure of the examples/elf project
has been reorganized, the corresponding ROMFS_IMAGEFILE path
also needs to be adjusted.

Signed-off-by: guoshichao <[email protected]>
Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a testing concern that this would break ostest. Can you just include some test logs from the H743ZI board that you can still access the ROMFS image after boot?

@linguini1
Copy link
Contributor

I guess the CI is failing because of the dependency on the nuttx-apps PR?

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @extinguish, please fix the CI build problem, looks like similar problem in apache/nuttx-apps#3224 ?

====================================================================================
Configuration/Tool: nucleo-h743zi/elf,CONFIG_ARM_TOOLCHAIN_CLANG
2025-11-28 13:05:33
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
Error: <inline asm>:5:12: error: Could not find incbin file '../../apps/examples/elf/main/elf_romfs.img'
    5 |    .incbin "../../apps/examples/elf/main/elf_romfs.img"
      |            ^
1 error generated.
make[2]: *** [/github/workspace/sources/nuttx/boards/Board.mk:83: stm32_romfs_initialize.o] Error 1
make[2]: Target 'libboard.a' not remade because of errors.
make[1]: *** [Makefile:187: board/libboard.a] Error 2
make[1]: Target 'nuttx' not remade because of errors.
make: *** [tools/Unix.mk:552: nuttx] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize nucleo-h743zi/elf
HEAD detached at pull/17397/merge
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld.tmp

nothing added to commit but untracked files present (use "git add" to track)

@cederom
Copy link
Contributor

cederom commented Nov 28, 2025

I guess the CI is failing because of the dependency on the nuttx-apps PR?

Nope, part in nuttx-apps fails too, something needs a fix, or there is a circular dependency that should not be here :-)

@xiaoxiang781216
Copy link
Contributor

I guess the CI is failing because of the dependency on the nuttx-apps PR?

Nope, part in nuttx-apps fails too, something needs a fix, or there is a circular dependency that should not be here :-)

yes, both patch need be merged together. @cederom

@acassis
Copy link
Contributor

acassis commented Dec 2, 2025

@linguini1 @cederom please remove to change request to let merge this and the apache/nuttx-apps#3224

@linguini1
Copy link
Contributor

@linguini1 @cederom please remove to change request to let merge this and the apache/nuttx-apps#3224

I won't remove my change request until proper test logs are provided.

@xiaoxiang781216
Copy link
Contributor

@linguini1 @cederom please remove to change request to let merge this and the apache/nuttx-apps#3224

I won't remove my change request until proper test logs are provided.

apache/nuttx-apps#3224 already contain the detailed test report, do you want to dup the same info here again?

@linguini1
Copy link
Contributor

apache/nuttx-apps#3224 already contain the detailed test report, do you want to dup the same info here again?

Yes. All PR descriptions must contain testing information. Ostest test also isn't a sufficient test for this change, as I commented earlier.

@extinguish
Copy link
Author

@linguini1 @cederom please remove to change request to let merge this and the apache/nuttx-apps#3224

I won't remove my change request until proper test logs are provided.

the test log has been updated at the pull request comments

@linguini1 linguini1 dismissed their stale review December 3, 2025 06:49

Test logs provided!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: arm Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants