cancel
Showing results for 
Search instead for 
Did you mean: 

Implement an netx-duo-http server on a STM32F429ZIT6 MCU that uses a POST to initialize parameters

DonK
Associate

 I am using STMicroelectronics.X-CUBE-AZRTOS-F4 and STM32CubeIDE to make an NetXDuo HTTP server serve a web page POST from the MCU.   The sample:  "rtos-docs/netx-duo/netx-duo-http/Chapter2" is a minimal implementation. It is not an ST project, and does not adequately explain how to load the HTML from FLASH  (I know how to write the binary web page to FLASH.), but does detail the minimum HTTP server for the application.   I read through the excellent STM paper: "How to implement a webserver in STM32 using NetXDuo" and reviewed the STM NX_WEBSERVER  NUCLEO-F429ZI sample.  I know how to write the binary web page to FLASH.

 

The literature said to use TIM6 as a Time base Source instead of SysTick.  When I run the app, I get a hard fault  in the entry to  the SystemTimerThread, which seems to be automatically created.   Does anyone know how to work around this fault?

 

I am simply looking for the "minimum" implementation of an HTTP server that will handle one POST, any suggestions?

 

3 REPLIES 3
Pavel A.
Evangelist III

So you build this Nx_WebServer example and run it on the Nucleo STM32F429ZI board, and it faults?

Please start from the original project and try to get it "working" as is, before changing anything in the code (timers, html pages etc.). Then carefully compare it with the other non-ST project and merge only the needed differences, without disturbing netx and threadx "base".

 

 

 

DonK
Associate

I can successfully serve a page and POST back to the server.  I extract the values from the POST (they are all valid); now I try to write these values to flash.  I selected Sector 19.  Here is the simplest code I could find to save to flash:    STM32F429ZIT6 MCU

 

#define FLASH_ADDRESS 0x080E0000

uint32_t myData = 1234;

void save_data(uint32_t Address,uint32_t data){

HAL_FLASH_Unlock();

FLASH_EraseInitTypeDef EraseInitStruct;

EraseInitStruct.NbSectors = 1;

EraseInitStruct.Sector = 19;

EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;

EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;

 

uint32_t PageError;

if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK) //Erase the Page Before a Write Operation

{

//return HAL_ERROR;

}

HAL_Delay(50);

HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD,Address,(uint64_t)data);

HAL_Delay(50);

HAL_FLASH_Lock();

}

 

No errors are thrown.

Can you think of a reason that this should not save a uint32_t value to 0x080E0000 ?

I have tried many more sophisticated versions and they don't work either.

Pavel A.
Evangelist III

If nothing works - time to return to the basics. Find a suitable flash programming example in the Cube package, build and run. Should work.