Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


[RESOLVED]I can't modifie an main.c file after first compilation

Hello everyone,

My first problem is corrected, (GPIO and TIM library from home STM), after successfully compile and load the programmeTIM_PWM_output, I have tried to change the “main.c” in order to adapt it to my needs. In the loop “while (1) {}” contained in “int main (void)”, i added this:
/*On commence à jouer au con
* -Cablage:
* - TIM2_CH1 : PA.5 (Arduino A4) -->REDLED
- TIM2_CH2 : PA.1 (Arduino A1) -->GREENLED
- TIM2_CH3 : PA.2 (Arduino A7) -->BLUELED
- TIM2_CH4 : PA.3 (Arduino A2) -->

* */
/*On commnce par faire varier la led rouge
* avec les #define PULSEx_VALUE
* On les remplacera par des fonctions d’ incrémentaions par la suite
* */
sConfig.Pulse = PULSE1_VALUE; HAL_Delay(2000);
sConfig.Pulse = PULSE2_VALUE; HAL_Delay(2000);
sConfig.Pulse = PULSE3_VALUE; HAL_Delay(2000);
sConfig.Pulse = PULSE4_VALUE; HAL_Delay(2000);

I have wanted to create a new file.bin, but it doesn’t work, there is there a manipulation to force SW4STM32 so that the modified program is taken into account?

In fact, the IDE does not try to recompile.

If you have tracks to point me, I’d be happy

EDIT:
I forgot to specify that I commented the following lines:
/* Set the pulse value for channel 1 */
// sConfig.Pulse = PULSE1_VALUE;
// if (HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, TIM_CHANNEL_1) != HAL_OK)
// {
/* Configuration Error */
// Error_Handler();
// }

Sorry, bad understing from me,

i dont use sConfig.Pulse for change the duty cycle in the while.

I search what the good variable for do this.


Hello, the problem was solved, to change the duty cycle in the loop “while (1)”
I have proceeded as follows:

while (1)
{
/*On commence à jouer au con
* -Cablage:
* - TIM2_CH1 : PA.5 (Arduino A4) -->REDLED
- TIM2_CH2 : PA.1 (Arduino A1) -->GREENLED
- TIM2_CH3 : PA.2 (Arduino A7) -->BLUELED
- TIM2_CH4 : PA.3 (Arduino A2) -->

* */
/*On commnce par faire varier la led rouge
* avec les #define PULSEX_VALUE
* On les remplacera par des fonctions d’ incrémentaions par la suite
* */
sConfig.Pulse = PULSE1_VALUE;
if (HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, TIM_CHANNEL_1) != HAL_OK)
{
/* Configuration Error */
Error_Handler();
}
if (HAL_TIM_PWM_Start(&TimHandle, TIM_CHANNEL_1) != HAL_OK)
{
/* PWM Generation Error */
Error_Handler();
}
HAL_Delay(2000);

sConfig.Pulse = PULSE2_VALUE;

if (HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, TIM_CHANNEL_1) != HAL_OK)
{
/* Configuration Error */
Error_Handler();
}
if (HAL_TIM_PWM_Start(&TimHandle, TIM_CHANNEL_1) != HAL_OK)
{
/* PWM Generation Error */
Error_Handler();
}
HAL_Delay(2000);

sConfig.Pulse = PULSE3_VALUE;
if (HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, TIM_CHANNEL_1) != HAL_OK)
{
/* Configuration Error */
Error_Handler();
}
if (HAL_TIM_PWM_Start(&TimHandle, TIM_CHANNEL_1) != HAL_OK)
{
/* PWM Generation Error */
Error_Handler();
}
HAL_Delay(2000);

sConfig.Pulse = PULSE4_VALUE;
if (HAL_TIM_PWM_ConfigChannel(&TimHandle, &sConfig, TIM_CHANNEL_1) != HAL_OK)
{
/* Configuration Error */
Error_Handler();
}
if (HAL_TIM_PWM_Start(&TimHandle, TIM_CHANNEL_1) != HAL_OK)
{
/* PWM Generation Error */
Error_Handler();
}
HAL_Delay(2000);

}

I have therefore been able to vary the intensity of my LED.

Thank Skywodd, who brought me the solution.
How to independently change the duty cycle of a PWM channel from the example TIM / TIM_PWMOut