@@ -567,6 +567,8 @@ def _generate_cmake_args(self, mlf_extracted_path, options) -> str:
567567 return cmake_args
568568
569569 def generate_project (self , model_library_format_path , standalone_crt_dir , project_dir , options ):
570+ zephyr_board = options ["zephyr_board" ]
571+
570572 # Check Zephyr version
571573 version = self ._get_platform_version (get_zephyr_base (options ))
572574 if version != ZEPHYR_VERSION :
@@ -586,6 +588,11 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec
586588 # Copy boards.json file to generated project.
587589 shutil .copy2 (BOARDS , project_dir / BOARDS .name )
588590
591+ # Copy overlay files
592+ board_overlay_path = API_SERVER_DIR / "app-overlay" / f"{ zephyr_board } .overlay"
593+ if board_overlay_path .exists ():
594+ shutil .copy2 (board_overlay_path , project_dir / f"{ zephyr_board } .overlay" )
595+
589596 # Place Model Library Format tarball in the special location, which this script uses to decide
590597 # whether it's being invoked in a template or generated project.
591598 project_model_library_format_tar_path = project_dir / MODEL_LIBRARY_FORMAT_RELPATH
@@ -597,9 +604,9 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec
597604 os .makedirs (extract_path )
598605 tf .extractall (path = extract_path )
599606
600- if self ._is_qemu (options [ " zephyr_board" ] , options .get ("use_fvp" )):
607+ if self ._is_qemu (zephyr_board , options .get ("use_fvp" )):
601608 shutil .copytree (API_SERVER_DIR / "qemu-hack" , project_dir / "qemu-hack" )
602- elif self ._is_fvp (options [ " zephyr_board" ] , options .get ("use_fvp" )):
609+ elif self ._is_fvp (zephyr_board , options .get ("use_fvp" )):
603610 shutil .copytree (API_SERVER_DIR / "fvp-hack" , project_dir / "fvp-hack" )
604611
605612 # Populate CRT.
@@ -650,7 +657,7 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec
650657 for item in flags :
651658 cmake_f .write (f"target_compile_definitions(app PUBLIC { item } )\n " )
652659
653- if self ._is_fvp (options [ " zephyr_board" ] , options .get ("use_fvp" )):
660+ if self ._is_fvp (zephyr_board , options .get ("use_fvp" )):
654661 cmake_f .write (f"target_compile_definitions(app PUBLIC -DFVP=1)\n " )
655662
656663 self ._create_prj_conf (project_dir , options )
@@ -665,7 +672,7 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec
665672 # Populate src/
666673 src_dir = project_dir / "src"
667674 if options ["project_type" ] != "host_driven" or self ._is_fvp (
668- options [ " zephyr_board" ] , options .get ("use_fvp" )
675+ zephyr_board , options .get ("use_fvp" )
669676 ):
670677 shutil .copytree (API_SERVER_DIR / "src" / options ["project_type" ], src_dir )
671678 else :
0 commit comments