cancel
Showing results for 
Search instead for 
Did you mean: 

Reset of the controller

JDesi.1
Associate II

Very new to ST and struggling to understand the basics. As posted in previous posts i am using the STSPIN3201 motor controller, i am trying to write the basic LED toggling program. From STSPIN32F0 data sheet i found the micro used is STM32F031C6. I created a small project selecting the micro, but i am observing micro reset. How do i rectify? Please help.

0693W00000NrRvqQAF.jpg0693W00000NrRw5QAF.jpg0693W00000NrRwFQAV.jpg 

11 REPLIES 11
Peter BENSCH
ST Employee

What is your definition for GreenLed_Pin?

Why are you OR it with GPIO_PIN_1?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I have defined two output ports as shown below, but i have not done any OR operation, the code is generated automatically. i have defined the green led as below.

0693W00000NrS9xQAF.jpg 

OK, the line with GreenLed_Pin|GPIO_PIN_1 is the initialization of the two port pins.

But what special reason is there that you defined PB0 for the LED, when PB0 of the internal STM32F031C6 is neither connected nor led out?

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

The main idea is to run the 3 phase motor control software, but when i observed it is resetting, i thought of running a simple program in infinite loop without reset. That is the reason i gave sample ports and see if program runs without issue. I have now changed the port pins as per the schematic below but still facing the same issues. Please help me to resolve the issue, where is the issue.0693W00000NrWP6QAN.jpg0693W00000NrWPLQA3.jpg 

Hmm, you want to use port pin PA5 from the STM32F031C6 contained in the STSPIN32F0, but connected to OP3O of the opamp in the STEVAL-SPIN3201?

And why have you inserted a circuit with an STM32F103CBT6?

It will be difficult to find a GPIO on the STEVAL-SPIN3201 for the output of a trigger pulse (scope, LED, etc) because all pins are already occupied.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Ok, it is working now, i got the schematics for the STEVAL 3201 from this forum, i am attaching it. In the schematic i find the micro used is STM32F103CBT6. Now i took the proper micro and the PB5 is free. There is no reset happening and enters the while(1) continuously.

0693W00000NrX0WQAV.jpg 

Thank you very much for support.

There are two MCUs on the STEVAL-SPIN3201:

  • STSPIN32F0 (STM32F031C6 + driver and other analogue electronics)
  • STM32F103CBT6.

Well, the STM32F103CBT6 is part of the integrated ST-LINK/V2-1 and actually only serves as a debug interface. If you reprogram it (which is not a simple task), you would at least deprive yourself of the possibility to debug or program the STSPIN32F0.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you very much for that information, now i selected the micro STM32F031C6, i could not find the STSPIN32F0, i think because it is not a micro. Now selected the channels PF0 and PF1 as inputs as per the schematic. I still find the micro reset during the execution of the following C statement

 /* Activate the Pull-up or Pull down resistor for the current IO */
        temp = GPIOx->PUPDR;

Why does it happen? Please help.

0693W00000NrYpaQAF.jpg0693W00000NrYpkQAF.jpg 

The statement in line 2 (from HAL_GPIO_Init() in stm32f0xx_hal_gpio.c) only loads the port configuration into the variable temp, which is actually no reason for a fault or reset. So this is where the debugging starts: look at e.g. the settings for the watchdog (could be activated and hit), the content of the registers at the time of the termination, etc.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.