You haven’t told us the target board name. Mbed 2 supports:
ARCH_BLE, ARCH_BLE_BOOT, ARCH_BLE_OTA,
ARCH_GPRS, ARCH_LINK, ARCH_LINK_BOOT,
ARCH_LINK_OTA, ARCH_MAX, ARCH_PRO,
ARM_BEETLE_SOC, ARM_CM3DS_MPS2, ARM_IOTSS_BEID,
ARM_MPS2_M0, ARM_MPS2_M0P, ARM_MPS2_M3,
ARM_MPS2_M4, ARM_MPS2_M7, B96B_F446VE,
BLACKPILL, BLUEPILL, BLUEPILL_F103C8,
CY8CKIT_062_4343W, CY8CKIT_062_BLE, CY8CKIT_062_WIFI_BT,
CY8CPROTO_062_4343W, CYW943012P6EVB_01, DELTA_DFBM_NQ620,
DELTA_DFCM_NNN40, DELTA_DFCM_NNN40_BOOT, DELTA_DFCM_NNN40_OTA,
DELTA_DFCM_NNN50, DELTA_DFCM_NNN50_BOOT, DELTA_DFCM_NNN50_OTA,
DISCO_F051R8, DISCO_F100RB, DISCO_F303VC,
DISCO_F334C8, DISCO_F401VC, DISCO_F407VG,
DISCO_F413ZH, DISCO_F429ZI, DISCO_F469NI,
DISCO_F746NG, DISCO_F769NI, DISCO_L053C8,
DISCO_L072CZ_LRWAN1, DISCO_L475VG_IOT01A, DISCO_L476VG,
DISCO_L496AG, EFM32GG11_STK3701, EFM32GG_STK3700,
EFM32HG_STK3400, EFM32LG_STK3600, EFM32PG12_STK3402,
EFM32PG_STK3401, EFM32WG_STK3800, EFM32ZG_STK3200,
ELEKTOR_COCORICO, ELMO_F411RE, EV_COG_AD3029LZ,
EV_COG_AD4050LZ, FF1705_L151CC, FF_LPC546XX,
FUTURE_SEQUANA, FUTURE_SEQUANA_M0, FUTURE_SEQUANA_M0_PSA,
FUTURE_SEQUANA_PSA, FVP_MPS2_M0, FVP_MPS2_M0P,
FVP_MPS2_M3, FVP_MPS2_M4, FVP_MPS2_M7,
GD32_E103VB, GD32_F307VG, GD32_F450ZI,
GR_LYCHEE, HEXIWEAR, HRM1017,
HRM1017_BOOT, HRM1017_OTA, K20D50M,
K22F, K64F, K66F,
K82F, KL05Z, KL25Z,
KL26Z, KL27Z, KL43Z,
KL46Z, KL82Z, KW24D,
KW41Z, LPC1114, LPC11C24,
LPC11U24, LPC11U24_301, LPC11U34_421,
LPC11U35_401, LPC11U35_501, LPC11U35_501_IBDAP,
LPC11U35_Y5_MBUG, LPC11U37H_401, LPC11U37_501,
LPC11U68, LPC1347, LPC1549,
LPC1768, LPC1768A, LPC1769,
LPC4088, LPC4088_DM, LPC4330_M0,
LPC4330_M4, LPC4337, LPC54114,
LPC546XX, LPC810, LPC812,
LPC824, LPCCAPPUCCINO, LPCMINI,
MAPLEMINI, MAX32600MBED, MAX32620FTHR,
MAX32620HSP, MAX32625MBED, MAX32625NEXPAQ,
MAX32625PICO, MAX32630FTHR, MAXWSNENV,
MBED_CONNECT_ODIN, MCU_LPC4088, MICRONFCBOARD,
MIMXRT1050_EVK, MOTE_L152RC, MTB_ACONNO_ACN52832,
MTB_ADV_WISE_1510, MTB_ADV_WISE_1530, MTB_ADV_WISE_1570,
MTB_LAIRD_BL600, MTB_LAIRD_BL652, MTB_LAIRD_BL654,
MTB_MTS_DRAGONFLY, MTB_MTS_XDOT, MTB_MURATA_ABZ,
MTB_MURATA_WSM_BL241, MTB_MXCHIP_EMW3166, MTB_RAK811,
MTB_UBLOX_NINA_B1, MTB_UBLOX_ODIN_W2, MTB_USI_WM_BN_BM_22,
MTM_MTCONNECT04S, MTM_MTCONNECT04S_BOOT, MTM_MTCONNECT04S_OTA,
MTS_DRAGONFLY_F411RE, MTS_DRAGONFLY_L471QG, MTS_GAMBIT,
MTS_MDOT_F405RG, MTS_MDOT_F411RE, NCS36510,
NRF51822, NRF51822_BOOT, NRF51822_OTA,
NRF51822_Y5_MBUG, NRF51_DK, NRF51_DK_BOOT,
NRF51_DK_LEGACY, NRF51_DK_OTA, NRF51_DONGLE,
NRF51_DONGLE_BOOT, NRF51_DONGLE_LEGACY, NRF51_DONGLE_OTA,
NRF51_MICROBIT, NRF51_MICROBIT_B, NRF51_MICROBIT_BOOT,
NRF51_MICROBIT_B_BOOT, NRF51_MICROBIT_B_OTA, NRF51_MICROBIT_OTA,
NRF52840_DK, NRF52_DK, NUCLEO_F030R8,
NUCLEO_F031K6, NUCLEO_F042K6, NUCLEO_F070RB,
NUCLEO_F072RB, NUCLEO_F091RC, NUCLEO_F103RB,
NUCLEO_F207ZG, NUCLEO_F302R8, NUCLEO_F303K8,
NUCLEO_F303RE, NUCLEO_F303ZE, NUCLEO_F334R8,
NUCLEO_F401RE, NUCLEO_F410RB, NUCLEO_F411RE,
NUCLEO_F412ZG, NUCLEO_F413ZH, NUCLEO_F429ZI,
NUCLEO_F439ZI, NUCLEO_F446RE, NUCLEO_F446ZE,
NUCLEO_F746ZG, NUCLEO_F756ZG, NUCLEO_F767ZI,
NUCLEO_H743ZI, NUCLEO_L011K4, NUCLEO_L031K6,
NUCLEO_L053R8, NUCLEO_L073RZ, NUCLEO_L152RE,
NUCLEO_L432KC, NUCLEO_L433RC_P, NUCLEO_L476RG,
NUCLEO_L486RG, NUCLEO_L496ZG, NUCLEO_L496ZG_P,
NUCLEO_L4R5ZI, NUCLEO_L4R5ZI_P, NUMAKER_IOT_M487,
NUMAKER_PFM_M2351, NUMAKER_PFM_M453, NUMAKER_PFM_M487,
NUMAKER_PFM_NANO130, NUMAKER_PFM_NUC472, NZ32_SC151,
OC_MBUINO, OSHCHIP, RAPIDIOT_K64F,
RAPIDIOT_KW41Z, RBLAB_BLENANO, RBLAB_BLENANO2,
RBLAB_BLENANO_BOOT, RBLAB_BLENANO_OTA, RBLAB_NRF51822,
RBLAB_NRF51822_BOOT, RBLAB_NRF51822_OTA, RDA5981X,
REALTEK_RTL8195AM, RO359B, RZ_A1H,
RZ_A1XX, SAKURAIO_EVB_01, SAMD21G18A,
SAMD21J18A, SAMG55J19, SAML21J18A,
SAMR21G18A, SARA_NBIOT_EVK, SDT32620B,
SDT32625B, SDT51822B, SDT52832B,
SDT64B, SEEED_TINY_BLE, SEEED_TINY_BLE_BOOT,
SEEED_TINY_BLE_OTA, SILICA_SENSOR_NODE, SSCI824,
STEVAL_3DP001V1, STM32F103RC, STM32F103VE,
STM32F407VE, TB_SENSE_1, TB_SENSE_12,
TEENSY3_1, TMPM066, TMPM3H6,
TMPM3HQ, TMPM46B, TMPM4G9,
TT_M3HQ, TY51822R3, TY51822R3_BOOT,
TY51822R3_OTA, UBLOX_C027, UBLOX_C030_N211,
UBLOX_C030_R410M, UBLOX_C030_R412M, UBLOX_C030_R41XM,
UBLOX_C030_U201, UBLOX_EVA_NINA, UBLOX_EVK_NINA_B1,
UBLOX_EVK_ODIN_W2, UBRIDGE, UNO_91H,
USENSE, VBLUNO51, VBLUNO51_BOOT,
VBLUNO51_LEGACY, VBLUNO51_OTA, VBLUNO52,
VK_RZ_A1H, WALLBOT_BLE, WALLBOT_BLE_BOOT,
WALLBOT_BLE_OTA, WIO_3G, WIO_BG96,
WIZWIKI_W7500, WIZWIKI_W7500ECO, WIZWIKI_W7500P,
XADOW_M0, XBED_LPC1768, XDOT_L151CC