Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix error in Changes To Build System: Rename src/Makefile. Found by Abdelatif Guettouche. Also, improve formatting.

...

If you forget to do this, memory allocations on the heap probably won't work and your user tasks won't start.

To see why, tools/Config.mk assigns a value to KDEFINE such that the preprocessor symbol __KERNEL__ will be defined when certain source files are compiled. KDEFINE is passed to nested invocations of 'make' as EXTRAFLAGS. If your board's scripts/Make.defs still attempts to use EXTRADEFINES, the preprocessor symbol __KERNEL__ will not be defined in some of the places that it should be. Suppose you're building a FLAT build. In this case, include/nuttx/mm/mm.h will not define MM_KERNEL_USRHEAP_INIT like it should, which will cause nx_start.c not to call up_allocate_heap() at startup. Therefore, any attempt to allocate memory on the heap will fail.

Rename src/Makefile to src/Make.defs and Modify

Rename If your custom board directory is in a board family that uses a 'boards/ARCH/FAMILY/common' directory (such as boards/arm/stm32/commonboards/arm/cxd56xx/common, etc), then you'll need to make two minor changes to your custom board's src/Makefile:

(1) Rename it from src/Makefile to src/Make.defs., and

(2) Near the end of that file, replace this line, which usually appears at the end:

...

If you forget to do this, 'make' will report an error, "no rule to make libboard.a," and the build will fail.

Major Changes to the Build System

...