Can't Ping Device After Writing to QSPI w/ RTOS
I have full IwIP functionality inside a RTOS task due to this knowledge article:
How to create project for STM32H7 with Ethernet and LwIP stack working
I am able to erase, write, and read the QSPI flash using a BSP_QSPI test function inside main. This causes the IwIP stack to not initialize though. When l relocated the BSP_QSPI test function, to inside the default task, it caused both to stop working. I tried options of separating them into different tasks, changed task priorities, enabled QUADSPI global interrupt and increased heap/stack to no avail.
Hopefully it is just a silly solution l am overlooking.
BSP_QSPI test function:
void qspi_test(){
uint32_t address = 0;
char * writeData = "My Time NEO!";
char data[50] = {};
// Erase sector
BSP_QSPI_EraseBlock(0, address, MT25TL01G_ERASE_4K);
// Write data
BSP_QSPI_Write(0, (uint8_t*)writeData, address, 4096);
// Read data
BSP_QSPI_Read(0, (uint8_t*)data, address, 4096);
printf("QSPI Device: %s\r\n", data);
}
BSP_QSPI Configuration:
BSP_QSPI_Init_t init;
init.InterfaceMode = MT25TL01G_SPI_MODE;
init.TransferRate = MT25TL01G_STR_TRANSFER;
init.DualFlashMode = MT25TL01G_DUALFLASH_DISABLE;
if (BSP_QSPI_Init(0, &init) != BSP_ERROR_NONE)
{
Error_Handler();
}
Task:
void IwIP_init(void *argument)
{
/* init code for LWIP */
MX_LWIP_Init();
/* USER CODE BEGIN 5 */
/* Test erase, write, and read of QSPI module */
qspi_test();
/* Infinite loop */
for(;;)
{
osDelay(1);
}
/* USER CODE END 5 */
}
