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


FreeRTOS V10.0.1 on STM32F4-Discovery LEDs blinking Hang

Hi members & experitses,

My IDE is Ac6 Systemworkbech:
Eclipse IDE for C/C++ Developers
Version: Neon.3 Release (4.6.3)
Build id: 20170314-1500

My platform is STM32F4-Discovery.

I developed a FreeRTOS V10.0.1 four-thread program to blink the four LEDS on the platform. But those LEDs are not blinking at all, while the problem is able to be debugged.

Following are my source code and the debugging log. I wish you would like to view them and tell me what is wrong in my programming.

Thanks,
Tommy

Source
-----
//******************************************************************************

  1. include
  2. include “stm32f4xx.h”
  3. include “stm32f4_discovery.h” // LED3
  4. include “stm32f4xx_hal_conf.h”
  5. include “stm32f4xx_ll_utils.h”

//******************************************************************************

//******************************************************************************

  1. include “FreeRTOS.h”
  2. include “queue.h”
  3. include “task.h”
  4. include “croutine.h”

//******************************************************************************

void vLedBlinkBlue(void *pvParameters);
void vLedBlinkRed(void *pvParameters);
void vLedBlinkGreen(void *pvParameters);
void vLedBlinkOrange(void *pvParameters);

  1. define STACK_SIZE_MIN 128 /* usStackDepth - the stack size DEFINED IN WORDS.*/


/**
* @brief System Clock Configuration
* The system Clock is configured as follow :
* System Clock source = PLL (HSE)
* SYSCLK(Hz) = 168000000
* HCLK(Hz) = 168000000
* AHB Prescaler = 1
* APB1 Prescaler = 4
* APB2 Prescaler = 2
* HSE Frequency(Hz) = 8000000
* PLL_M = 8
* PLL_N = 336
* PLL_P = 2
* PLL_Q = 7
* VDD(V) = 3.3
* Main regulator output voltage = Scale1 mode
* Flash Latency(WS) = 5
* @param None
* @retval None
*/
static void SystemClock_Config(void)
{
printf(“%s()@%u\n”, FUNCTION, LINE);
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitTypeDef RCC_OscInitStruct;

/* Enable Power Control clock */
__HAL_RCC_PWR_CLK_ENABLE();

/* The voltage scaling allows optimizing the power consumption when the device is
clocked below the maximum system frequency, to update the voltage scaling value
regarding system frequency refer to product datasheet. */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

/* Enable HSE Oscillator and activate PLL with HSE as source */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;
HAL_RCC_OscConfig(&RCC_OscInitStruct);

/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
clocks dividers */
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);

/* STM32F405x/407x/415x/417x Revision Z devices: prefetch is supported */
if (HAL_GetREVID() == 0x1001)
{
/* Enable the Flash prefetch */
__HAL_FLASH_PREFETCH_BUFFER_ENABLE();
}
}

extern void initialise_monitor_handles(void); // dec29tue20

//******************************************************************************
int main(void)
{
initialise_monitor_handles(); // dec29tue20
printf(“%s()@%u\n”, FUNCTION, LINE);
/* jan27wed21
* STM32F4xx HAL library initialization:
* Configure the Flash prefetch, instruction and Data caches
* Configure the Systick to generate an interrupt each 1 msec
* Set NVIC Group Priority to 4
* Global MSP (MCU Support Package) initialization
* jan27wed21 */
HAL_Init();

/* jan27wed21
* Configure the system clock to 168 MHz
* jan27wed21 */
SystemClock_Config();

/* jan27wed21
* HAL_Init() will call HAL_NVIC_SetPriorityGrouping() transparently.
* No need to call again.
* jan27wed21 */
// NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );
// HAL_NVIC_SetPriorityGrouping( NVIC_PriorityGroup_4 );
// HAL_NVIC_SetPriorityGrouping(4); // jan20wed21 temporary fix

BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
BSP_LED_Init(LED5);
BSP_LED_Init(LED6);

xTaskCreate( vLedBlinkBlue, (const char* const)”Led Blink Task Blue”, STACK_SIZE_MIN, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vLedBlinkRed, (const char* const)”Led Blink Task Red”, STACK_SIZE_MIN, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vLedBlinkGreen, (const char* const)”Led Blink Task Green”, STACK_SIZE_MIN, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vLedBlinkOrange, (const char* const)”Led Blink Task Orange”, STACK_SIZE_MIN, NULL, tskIDLE_PRIORITY, NULL );

printf(“%s()@%u\n”, FUNCTION, LINE);
vTaskStartScheduler();
printf(“%s()@%u\n”, FUNCTION, LINE);
}
//******************************************************************************

//******************************************************************************
void vLedBlinkRed(void *pvParameters)
{
// printf(“%s()@%u\n”, FUNCTION, LINE);
for(;;)
{
BSP_LED_Toggle(LED6);
vTaskDelay( 750 / portTICK_RATE_MS );
}
}

void vLedBlinkGreen(void *pvParameters)
{
// printf(“%s()@%u\n”, FUNCTION, LINE);
for(;;)
{
BSP_LED_Toggle(LED4);
vTaskDelay( 250 / portTICK_RATE_MS );
}
}

void vLedBlinkOrange(void *pvParameters)
{
// printf(“%s()@%u\n”, FUNCTION, LINE);
for(;;)
{
BSP_LED_Toggle(LED5);
vTaskDelay( 900 / portTICK_RATE_MS );
}
}

//******************************************************************************
void vLedBlinkBlue(void *pvParameters)
{
// printf(“%s()@%u\n”, FUNCTION, LINE);
for(;;)
{
BSP_LED_Toggle(LED3);
vTaskDelay( 500 / portTICK_RATE_MS );
}
}

void vLedBlinkRed(void *pvParameters)
{
// printf(“%s()@%u\n”, FUNCTION, LINE);
E194: 没有用于替换 ‘#’ 的交替文件名 137,3-17 82%

Console
-------




main()@91
SystemClock_Config()@45
main()@124





Info : halted: PC: 0x08002ba2




Info : halted: PC: 0x08002ba2




Info : halted: PC: 0x08002ba2




Info : halted: PC: 0x08002ba2







Temporary breakpoint 8, main () at ../src/main.c:90
90 initialise_monitor_handles(); // dec29tue20


Breakpoint 2, vTaskDelay (xTicksToDelay=500) at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:1320
1320 if( xAlreadyYielded == pdFALSE ) {

Breakpoint 2, vTaskDelay (xTicksToDelay=750) at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:1320
1320 if( xAlreadyYielded == pdFALSE ) {

Breakpoint 2, vTaskDelay (xTicksToDelay=250) at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:1320
1320 if( xAlreadyYielded == pdFALSE ) {

Breakpoint 2, vTaskDelay (xTicksToDelay=900) at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:1320
1320 if( xAlreadyYielded == pdFALSE ) {

Program received signal SIGINT, Interrupt.
prvIdleTask (pvParameters=0x0) at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:3264
3264 if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists tskIDLE_PRIORITY ) ) > ( UBaseType_t ) 1 )





.....
Program received signal SIGINT, Interrupt.
prvIdleTask (pvParameters=0x0) at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:3241
3241 prvCheckTasksWaitingTermination();




.....
Program received signal SIGINT, Interrupt.
0x080030c4 in prvCheckTasksWaitingTermination () at ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c:3479
3479 while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )