nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

kconfig: Add link parameters that can print remaining memory information

Open W-M-R opened this issue 1 year ago • 1 comments

Summary

LD: nuttx Memory region Used Size Region Size %age Used flash: 284272 B 512 KB 54.22% sram1: 13296 B 2 MB 0.63% sram2: 0 GB 2 MB 0.00% CP: nuttx.hex CP: nuttx.bin

Impact

Testing

W-M-R avatar Oct 22 '24 12:10 W-M-R

[Experimental Bot, please feedback here]

The provided PR information is incomplete and does not meet the NuttX requirements.

Here's why:

  • Missing crucial information in the Summary:
    • Reason for change: Is this a fix, update, or new feature?
    • Functionality affected: Which part of the codebase is being modified?
    • How the change works: Provide a clear explanation of the changes made and their effects.
    • Issue/PR references: Link any relevant issues or PRs.
  • Impact section lacks details:
    • All impact points simply state "NO" without providing justification or explaining potential changes.
  • Testing section is insufficient:
    • Missing build host details: Provide specifics about your development environment.
    • Target information is vague: Specify the architecture, board, and configuration used for testing.
    • Testing logs are placeholders: Include actual logs from before and after the change to demonstrate its impact.

To meet NuttX PR requirements, you need to:

  1. Complete the Summary section with specific details about the change.
  2. Thoroughly address each impact point. If an impact is "NO", briefly explain why. If "YES", provide a clear description of the impact.
  3. Provide comprehensive testing information: Include detailed build host and target specifications and replace placeholder logs with actual test output.

nuttxpr avatar Oct 22 '24 12:10 nuttxpr

@W-M-R why don't we just add is by default instead of depending on Kconfig? Every user needs it and we can use it in the CI to warn about board profiles that are reaching the flash limit.

@JorgeGzm see now we have what you was planing to add some time ago

acassis avatar Oct 22 '24 18:10 acassis

@W-M-R why don't we just add is by default instead of depending on Kconfig? Every user needs it and we can use it in the CI to warn about board profiles that are reaching the flash limit.

@JorgeGzm see now we have what you was planing to add some time ago

For example, the "boards/arm64/qemu/qemu-armv8a/scripts/dramboot.ld" link script is written in a way that it is not possible to print out the usage information of each memory, so I did not turn it on by default.It print like:

LD: nuttx Memory region Used Size Region Size %age Used CP: nuttx.hex CP: nuttx.bin

W-M-R avatar Oct 23 '24 02:10 W-M-R

@W-M-R maybe you can just ignore if for boards that doesn't support it. Since it is something that doesn't increase the final binary and it is very useful for all users. Others RTOSes show the memory footprint by default at end of compilation

acassis avatar Oct 23 '24 12:10 acassis

@W-M-R maybe you can just ignore if for boards that doesn't support it. Since it is something that doesn't increase the final binary and it is very useful for all users. Others RTOSes show the memory footprint by default at end of compilation

So is it to enable it by default, or not to rely on any config?

W-M-R avatar Oct 23 '24 12:10 W-M-R

@W-M-R I think we don't even need a config for it, just keep is something expected at the end of the build process, like others RTOSes do

acassis avatar Oct 23 '24 12:10 acassis

LD: nuttx Memory region Used Size Region Size %age Used flash: 284272 B 512 KB 54.22% sram1: 13296 B 2 MB 0.63% sram2: 0 GB 2 MB 0.00% CP: nuttx.hex CP: nuttx.bin

W-M-R avatar Oct 23 '24 13:10 W-M-R

@W-M-R I think we don't even need a config for it, just keep is something expected at the end of the build process, like others RTOSes do

OK

W-M-R avatar Oct 23 '24 13:10 W-M-R

@W-M-R I think you need to ignore the parameter for SIM board/arch:

aarch64-none-elf-g++: error: unrecognized command-line option '--print-memory-usage'
ninja: build stopped: subcommand failed.
cp: cannot stat 'nuttx.hex': No such file or directory
cp: cannot stat 'nuttx.bin': No such file or directory

acassis avatar Oct 23 '24 14:10 acassis

@W-M-R I think you need to ignore the parameter for SIM board/arch:

aarch64-none-elf-g++: error: unrecognized command-line option '--print-memory-usage'
ninja: build stopped: subcommand failed.
cp: cannot stat 'nuttx.hex': No such file or directory
cp: cannot stat 'nuttx.bin': No such file or directory

This may be cmake cannot be used, because the cmake connector is gcc or g++.I removed them from cmake

W-M-R avatar Oct 23 '24 14:10 W-M-R

@W-M-R I think you need to ignore the parameter for SIM board/arch:

aarch64-none-elf-g++: error: unrecognized command-line option '--print-memory-usage'
ninja: build stopped: subcommand failed.
cp: cannot stat 'nuttx.hex': No such file or directory
cp: cannot stat 'nuttx.bin': No such file or directory

This may be cmake cannot be used, because the cmake connector is gcc or g++.I removed them from cmake

You could set the command-line option to "-Wl,--print-memory-usage" in cmake, which pass "--print-memory-usage" as an option to the linker

anchao avatar Oct 24 '24 06:10 anchao

This may be cmake cannot be used, because the cmake connector is gcc or g++.I removed them from cmake

ok, that's right, thanks brother chao.

W-M-R avatar Oct 24 '24 08:10 W-M-R