cancel
Showing results for 
Search instead for 
Did you mean: 

F

Jessy J
Associate II

.

41 REPLIES 41
Posted on May 16, 2018 at 12:24

 ,

 ,

mY QUESTION IS

When I debug I put breakpoint on Hal_Delay . It blocks . when I put pause

to see where it is blocked

it is blocked in list.c file in for loop

/* *** NOTE ***********************************************************

If you find your application is crashing here then likely causes are

listed below. In addition see http://www.freertos.org/FAQHelp.html

<,https://community.st.com/external-link.jspa?url=http%3A%2F%2Fwww.freertos.org%2FFAQHelp.html>,

for

more tips, and ensure configASSERT() is defined!

http://www.freertos.org/a00110.html ♯ configASSERT

<,https://community.st.com/external-link.jspa?url=http%3A%2F%2Fwww.freertos.org%2Fa00110.html%23configASSERT>,

1) Stack overflow -

see http://www.freertos.org/Stacks-and-stack-overflow-checking.html

<,https://community.st.com/external-link.jspa?url=http%3A%2F%2Fwww.freertos.org%2FStacks-and-stack-overflow-checking.html>,

2) Incorrect interrupt priority assignment, especially on Cortex-M

parts where numerically high priority values denote low actual

interrupt priorities, which can seem counter intuitive. See

http://www.freertos.org/RTOS-Cortex-M3-M4.html

<,https://community.st.com/external-link.jspa?url=http%3A%2F%2Fwww.freertos.org%2FRTOS-Cortex-M3-M4.html>,

and the definition

of configMAX_SYSCALL_INTERRUPT_PRIORITY on

http://www.freertos.org/a00110.html

<,https://community.st.com/external-link.jspa?url=http%3A%2F%2Fwww.freertos.org%2Fa00110.html>,

3) Calling an API function from within a critical section or when

the scheduler is suspended, or calling an API function that does

not end in 'FromISR' from an interrupt.

4) Using a queue or semaphore before it has been initialised or

before the scheduler has been started (are interrupts firing

before vTaskStartScheduler() has been called?).

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

for( pxIterator = ( ListItem_t * ) &,( pxList->,xListEnd ),

pxIterator->,pxNext->,xItemValue <,= xValueOfInsertion, pxIterator =

pxIterator->,pxNext ) /*lint !e826 !e740 The mini list structure is used as

the list end to save RAM. This is checked and valid. */

{

/* There is nothing to do here, just iterating to the wanted

insertion position. */

}

}

What shall I correct when it comes to this function . What is the error

please .

2018-05-16 12:21 GMT+02:00 houaida khamila <,houwaydakhemila@gmail.com>,:

Your code and mine are not same because it depends on the KIT STM32 . I am

using STM32F4 ..

>,

for example in my main.c

>,

void SystemClock_Config(void),

static void MX_GPIO_Init(void),

static void MX_ADC1_Init(void),

static void MX_DSIHOST_DSI_Init(void),

static void MX_FMC_Init(void),

static void MX_QUADSPI_Init(void),

//static void MX_SDIO_MMC_Init(void),

static void MX_USART1_UART_Init(void),

static void MX_USB_OTG_FS_PCD_Init(void),

static void MX_USB_OTG_HS_PCD_Init(void),

void StartDefaultTask(void const * argument),

static void MX_NVIC_Init(void),

static void Netif_Config(void),

static void ToggleLED4(void const * argument),

>,

It is not same as yours so I think I wil not be able to use yours right ?

>,

2018-05-16 12:11 GMT+02:00 Artur I <,st-microelectronics@jiveon.com>,:

>,>, STMicroelectronics Community

>,>, <,https://community.st.com/?et=watches.email.thread>,

>,>, Re: How to configure the freertos interruption ?

>,>,

>,>, reply from Artur I

>,>, <,https://community.st.com/people/iwanicki.artur?et=watches.email.thread>,

>,>, in STM32 MCUs Forum - View the full discussion

>,>, <,https://community.st.com/message/197633-re-how-to-configure-the-freertos-interruption?commentID=197633&,et=watches.email.thread ♯ comment-197633>,

>,>,

Artur IWANICKI
ST Employee
Posted on May 16, 2018 at 14:30

You could, but I see no reason why. FreeRTOS has its own delay functions which have completely different role than here. osDelay (vTaskDelay in FreeRTOS API) is used to move the active task to Blocked mode for a certain time giving CPU time to another task from ready group. HAL_Delay function is used to realize delays and timeouts within HAL functions and it should not call osDelay().

Jessy J
Associate II
Posted on May 16, 2018 at 14:30

