Home > other >  Sincerely ask how stm32 burning stick of new self-study program IO chip output didn't change
Sincerely ask how stm32 burning stick of new self-study program IO chip output didn't change

Time:10-06

STM to complete the graduation design of new self-study, from the smallest system of online bought a stm32f103c8t6 version began





Using STM32 ST LINK Utility burn hex file three startup mode of the jumper cap shapes such as B0 empty B0 +
B1 - empty B1 +
This way I have always been a B0 - empty
B1 - empty
So attached to (flash) ought to be here is not very understand hope great god knows something about the main problems in the following
Then write a program that is the result of a serial port communication found that there has been no response after burn in, so I tried to IO mouth level light small lamp bead program,
No reaction, for example, clearly want to light up A1, A1 mouth to light bead is not on, the strange thing is A12 mouth not to make any configuration, it has been lit, A12 A15 below light bead slightly on foot, no matter how to configure other pin writing software should show no effect to burn is burning successfully which is A15 figure

This is the figure of burning software

The following is the main code
Void GPIO_Configuration (void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd (RCC_APB2Periph_USART1, ENABLE);
RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB2PeriphClockCmd (RCC_APB2Periph_AFIO, ENABLE);
GPIO_InitStructure. GPIO_Pin=GPIO_Pin_9;
GPIO_InitStructure. GPIO_Speed=GPIO_Speed_50MHz;
GPIO_InitStructure. GPIO_Mode=GPIO_Mode_AF_PP;
GPIO_Init (GPIOA, & amp; GPIO_InitStructure);//e? 3? Oy??

GPIO_InitStructure. GPIO_Pin=GPIO_Pin_10;
GPIO_InitStructure. GPIO_Mode=GPIO_Mode_IPU;//GPIO_Mode_IN_FLOATING;
GPIO_Init (GPIOA, & amp; GPIO_InitStructure);



GPIO_InitStructure. GPIO_Pin=GPIO_Pin_1 | GPIO_Pin_8;//the LED GPIO_Pin_All
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_Init (GPIOA, & amp; GPIO_InitStructure);
}


Int main (void)
{
GPIO_Configuration ();
While (1)
{
SystemInit ();
GPIO_SetBits (GPIOA, GPIO_Pin_1 | GPIO_Pin_8);
delay_ms(500);
//GPIO_ResetBits (GPIOA, GPIO_Pin_12);
//delay_ms (500);
}
}
Don't know, because just learning, feel the reuse of pin, or is that set up the 72 MHZ with MDK compile time or 8 hz don't know the feeling is likely to be a problem or just is the board working confused
Consult everybody, what wrong?

CodePudding user response:

The name SystemInit this shouldn't be in the while loop

CodePudding user response:

Feel on the first floor says, the systeminit () in the loop outside a try?
Using GPIO, in addition, the light is no need to open the reuse of functional clock the RCC_APB2PeriphClockCmd (RCC_APB2Periph_AFIO, ENABLE);

CodePudding user response:

And on and on, you this is to realize the LED flashing function?
Then you should connect your leds which GPIO 500 ms level flip a,
You first buy 1 A1, A8, s A12, what is the meaning of this? This flashing light is impossible!!!!

CodePudding user response:

Feel the bosses made it very clear

CodePudding user response:

Good good not coarse

CodePudding user response:

The system clock configuration, a peripheral configuration (GPIO interrupt, UART, etc.) only need a operation, such as need to be placed outside the loop, also check is there any configuration system clock in SystemInit function,

CodePudding user response:

Error code, the loop body
  • Related