We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am an old programmer (65) and I want to learn how to work with STM32. I live within 10km from ST plants in Crolles (France).Target is to be able to drive signals on a 7' railway layout
English is not my natural language.
For my first step, I bought a STM32F750 Discovery kit. I put in the usb cable and ... it works. I can use the demo apps.
My first question is : can I build a new small program and send it to the board WITHOUT destroying the default apps ?
Second question : when I installed Keil compiler, there was a 'pack installer' window. I could'nt find STM32F750 Discovery kit in it. Can I find it somewhere or do I have to use a 'similar' kit ?
Thanks in advance
Jean
private message for Andy : I’m stubborn and I will succeed !!!
I have another question. I try to understand the GPIO toggle button example. In main.c there is a reference to GPIO_PIN_1. I am unable to see where it is defined !
What do I missed ?
STM32F7xx_hal_gpio.h
I am back after a hard work month.
here is the simple code I want to run. Questions are underneath.
/* We should never get here as control is now taken by the scheduler */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) {/* si on appuie sur le bouton, le clignotement est plus rapide */ if (HAL_GPIO_ReadPin(bouton_poussoir_GPIO_Port, bouton_poussoir_Pin)) { HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1); /* Insert delay 400 ms */ HAL_Delay(400); } else { HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1); /* Insert delay 1000 ms */ HAL_Delay(1000); } /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ }
questions :
As I wanted to go further in the future, I asked Keil to include RTOS.
What means the first two lines : the while(1) wille never be executed ?
My first attempt to build the project gave errors about configENABLE_TRUSTZONE (#35: #error directive: configENABLE_TRUSTZONE must be defined in FreeRTOSConfig.h.). It is defined in FreeRTOS.h !!!! I haven't understand what trustzone safety is. May I turn it off ?
Second attempt gave me 137 errors. Most of them concern configASSERT: why ? :
../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c(106): error: #18: expected a ")" configASSERT( xSize == sizeof( EventGroup_t ) );
Best regards
Hi Andy,
like this ? ;-)
/* We should never get here as control is now taken by the scheduler */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { // is this while executed ? /* si on appuie sur le bouton, le clignotement est plus rapide */ if (HAL_GPIO_ReadPin(bouton_poussoir_GPIO_Port, bouton_poussoir_Pin)) { HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1); /* Insert delay 400 ms */ HAL_Delay(400); } else { HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1); /* Insert delay 1000 ms */ HAL_Delay(1000); } /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */
After a lot of works, I found a '}' that was not linked to a '{' in the small program I wrote in main.c (I think because of a bad use of copy / paste). I removed this } and all the errors are gone.
So I got a hex file that I downloaded to the board via CubeProgrammer. It has done something because, now, the screen is empty (no demo) but my simple program doesn't start ... In fact, I wanted to 'blink' led1 and it stay on.
PS Happy new year to everyone !
I don't know if it is the only thing that fixed this issue, but when i set optimization level to 0, the LED1 blinked !
When changing the optimisation level "breaks" code, it is (almost?) invariable the code that is flawed.
It most likely means that you are relying upon something that you should not.
A common example is not having 'volatile' where required.
Another is trying to rely upon the execution time of code.
https://www.avrfreaks.net/forum/tutcoptimization-and-importance-volatile-gcc - although focussed on GCC & AVR, it is general.