when I leave it not changed it is blocked here 

while((HAL_GetTick() - tickstart) < wait) 

__weak void HAL_Delay(uint32_t Delay)

{

uint32_t tickstart = HAL_GetTick();

uint32_t wait = Delay;

// Add a freq to guarantee minimum wait

if (wait < HAL_MAX_DELAY)

{

wait += (uint32_t)(uwTickFreq);

}

while((HAL_GetTick() - tickstart) < wait)

{

}

}
Posted on May 16, 2018 at 12:48

 ,

 ,

I was referred to the project of F4 you told me.. but it is always the same

problem blocked in the list.c file in the for loop I sent you.

Can you help me to know what is missed or incorrect ????

Thank you

Le mer. 16 mai 2018 à 12:36, Artur I <,st-microelectronics@jiveon.com>, a

écrit :

STMicroelectronics Community

<,https://community.st.com/?et=watches.email.thread>,

Re: How to configure the freertos interruption ?

reply from Artur I

<,

in STM32 MCUs Forum - View the full discussion

<,https://community.st.com/0D70X000006SqvoSAC

Artur IWANICKI
ST Employee
Posted on May 17, 2018 at 07:20

Hello,

Are you able to identify in which part of the code you are calling HAL_Delay() which is creating an issue, please?

Are you using this functions in task functions:

void StartDefaultTask(void const * argument);

static void ToggleLED4(void const * argument); ?

Would it be possible for you to pass me a table (screenshoot from NVIC view from STM32CubeMX) with NVIC interrupts and its priorities, please?

Thank you in advance,

Best Regards,

Artur

Jessy J
Associate II
Posted on May 17, 2018 at 09:58

I am using these functions as follow 

void StartDefaultTask(void const * argument)

{

/* init code for FATFS */

MX_FATFS_Init();

/* init code for LWIP */

MX_LWIP_Init();

/* USER CODE BEGIN 5 */

/* Initialize tcp echo server */

tcp_echoserver_init();

/* Notify user about the netwoek interface config */

User_notification(&gnetif);

/* Start toogleLed4 task : Toggle LED4 every 250ms */

osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE);

osThreadCreate (osThread(LED4), NULL);

/* Infinite loop */

for(;;)

{

osDelay(1);

}

static void ToggleLed4(void const * argument)

{

/* toggle LED4 each 250ms */

HAL_GPIO_TogglePin(LED4_GPIO_Port, LED4_Pin);

osDelay(250);

}

I have a question . about TIM6 I should re write the void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) . but I did not know how 

Y ou will find attached the NVIC ocnfiguration from STM32cubMX

Thank you in advance0690X0000060KoYQAU.png0690X0000060Kp1QAE.png0690X0000060Kp6QAE.png

Kent Swan
Senior
Posted on May 17, 2018 at 12:05

When using FreeRtos, you should normally be using osDelay().to apply a delay timing within a thread.  osDelay calls vTaskDelay which puts the thread on the delay queue to be reawakened some number of ms from now which permits the kernel to immediately allow another thread to execute. 

This works very well in all cases with the sole exception that FreeRTOS incorrectly handles tick timing management in tickeless low power modes where threads are currently blocked by osDelay.  I've been working on an experimental mod to FreeRTOS which extends the normal tickless sleep method to accommodate threads on the delay queue..

Jessy J
Associate II
Posted on May 17, 2018 at 12:12

I did not understand what you are trying to say .. I am using osDelay as delay for threads but it blocks in HAL_delay function  

in the while loop 

__weak void HAL_Delay(uint32_t Delay)

{

uint32_t tickstart = HAL_GetTick();

uint32_t wait = Delay;

/* Add a freq to guarantee minimum wait */

if (wait < HAL_MAX_DELAY)

{

wait += (uint32_t)(uwTickFreq);

}

while((HAL_GetTick() - tickstart) < wait)

{

}

}
Jessy J
Associate II
Posted on May 17, 2018 at 12:13

when I put break point in the  HAL_TIM_IRQHandler(&htim6);. It does not go to the timer handler.. I checked the NVIC while debug .. all regiters are set to 0x0 .. I think its problem that tim6 does not launch but i am not sure 

what do you think please ? 

Karl Yamashita
Lead III
Posted on May 17, 2018 at 15:46

I've had similar issue using a B-L475E-IOT01A eval board. I was stuck in the HAL-Delay(). It turns out that when i used CubeMX to generate code, that the Clock configuration was not set up correctly. So i would check to make sure your Clock configuration is correct and if you're using the external crystal check with an oscilloscope to see if it is clocking.

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.