Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 9 months ago.
Where can I find the correct file for STM32F030R8T6?
Hi, I must use FreeRTOS on my microcontroller, I found a demo project based on an other board with the same microcontroller (Cortex-M0). It compile and "works" but it doesn't take a real control of my board, for exemple I can't play with led. I think the problem is that i must change the file "stm320518_eval.c" with an other for my board. What do you think? Where can i find the correct file for my board?
1 Answer
10 years, 9 months ago.
So out of curiosity, I modified file stm320518_eval.h under the requirements of Nucleo, compiled this demo in IAR, and on NucleoF030 it seems that it is working properly (in SIMPLE_BLINKY_DEMO mode). This means green led flashes as has been described.
I changed(stm320518_eval.h):
#define LED1_PIN GPIO_Pin_10 #define LED1_GPIO_PORT GPIOC #define LED1_GPIO_CLK RCC_AHBPeriph_GPIOC
to:
#define LED1_PIN GPIO_Pin_5 #define LED1_GPIO_PORT GPIOA #define LED1_GPIO_CLK RCC_AHBPeriph_GPIOA
I tried to edit the file as you said, but I think it is not working properly. Try to edit the file "main-blinky"
#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS )
to:
#define mainQUEUE_SEND_FREQUENCY_MS ( 2000 / portTICK_PERIOD_MS )
it will continue to go to 200, I do not think I really have control of the microcontroller
posted by 28 Nov 2014On my Nucleo (only with modification of the port and pin in stm320518_eval.h) green led blinking slowly (1s on, 1s off, approximately). If I changed in main-blinky.c (value in expression from 200 to 2000) led blinking very slowly (10s on, 10s off, approximately). But I see that in the description specified time is 200ms. Maybe there is a problem with the initiation of the system clock?
posted by 29 Nov 2014Update! Yes, in this demo is error. Missing initialization of system clock, but is no big problem because processor is clocked at the default frequency 8Mhz. But the worst thing is that the variable SystemCoreClock that specifies the clock frequency, is initiated at value 48Mhz and is not updated to the current hardware settings. Therefore, it is wrong to count the time between calls to send queue and toggle led.
But just modify at the beginning of the main function (main.c):
int main( void ) { SystemCoreClockUpdate (); // add this /* Prepare the hardware to run this demo. */ prvSetupHardware();
and:
/* FreeRTOS includes. */ #include "FreeRTOS.h" #include "task.h" #include "system_stm32f0xx.h" // add this
then everything works as it should. Led flashing 200ms on and 200ms off. Exactly.
posted by 29 Nov 2014I uploaded a video to show you the problem! Please let me know what you think!
posted by 29 Nov 2014Very, very strange. :-o You're doing exactly what I did. And clearly this LED flashes different for you than for me.
The only difference is that I use before load, the "Rebuild all" (because once I had a little trouble with use only "Make" in IAR) and loading a program to Nucleo by manualy drag and drop binary file "RTOSDemo.bin" to Nucleo virtual disk, from project path "...FreeRTOSV8.1.2\FreeRTOS\Demo\CORTEX_M0_STM32F0518_IAR\Debug\Exe" (I have a few Nucleo connected simultaneously to PC and by copying I did not confuse who is who). Maybe it?
posted by 29 Nov 2014
When it comes to LEDs difference, is that LED1 at Nucleo is connected to PA_5 and at STM320518-EVAL is connected to PC_10 (not to mention that STM320518-EVAL has 4 LEDs). Ports and pins of LED are defined in stm320518_eval.h. The solution may be to modify this file (if only one LED is used), or connect external LEDs to Morpho pin header on Nucleo, to the same ports and pins as EVAL.
But I'm not sure if there will be other problems. STM32F030R8 and STM32F051R8 is not the same microcontrollers, despite the fact that both are M0.
posted by Nothing Special 28 Nov 2014I uploaded a video to show you the problem! Please let me know what you think!
posted by Francesco Lapiana 29 Nov 2014