Page 1 of 1

STM32F103 Working Only After Pressing Reset

Posted: Sat Nov 21, 2015 3:13 pm
by kdsouza
Hello Everyone,

I am working on the 2.6 FATFS for F103R Example.

My Code Utilizes Serial 1,2 UART3, SPI2, ADC1 and a few GPIOs. Serial1 is a GPS Modem, Serial2 is the console output for debugging, UART3 is a WiFi modem.

Once I Erase the Chip and Flash My code it works fine ( ST-LINKV2).

Once the Board is powered on, one UART3 Peripheral doesn't work fine. It does 2 operations and then doesn't respond to anything.

Weird issue is, if i Connect the board to a Laptop ( UART2 TX RX and GND), the board works fine after Power off and Power of, but if i disconnect the Laptop, it doesn't work.

Now, If i power the board up, press the reset button, it works fine.

I've check all connections, regulator outputs, everything is in the fine range, no fluctuations, no interference what-so-ever.

Anyone has had this issue before? Where you need to Press the Reset Button after the board is powered on to get the code to work properly?

Re: STM32F103 Working Only After Pressing Reset

Posted: Sat Nov 21, 2015 3:31 pm
by steved
Could it relate to the rise time of your power supply? Can you (at least temporarily) add a switch so that your power supply is definitely at 3.3V before applying it to the processor?

Could be a missing ground/0V connection which the laptop might supply.

Bad joint on the components providing the power up reset circuit on your board.

Re: STM32F103 Working Only After Pressing Reset

Posted: Sat Nov 21, 2015 4:26 pm
by Giovanni
Are you loading code/data in RAM using the debugger? it would not be there after a cold reset.

Giovanni

Re: STM32F103 Working Only After Pressing Reset

Posted: Sat Nov 21, 2015 6:51 pm
by kdsouza
Thanks for the Tips,

Code: Select all

SCB_AIRCR = (AIRCR_VECTKEY | (SCB_AIRCR & (0x700)) | (1 << 2)); // reset


I am doing this after checking if the microcontroller has been on for less than 1sec.

I know this is ugly and crude and what not, but i am in another country testing the setup. :cry: and if i don't get this working, i'l be fed to the lions for sure :D

JK,

Cheers

Re: STM32F103 Working Only After Pressing Reset

Posted: Sun Nov 22, 2015 5:15 pm
by dismirlian
How about the BOOTx pins? Are they at the right levels?

Re: STM32F103 Working Only After Pressing Reset

Posted: Mon Nov 23, 2015 10:37 am
by mobyfab
Do you have a capacitor on the reset pin?

This is needed to let the power stabilize before the mcu turns on.