Hello, I am working on enc28j60 ethernet, Sending Pings to the network (i have set both ipconfigUSE_DHCP_HOOK and ipconfigUSE_DHCP to 1, as i am using dynamic).
Program is running fine, I am getting Packets on Network but the problem is while running the program after some time( in seconds) It get reset and sometime instead of reset problem i am getting…
@ vApplicationStackOverflowHook
Below I have pasted the Tasks Creation
if (xTaskCreate (vHandlingTask, "Reg2", 700, NULL, 2, &pxCreatedTaskISR))
{
vSendString ("handling task created\n\r");
}
if (xTaskCreate (prvRegTestTaskEntry3, "Reg3", 700, NULL, 1, NULL))
{
vSendString ("Task 3 Created \n\r");
}
Here i am pasting the defination of tasks also…
void
vHandlingTask (void *pvParameters)
{
uint32_t ulInterruptStatus = 0;
for (; ; )
{
// Wait for notification from ISR (similar to binary semaphore)
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
taskENTER_CRITICAL();
prvReceivePacket (NULL, 0);
GPIO_read_pin(9);
taskEXIT_CRITICAL();
}
}
static void
prvRegTestTaskEntry3 (void *pvParameters)
{
/*Although the regtest task is written in assembler, its entry point is
written in C for convenience of checking the task parameter is being passed
in correctly.*/
xPingReplyQueue = xQueueCreate(10, sizeof(unsigned long));
while (1)
{
//vSendPing ("192.168.0.1"); // for static(ipconfigUSE_DHCP=0)
vSendPing ("10.176.18.104"); // for dynamic(ipconfigUSE_DHCP=1)
vTaskDelay (100);
/*The following line will only execute if the task parameter is found to
be incorrect. The check task will detect that the regtest loop counter is
not being incremented and flag an error.*/
}
vTaskDelete ( NULL);
}
Below is external handler
/* ISR */
void
EXTI2_IRQHandler (void)
{
//enc28j60_bfc (EIE, EIE_INTIE); // mask enc28j60 interrupts (not using in vs code)
// volatile uint8_t eir_flags = enc28j60_rcr (EIR);
GPIO_write_pin (9, 0);
volatile BaseType_t xHigherPriorityTaskWoken = pdFALSE;
vTaskNotifyGiveFromISR(pxCreatedTaskISR, &xHigherPriorityTaskWoken);
//xSemaphoreGiveFromISR(sem_done_reading, &xHigherPriorityTaskWoken);
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
should be performed to ensure the interrupt returns directly to the highest
priority task. The macro used for this purpose is dependent on the port in
use and may be called portEND_SWITCHING_ISR(). */
if (xHigherPriorityTaskWoken == pdTRUE)
{
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
In FreeRTOSConfig.h
#define configMINIMAL_STACK_SIZE ( ( uint32_t ) 300)