the clock is the first thing that should be checked with a new custom target. For STM devices, there is already a good preparation for choosing different sources like HSE or LSI. The Nucleos use an external clock from the onboard STLink, so HSE must be configured to use a crystal (if included in custom design).
"help": "Mask value : USE_PLL_HSE_EXTC | USE_PLL_HSE_XTAL | USE_PLL_HSI",
"value": "USE_PLL_HSE_XTAL | USE_PLL_HSI",
it maybe necessary also to change the clock frequency. Mbed does some calculations for timer clocks and need to now the main clock frequency, otherwise sleep_for() times would be wrong e.g.
The custom target should also define the correct chip variant. It is used in HAL code and maybe important for some different ressources. You’ll find the device name in mbed-os/tools/arm_pack_manager/index.json.
In many cases, the program will compile with wrong (missing) pinnames, but PinNames.h and PeripheralPins.c should be checked as well. In some cases you’ll find commented lines where more than one alternative function is possible.