cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F10B Eval Programming Issue

shauns87
Associate II
Posted on May 31, 2015 at 07:17

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.
5 REPLIES 5
Posted on May 31, 2015 at 17:31

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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
shauns87
Associate II
Posted on June 01, 2015 at 04:26

Hey Clive! Thanks for the response. I am just trying to run an example code of GPIO blink trying to toggle the LED.

Posted on June 01, 2015 at 05:42

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
shauns87
Associate II
Posted on June 02, 2015 at 04:53

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.

Posted on June 02, 2015 at 17:53

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)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..