stm32f7, vPortRaiseBASEPRI

bsoti wrote on Monday, August 29, 2016:

Hello, I want to start ethernet on stm32f7 but task always sticks on one place -
if (inHandlerMode())
{
if (xSemaphoreTakeFromISR(semaphore_id, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else if (xSemaphoreTake(semaphore_id, ticks) != pdTRUE) {
return osErrorOS;
}

, and when I put breakpoint I receive this message:
Program received signal SIGINT, Interrupt.
0x08005352 in vPortRaiseBASEPRI () at C:/Projects/STM32F7/Middlewares/FreeRTOS/Source/Portable/GCC/ARM_CM7/r0p1/portmacro.h:215
215 __asm volatile

Any idea why is that. When I put my code in exmple of ethernet at stm it works fine.

heinbali01 wrote on Monday, August 29, 2016:

I’m not sure where this code comes from.

	if (inHandlerMode())
	{
		if (xSemaphoreTakeFromISR(semaphore_id, &taskWoken) != pdTRUE)
		{
			return osErrorOS;
		}
		portEND_SWITCHING_ISR(taskWoken);
	}
	else if (xSemaphoreTake(semaphore_id, ticks) != pdTRUE)
	{
		return osErrorOS;
	}

It looks like inHandlerMode() returns true if the function is called from an ISR?

Where did you get your NetworkInterface.c from? Does that contain the above code?

bsoti wrote on Monday, August 29, 2016:

NetworkInterface.c I didnt have this file.

int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)
{
  TickType_t ticks;
  portBASE_TYPE taskWoken = pdFALSE;  
  
  
  if (semaphore_id == NULL) {
    return osErrorParameter;
  }
  
  ticks = 0;
  if (millisec == osWaitForever) {
    ticks = portMAX_DELAY;
  }
  else if (millisec != 0) {
    ticks = millisec / portTICK_PERIOD_MS;
    if (ticks == 0) {
      ticks = 1;
    }
  }
  
  if (inHandlerMode()) {
    if (xSemaphoreTakeFromISR(semaphore_id, &taskWoken) != pdTRUE) {
      return osErrorOS;
    }
	portEND_SWITCHING_ISR(taskWoken);
  }  
  else if (xSemaphoreTake(semaphore_id, ticks) != pdTRUE) {
    return osErrorOS;
  }
  
  return osOK;
}

This is whole function. It is in cmsis_os.c

rtel wrote on Monday, August 29, 2016:

There is a pre-configured STM32 Ethernet example here:
http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP-IP_FAT_Examples_ST_STM32F407.html

rtel wrote on Monday, August 29, 2016:

This is whole function. It is in cmsis_os.c

This is not a file that is provided in the official FreeRTOS
distribution. I think it is the CMSIS wrapper provided by ST.

bsoti wrote on Monday, August 29, 2016:

Thank you, I’ll asked ST for more information