@@ -611,6 +611,24 @@ def updateMDFile(md_file, serie, version):
611611 print (regexmd_up .sub (rf"\g<1>{ version } " , line ), end = "" )
612612
613613
614+ def updateOpenAmp ():
615+ print ("Updating OpenAmp Middleware" )
616+ repo_path = repo_local_path / repo_core_name
617+ if upargs .local :
618+ cube_path = local_cube_path
619+ else :
620+ cube_name = f"{ repo_generic_name } MP1"
621+ cube_path = repo_local_path / cube_name
622+ OpenAmp_cube_path = cube_path / "Middlewares" / "Third_Party" / "OpenAMP"
623+ OpenAmp_core_path = repo_path / "system" / "Middlewares" / "OpenAMP"
624+
625+ # First delete old HAL version
626+ deleteFolder (OpenAmp_core_path )
627+
628+ # Copy new one
629+ copyFolder (OpenAmp_cube_path , OpenAmp_core_path )
630+
631+
614632def updateCore ():
615633 for serie in stm32_list :
616634 if upargs .local :
@@ -713,6 +731,28 @@ def updateCore():
713731 # Apply all related patch if any
714732 applyPatch (serie , HAL_updated , CMSIS_updated , core_path )
715733
734+ if serie == "MP1" :
735+ print (f"Updating { serie } OpenAmp Middleware to Cube { cube_version } ..." )
736+ updateOpenAmp ()
737+ openAmp_commit_msg = (
738+ f"Update OpenAmp Middleware to MP1 Cube version { cube_version } "
739+ )
740+ commitFiles (core_path , openAmp_commit_msg )
741+ print (
742+ "WARNING: OpenAmp MW has been updated, please check whether Arduino implementation:"
743+ )
744+ print (" * cores/arduino/stm32/OpenAMP/mbox_ipcc.h" )
745+ print (" * cores/arduino/stm32/OpenAMP/mbox_ipcc.c" )
746+ print (" * cores/arduino/stm32/OpenAMP/rsc_table.h" )
747+ print (" * cores/arduino/stm32/OpenAMP/rsc_table.c" )
748+ print (" * cores/arduino/stm32/OpenAMP/openamp.h" )
749+ print (" * cores/arduino/stm32/OpenAMP/openamp.c" )
750+ print (" * cores/arduino/stm32/OpenAMP/openamp_conf.h" )
751+ print (" should be updated from Cube project:" )
752+ print (
753+ " --> Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo"
754+ )
755+
716756
717757# Parser
718758upparser = argparse .ArgumentParser (
0 commit comments