SMT32F103c8 PWMOUT PA_2

You can remap / redirect it to your pins

Or disable it in mbed_app.json

{
    "target_overrides": {
        "*": {
            "target.console-uart": false
        }
    }
}

Steps bellow are required only for Nucleo-F103 not for BluePhill target.
You will also probably need to uncomment the pin in PeripheralPins.c line 58 for ADC, how I posted in previous post.
Or for testing you can try to add this line to your code, that will override the Peripheral Pins.c.

extern const PinMap PinMap_ADC[] = {
    {PA_0,       ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, 
    {PA_1,       ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, 
	{PA_2,       ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)},
    //rest of ADC pins
	{NC, NC, 0}
};
AnalogIn ain(PA_2);

BR, Jan