Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists