cancel
Showing results for 
Search instead for 
Did you mean: 

Threads dont work again after NVIC_SystemReset

ismail fatih iltar
Associate II
Posted on June 05, 2018 at 13:35

Hi, My system is stm32f746 + lwip + ethernet(phy=lan8742A).

and i have 3 threads in my program. 1 for gpio control(blinky led etc.), 1 for httpd webserver and 1 for catching udp packages.

sys_thread_new('HTTPD', httpd_server_thread, NULL, 128, osPriorityRealtime)

sys_thread_new('DATASERVER', data_server_thread, NULL, 1024, osPriorityRealtime );

sys_thread_new('GPIOCONTROL', gpio_control_thread, NULL, 128, osPriorityIdle );

The system works well on STM32F7 Disco board. On my pcb When i powered up, it works well too. But when i call

NVIC_SystemReset

after reset just gpio thread works. ethernet threads blocked (same program isnt locked after reset at disco board). If I reenergized my pcb, it starts to work again. I know the explanation is too generic but i need any idea about it. Because it's ridiculous error. and i have not logical idea about the reason.

#lwip #threads #webserver #freertos+tcp #ethernet-stm32f7
12 REPLIES 12
Posted on June 12, 2018 at 08:14

I didnt understand exactly.

osSemaphoreRelease(s_xSemaphore);

  is in interrput and it never called ı cant check the return :\ But as you say my initialize function 

MX_LWIP_Init()

which has 

HAL_ETH_MspInit(heth);

function to initialize interrupt with

/* Peripheral interrupt init */

HAL_NVIC_SetPriority(ETH_IRQn, 5, 0);

HAL_NVIC_EnableIRQ(ETH_IRQn);

calls before the creating tasks. ı added some delay after LWIP_init but still doesnt work 

Posted on June 12, 2018 at 16:15

If my idea is right (and it is just an idea based on encountering a similar situation) a delay won't help.  The interrupt enable call shouldn't be done until the task has completed its initialization.

ismail fatih iltar
Associate II
Posted on June 13, 2018 at 10:45

Thank you so much for your replies. But problem is a bit changed. and i think it is not about NVIC_Reset. The problem is about initialization of phy or something like that. So I transferred problem to

https://community.st.com/0D50X00009XkYbFSAV

topic.