STM32F103 Working Only After Pressing Reset

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
kdsouza
Posts: 14
Joined: Thu Jul 02, 2015 3:26 pm
Has thanked: 1 time

STM32F103 Working Only After Pressing Reset

Post 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?
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: STM32F103 Working Only After Pressing Reset

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F103 Working Only After Pressing Reset

Post by Giovanni »

Are you loading code/data in RAM using the debugger? it would not be there after a cold reset.

Giovanni
kdsouza
Posts: 14
Joined: Thu Jul 02, 2015 3:26 pm
Has thanked: 1 time

Re: STM32F103 Working Only After Pressing Reset

Post 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
dismirlian
Posts: 65
Joined: Fri Dec 20, 2013 3:59 pm
Has thanked: 1 time
Been thanked: 16 times

Re: STM32F103 Working Only After Pressing Reset

Post by dismirlian »

How about the BOOTx pins? Are they at the right levels?
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: STM32F103 Working Only After Pressing Reset

Post by mobyfab »

Do you have a capacitor on the reset pin?

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