Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Incompatibel STM32F407 with FreeRTOS Webserver???

Posted by kamran99kamran on March 19, 2014

I am using this Code with FreeRTOS! It does work very good! Too about Task scheduling!

But there is a big Problem, that i need a Demo from FreeRTOS Webserver! this webserver project is working only with stm32f1xx or stm32f2!!! This is, why it will never work with stm32f4xx, what can i do?? Is there truely no solution???

regard Kamran

//Inlcude header files include "stm32f4xx.h" include "FreeRTOS.h" include "task.h" include "math.h" include "stdio.h" include "stdlib.h" include "string.h"

include "stm32f4xx.h" include "stm32f4xxconf.h" include "stm32f4xxusart.h" include "stm32f4xxrcc.h" include "stm32f4xxgpio.h" include "systemstm32f4xx.h" include "FreeRTOSConfig.h" include "stm32f4xxtim.h" include "uart.h"

//Task For Sending Data Via USART static void UsartTask(void *pvParameters) { //..... }

//Initialize GPIO and USART6 void initx(void) { uart_init(9600); }

//Main Function int main(void) { //Call initx(); To Initialize USART & GPIO initx();

//Create Task For LAN
xTaskCreate(UsartTask, (signed char*)"UsartTask", 1024, NULL, tskIDLE_PRIORITY+1, NULL);

//Call Scheduler
vTaskStartScheduler();

}


Incompatibel STM32F407 with FreeRTOS Webserver???

Posted by rtel on March 19, 2014

I would like to help, but I'm afraid I don't understand your question.

You talk about a Webserver, and the comment in the code you posted mentions a LAN, but all the code you have posted is related to a USART.

Where did the code come from? What is it that is not working? Does FreeRTOS run at all on the hardware?

The FreeRTOS kernel will run on any Cortex-M devices, and switching between devices should just be a matter of having the correct linker script as far as the kernel is concerned, although of course the peripherals do vary from device to device.

http://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html http://www.freertos.org/Creating-a-new-FreeRTOS-project.html

Regards.


Incompatibel STM32F407 with FreeRTOS Webserver???

Posted by kamran99kamran on March 19, 2014

Thanks for Reply.

-- Does FreeRTOS run at all on the hardware?

FreeRTOS does run at all on the hardware!

--What is it that is not working?

I'll try, sorry I'm bad in english!

via the JTAG code is implemented only once. The connection will be separated from the JTAG!

But this board has to be connected to LAN ( forever )! Therefore, I need a web server, as I can only enter via webserver on the site, the temperature query! ( not implemented code! )

therefore I need certain files from the FreeRTOS demo! for example: emac.h from the FreeRTOS! But emac.h is not compatible with STM32F4xx because it always calls after this file stm32f10xgpio.h and not stm32f4xxgpio.h!

Or stm32_eth.h from the FreeRTOS This file is again not compatible with STM32F4 but only with stm32f2xx!

This was my problem!

--Where did the code come from?

The code is in this function!

static void UsartTask(void *pvParameters) { DACSetChannel2Data(DACAlign12bR,2730); GPIOWriteBit(GPIOG , GPIOPin12 , BitRESET);

while(1)
{
	int int_Hilfsvariable_Zeit, int_Hilfsvariable_1, int_Hilfsvaribale_2;
	int int_Analogwert_ablesen, int_Temperatur_Abfrage, i, Wahl = 0;
	int int_Zeit_Abfrage;

	do
	{
    /* Programmoptionen anzeigen und Wahl des Benutzers abfragen */
    printf("\n\r");
    printf("Guten Tag\n\r");
    printf("Meine Damen und Herren\n\r");
    printf("Temperaturschrank\n\r");
    printf("0 - Programm beenden\n\r");
    printf("Wievielte Mal soll die Zeitsteuerungen erfolgen???\n\r");
    printf("(max:2) Ihre Entscheidung: \n\r");
    scanf("%i", &Wahl);

    /* nach gewählter Programmoption verzweigen */
    switch(Wahl)
    {		  	
	  	case 1:
	  		GPIO_WriteBit(GPIOG , GPIO_Pin_12 ,  Bit_SET);
	  		int_Temperatur_Abfrage = getInt("Temperatureingabe in Grad:", -60, 180);
	  		printf("\n\r");
				printf("Temperatureingabe: %i\n\r\n\r", int_Temperatur_Abfrage);
	    	int_Zeit_Abfrage = getInt("Zeitdauer in Stunde:", 0, 180);
				printf("%i\r\n", int_Zeit_Abfrage);
				printf("\n\r");
				int_Hilfsvariable_Zeit = int_Zeit_Abfrage * 60;

				for( i=0; i < int_Hilfsvariable_Zeit; i++ ) 
				{
					int_Hilfsvariable_1 =  (-4095) * (int_Temperatur_Abfrage - 180) / 240  ;

					DAC_SetChannel2Data(DAC_Align_12b_R,int_Hilfsvariable_1); // 0...4095 = 3,3....0V = -60.....180
					printf("erwünschte Temperatur: %i\n\r", int_Temperatur_Abfrage);
					printf("erwünscht: %i\n\r", int_Hilfsvariable_1);
					printf("erwünscht: %lf in V\n\r",(float)(int_Hilfsvariable_1 *0.000805));

					int_Analogwert_ablesen = ADC_GetConversionValue(ADC1);
					int_Hilfsvaribale_2 = ( (-240) * int_Analogwert_ablesen / 4095 ) + 180;
					printf("Ist Zustand Temperatur: %i\n\r",int_Hilfsvaribale_2);
					printf("ist Z: %i\n\r", int_Analogwert_ablesen);
					printf("ist Z: %lf in V\n\r\n\r",(float)(int_Analogwert_ablesen *0.000805));
					printf("Noch verbleibend: %i in sec\n\r\n\r", ((int_Hilfsvariable_Zeit - i)) );
					printf("Noch verbleibend: %i in min\n\r\n\r", ((int_Hilfsvariable_Zeit - i)/60) );

					vTaskDelay(1000);
				}
      	break;

      case 2:

      	break;

      case 0:  /* Option Programm beenden */
      	break;

    default: /* falsche Option */
      	printf("\nDas war eine falsche Eingabe!\n\r");
    	break;
		}

		DAC_SetChannel2Data(DAC_Align_12b_R,2730);
		GPIO_WriteBit(GPIOG , GPIO_Pin_12 ,  Bit_RESET);
	}while(Wahl!=0);

	printf("Ende des Program\n\r\n\r");
}
while(1);

} }


Incompatibel STM32F407 with FreeRTOS Webserver???

Posted by rtel on March 19, 2014

I was meaning more from where did you get the code, rather than which function did the code come from. As the function is in German I think I'm safe in thinking the code didn't come from us though. Therefore I would suggest one of three things:

1) Update the code yourself to use the correct peripheral drivers for the new target hardware.

2) Go back to wherever the code originally came from and see if they can assist you in porting to the new hardware.

3) Search the ST website for the STM32 "Demonstration Builder" or "STM32Cube" - both of which I think include a web server that uses FreeRTOS.

Regards.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner