STM32H7A3ZIT6 Custom Board Exporting and Compiling

Hello,

I am currently trying to compile my custom board with stm32H7A3ZIT6 mcu. I am able to build my project in Mbed Studio with my custom target setup and it works properly when I flash my board. I run into problems when trying to use mbed cli and export my project to use gcc_arm compiler.

When trying to buiild my project I run into this error.

#21 2.627 make[1]: *** No rule to make target ‘TARGET_CUSTOM_H7A3ZI/PeripheralPins.o’, needed by ‘mcu.elf’. Stop.
#21 2.627 make[1]: *** Waiting for unfinished jobs…
#21 2.632 Compile: DebounceIn.cpp
#21 5.834 In file included from …/./mbed-os/targets/TARGET_STM/device.h:38,
#21 5.834 from …/./mbed-os/hal/include/hal/ticker_api.h:25,
#21 5.834 from …/./mbed-os/connectivity/netsocket/include/netsocket/SocketStats.h:25,
#21 5.834 from …/./mbed-os/connectivity/netsocket/include/netsocket/InternetSocket.h:31,
#21 5.834 from …/./mbed-os/connectivity/netsocket/include/netsocket/UDPSocket.h:24,
#21 5.834 from …/./mbed-os/connectivity/netsocket/include/netsocket/nsapi.h:43,
#21 5.834 from …/./mbed-os/mbed.h:27,
#21 5.834 from …/DebounceIn.cpp:1:
#21 5.834 …/./mbed-os/targets/TARGET_STM/TARGET_STM32H7/objects.h:22:10: fatal error: PinNames.h: No such file or directory
#21 5.834 22 | #include “PinNames.h”
#21 5.834 | ^~~~~~~~~~~~
#21 5.834 compilation terminated.
#21 5.849 make[1]: *** [/home/Makefile:1967: DebounceIn.o] Error 1
#21 5.851 make: *** [Makefile:26: all] Error 2

I have a directory in the root folder of my project named TARGET_CUSTOM_H7A3ZI that contains the necessary files to be refrerenced (PinNames.h, PeripheralPins.c, CMakeLists.txt) for the mcu of my custom board. However, when I use mbed export, the generated Makefile does not seem to source the PinNames.h file properly when I try to compile. I am relatively new to Mbed and embedding programming in general, any help would be much appreciated. Thank you in advance.

In addition I am getting this error.

make[1]: *** No rule to make target ‘TARGET_CUSTOM_H7A3ZI/PeripheralPins.o’, needed by ‘mcu.elf’. Stop.