STM32F103 PC13 on Output mode not work
Don't know if this is still relevant, given that the question was asked in 2018, but I didn't find a good answer in this thread.
Because the RTC uses the same pin (PC13) for alarm output, you first need to disable RTC output, or configure it to use another pin (PB2/PB14). If using STM32CubeMX, then in rtc.c:
RTC_HandleTypeDef hrtc;    

hrtc.Instance = RTC;
hrtc.Init.AsynchPrediv = 1048575; // can be changed to automatic
hrtc.Init.Output = RTC_OUTPUTSOURCE_NONE; // it's important to set this to none

Also, make sure, that the PC13 gpio is configured correctly, it must be open-drain, pull-up:
void MX_GPIO_Init(void) {
    GPIO_InitTypeDef GPIO_InitStruct = {0};

    __HAL_RCC_GPIOC_CLK_ENABLE();

    HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET); // it has inverted logic and we want it initially off

    GPIO_InitStruct.Pin = GPIO_PIN_13;
    GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
    HAL_GPIO_Init(GPIOC, &amp;GPIO_InitStruct);
}

Now you can run the LED blink task:
void LedTask(void *arguments) {
    for (;;) {
        HAL_GPIO_Toggle(GPIOC, GPIO_PIN_13);
    }
}