2015-05-30 10:17 PM
Hi,
I am using STM32f10B with STM32f103VGT6 on it. The problem is that the MCU is not working as per the program. It has a fixed GPIO high and they stay in the same state. I tried using coocox and IAR workbench. They do not show any error in the flashing of the code. Even if I erase the memory, I still have the GPIO in the high state. Also, the STM32 util says the memory has been erased. Still, the condition of the GPIO is high. Please help.2015-05-31 08:31 AM
The
http://www.icbase.com/File/PDF/STM/STM30870802.pdf
? Really not much meat here to work with, I don't see any code, I don't see any details of what step-by-step debugging has indicated about what the code is doing vs what it's expected to do. Do you have the BOOTx jumpers set properly to boot the code in FLASH? Have you enabled the clocks and configured the pins correctly?2015-05-31 07:26 PM
2015-05-31 08:42 PM
Ok, but I'm working in a bit of a vacuum here. Can you cite exactly the code source here (link or attached) so I can look at it? Understand this is a very old board, and I work with 100's of code examples, one blinky example means very little to me. Your posts need to convey enough salient information that I don't have to spend time tracking down details for myself.
Can you double check the BOOTx switches (SW1/SW2)? These would impact directly if your code gets run, or not. Confirm the correct board has been selected for the project/build, and double check the right GPIO's are being used for the LED's as described in the board manual.2015-06-01 07:53 PM
Hi Clive,
Please see the code below #include <stm32f10x_gpio.h> #include <stm32f10x_rcc.h> int main(void) { GPIO_InitTypeDef gpio; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); GPIO_StructInit(&gpio); gpio.GPIO_Pin = GPIO_Pin_10; // Green LED gpio.GPIO_Mode = GPIO_Mode_Out_PP; gpio.GPIO_Speed = GPIO_Speed_2MHz; GPIO_Init(GPIOA, &gpio); while(1) { GPIO_WriteBit (GPIOA , GPIO_Pin_10 , 1); } } I have checked the boot switches. Everything is as per recommended by the board. The problem is that irrespective of the code, I always have some GPIO pulled up high. Even, if I try to pull them low with the code, nothing is happening.2015-06-02 08:53 AM
Isn't PA10 the USART1_RX line, driven by the RS232 level converter?
What board exactly do you have? Check my manual cite in my first post to the thread. Is this the board you have, or something else? If something else please link to the documentation for your board.The board I'm familiar with has LEDs 1-4 on pins (PC6, PC7, PC8, PC9)