Okay... this is a little off topic, as it's a question about this microcontroller, and not the KEIL S/W development tools. But... this part is on the KEIL MCBSTM32 eval board I bought, that has the STM32F101-64 part on it.
My question has to do with how PA9 is configured by default when the micro comes out of reset. Is it an input, or output? I have a tiny program that configures the RCC and waits for the clocks to be ready, then configures a couple of I/O pins on ports A & D, then tries to toggle those pins. That's the whole program.
The problem is that the I/O pins on port D toggle just fine, and all but one of the pins I used on port A toggle just fine. PA9 appears to be stuck low. I know PA9 is not shorted to ground or anything because the Blinky program uses it as a USART TX output, and it works fine for that program.
I haven't configured the UART, so that alternate function shouldn't be controlling that pin. I tried configuring TIM1 so that all channels were configured for input capture, to see if perhaps TIM1_CH2 (which can be on the same pin as PA9) was driving the line, but that didn't seem to have any effect.
When I run the code in the simulator, PA9 appears to be configured properly (as shown in the corresponding peripheral window), and it toggles as expected.
Does anyone know of anything "special" about PA9 that has to be taken into account before it can be used as a GPIO output...?
Thanks!
Hmmm... sounds like it's time for a bug report to KEIL tech support, since the simulator appears to work differently from the chip. When I OR'ed in the bits to make PA9 a push-pull output, the simulator showed that it was properly configured as a push-pull output, but it shouldn't have. I think the simulator may assume that GPIOx_CRH = 0 after reset too!