kamran99kamran wrote on Wednesday, 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 stm32f10x_gpio.h and not stm32f4xx_gpio.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)
{
DAC_SetChannel2Data(DAC_Align_12b_R,2730);
GPIO_WriteBit(GPIOG , GPIO_Pin_12 , Bit_RESET);
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);
}
}