From 38a770622c6843e732738fe34ccd3772b4ac160c Mon Sep 17 00:00:00 2001 From: rtel Date: Thu, 6 Feb 2020 18:52:35 +0000 Subject: [PATCH] Update libraries and sundry check-ins ready for the V10.3.0 kernel release. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2817 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../https/common/main.c | 13 ++ .../jobs/jobs_notify_next/main.c | 12 ++ .../FreeRTOS_IoT_Libraries/mqtt/common/main.c | 12 ++ .../shadow/shadow_device_operations/main.c | 12 ++ .../utilities/task_pool/main.c | 17 +++ .../main.c | 13 ++ .../Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c | 2 +- .../Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h | 2 +- .../Source/FreeRTOS-Plus-CLI/History.txt | 2 +- .../mqtt/DemoTasks/SimpleMQTTExamples.c | 108 ++++++++------ .../mqtt/FreeRTOSConfig.h | 32 ++-- .../mqtt/FreeRTOSIPConfig.h | 2 +- .../Demo/FreeRTOS_IoT_Libraries/mqtt/main.c | 9 ++ .../WIN32.vcxproj | 2 - .../main.c | 11 ++ .../CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c | 7 + .../NonSecure/FreeRTOSDemo_ns.uvoptx | 43 +++++- .../NonSecure/FreeRTOSDemo_ns.uvprojx | 18 +-- .../Secure/FreeRTOSDemo_s.uvoptx | 2 +- .../Secure/FreeRTOSDemo_s.uvprojx | 16 +- .../Keil_Specific/RTOSDemo.uvoptx | 2 + .../Keil_Specific/RTOSDemo.uvprojx | 4 +- .../Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c | 2 +- FreeRTOS/Demo/Common/Minimal/AbortDelay.c | 57 +------ FreeRTOS/Demo/Common/Minimal/GenQTest.c | 2 +- .../Demo/Common/Minimal/StreamBufferDemo.c | 8 +- .../.cproject | 2 +- .../FreeRTOSConfig.h | 9 +- .../RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c | 3 +- .../projects/RTOSDemo_ri5cy/.cproject | 3 - .../projects/RTOSDemo_ri5cy/FreeRTOSConfig.h | 5 +- .../FreeRTOSConfig.h | 7 +- .../RISC-V_Renode_Emulator_SoftConsole/main.c | 2 +- .../miv-basic.resc | 2 +- .../WIN32.vcxproj | 6 +- FreeRTOS/Demo/WIN32-MingW/main_full.c | 10 +- FreeRTOS/History.txt | 8 +- FreeRTOS/Source/include/FreeRTOS.h | 1 + FreeRTOS/Source/include/task.h | 38 +---- .../portable/GCC/ARM_CM3_MPU/portmacro.h | 2 +- .../portable/GCC/ARM_CM4_MPU/portmacro.h | 2 +- ...freertos_risc_v_chip_specific_extensions.h | 2 +- FreeRTOS/Source/portable/GCC/RISC-V/port.c | 8 +- FreeRTOS/Source/portable/GCC/RISC-V/portASM.S | 15 +- .../portable/IAR/ARM_CM4F_MPU/portmacro.h | 2 +- ...freertos_risc_v_chip_specific_extensions.h | 2 +- FreeRTOS/Source/portable/IAR/RISC-V/port.c | 6 +- FreeRTOS/Source/portable/IAR/RISC-V/portASM.s | 16 +- FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c | 10 +- .../Source/portable/RVDS/ARM_CM4_MPU/port.c | 4 +- .../portable/RVDS/ARM_CM4_MPU/portmacro.h | 2 +- FreeRTOS/Source/tasks.c | 141 +++--------------- 52 files changed, 359 insertions(+), 359 deletions(-) diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/https/common/main.c b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/https/common/main.c index dd485a67b..a1b0fa5e9 100644 --- a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/https/common/main.c +++ b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/https/common/main.c @@ -305,6 +305,19 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress, } /*-----------------------------------------------------------*/ +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + *(pulNumber) = uxRand(); + return pdTRUE; +} + +/*-----------------------------------------------------------*/ + /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an implementation of vApplicationGetIdleTaskMemory() to provide the memory that is used by the Idle task. */ diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/main.c b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/main.c index e07f2c2eb..f06d37c21 100644 --- a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/main.c +++ b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/main.c @@ -305,6 +305,18 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress, } /*-----------------------------------------------------------*/ +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + *(pulNumber) = uxRand(); + return pdTRUE; +} +/*-----------------------------------------------------------*/ + /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an implementation of vApplicationGetIdleTaskMemory() to provide the memory that is used by the Idle task. */ diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/main.c b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/main.c index 3c531b6d9..0c11b0c1d 100644 --- a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/main.c +++ b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/main.c @@ -314,6 +314,18 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress, } /*-----------------------------------------------------------*/ +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + *(pulNumber) = uxRand(); + return pdTRUE; +} +/*-----------------------------------------------------------*/ + /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an implementation of vApplicationGetIdleTaskMemory() to provide the memory that is used by the Idle task. */ diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/shadow/shadow_device_operations/main.c b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/shadow/shadow_device_operations/main.c index 6b71b1a83..357a2c223 100644 --- a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/shadow/shadow_device_operations/main.c +++ b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/shadow/shadow_device_operations/main.c @@ -306,6 +306,18 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress, } /*-----------------------------------------------------------*/ +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + *(pulNumber) = uxRand(); + return pdTRUE; +} +/*-----------------------------------------------------------*/ + /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an implementation of vApplicationGetIdleTaskMemory() to provide the memory that is used by the Idle task. */ diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/main.c b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/main.c index f7bc12dcb..22f95907c 100644 --- a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/main.c +++ b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/main.c @@ -146,6 +146,23 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress, } /*-----------------------------------------------------------*/ +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + /* This example is the first in a sequence that adds IoT functionality into + an existing TCP / IP project.In this first project the TCP / IP stack is not + actually used, but it is still built, which requires this function to be + present.For now this function does not need to do anything. */ + __debugbreak(); + *(pulNumber) = 0; + return pdFALSE; +} +/*-----------------------------------------------------------*/ + UBaseType_t uxRand( void ) { /* This example is the first in a sequence that adds IoT functionality into diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator/main.c b/FreeRTOS-Labs/Demo/FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator/main.c index a94a1cd54..647469760 100644 --- a/FreeRTOS-Labs/Demo/FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator/main.c +++ b/FreeRTOS-Labs/Demo/FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator/main.c @@ -814,6 +814,19 @@ extern uint32_t ulApplicationGetNextSequenceNumber(uint32_t ulSourceAddress, } /*-----------------------------------------------------------*/ +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + *(pulNumber) = uxRand(); + return pdTRUE; +} + +/*-----------------------------------------------------------*/ + #if( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME != 0 ) const char *pcApplicationHostnameHook( void ) diff --git a/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c b/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c index a9770159c..0e0a75934 100644 --- a/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c +++ b/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c @@ -1,5 +1,5 @@ /* - * FreeRTOS+CLI V1.0.4 + * FreeRTOS+CLI V1.0.x Labs copy * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h b/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h index 12fdd7062..25c239214 100644 --- a/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h +++ b/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h @@ -1,5 +1,5 @@ /* - * FreeRTOS+CLI V1.0.4 + * FreeRTOS+CLI V1.0.x Labs copy * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/History.txt b/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/History.txt index 8c62cf90b..95a613016 100644 --- a/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/History.txt +++ b/FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/History.txt @@ -1,4 +1,4 @@ -Changes between V1.0.3 and V1.0.4 released +Changes between V1.0.3 and TBD + Update to use stdint and the FreeRTOS specific typedefs that were introduced in FreeRTOS V8.0.0. diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/DemoTasks/SimpleMQTTExamples.c b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/DemoTasks/SimpleMQTTExamples.c index 3ad5e662d..80a04169e 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/DemoTasks/SimpleMQTTExamples.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/DemoTasks/SimpleMQTTExamples.c @@ -48,13 +48,15 @@ /** * @brief The timeout for MQTT operations in this example. */ -#define mqttexampleMQTT_TIMEOUT_MS ( 5000 ) +#define mqttexampleMQTT_TIMEOUT_MS ( 50000 ) /** * @brief The MQTT client identifier used in this example. */ #define mqttexampleCLIENT_IDENTIFIER "mqttexampleclient" +const char *pcClientIdentifiers[] = { "AAA" };//, "BBB", "CCC", "DDD", "EEE", "FFF", "GGG", "HHH", "III", "JJJ" }; + /** * @brief Details of the MQTT broker to connect to. * @@ -97,11 +99,6 @@ #define mqttexampleMESSAGE_RECEIVED_BIT ( 1UL << 1UL ) /*-----------------------------------------------------------*/ -/** - * @brief The MQTT connection handle used in this example. - */ -static IotMqttConnection_t xMQTTConnection = IOT_MQTT_CONNECTION_INITIALIZER; - /** * @brief Parameters used to create the system task pool. */ @@ -167,28 +164,28 @@ static void prvExample_OnMessageReceived( void * pvCallbackContext, * * @note This example does not use TLS and therefore will not work with MQTT. */ -static void prvMQTTConnect( void ); +static void prvMQTTConnect( IotMqttConnection_t *xMQTTConnection, const char *pcClientID ); /** - * @brief Subscribes to the topic as specified in mqttexampleTOPIC. + * @brief Subscribes to pcTopicString. */ -static void prvMQTTSubscribe( void ); +static void prvMQTTSubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString ); /** * @brief Publishes a messages mqttexampleMESSAGE on mqttexampleTOPIC topic. */ -static void prvMQTTPublish( void ); +static void prvMQTTPublish( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString ); /** * @brief Unsubscribes from the mqttexampleTOPIC topic. */ -static void prvMQTTUnsubscribe( void ); +static void prvMQTTUnsubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString ); /** * @brief Disconnects from the MQTT broker gracefully by sending an MQTT * DISCONNECT message. */ -static void prvMQTTDisconnect( void ); +static void prvMQTTDisconnect( IotMqttConnection_t xMQTTConnection ); /*-----------------------------------------------------------*/ static void prvExample_OnDisconnect( void * pvCallbackContext, @@ -213,10 +210,10 @@ static void prvExample_OnMessageReceived( void * pvCallbackContext, TaskHandle_t xDemoTaskHandle = ( TaskHandle_t ) pvCallbackContext; /* Ensure that the message is received on the expected topic. */ - configASSERT( pxCallbackParams->u.message.info.topicNameLength == strlen( mqttexampleTOPIC ) ); - configASSERT( strncmp( pxCallbackParams->u.message.info.pTopicName, - mqttexampleTOPIC, - strlen( mqttexampleTOPIC ) ) == 0 ); +// configASSERT( pxCallbackParams->u.message.info.topicNameLength == strlen( mqttexampleTOPIC ) ); +// configASSERT( strncmp( pxCallbackParams->u.message.info.pTopicName, +// mqttexampleTOPIC, +// strlen( mqttexampleTOPIC ) ) == 0 ); /* Ensure that the expected message is received. */ configASSERT( pxCallbackParams->u.message.info.payloadLength == strlen( mqttexampleMESSAGE ) ); @@ -243,24 +240,34 @@ TaskHandle_t xDemoTaskHandle = ( TaskHandle_t ) pvCallbackContext; void vStartSimpleMQTTDemo( void ) { +uint32_t x; +const uint32_t ulMax_x = sizeof( pcClientIdentifiers ) / sizeof( char * ); + /* This example uses a single application task, which in turn is used to * connect, subscribe, publish, unsubscribe and disconnect from the MQTT * broker. */ +for( x = 0; x < ulMax_x; x++ ) +{ xTaskCreate( prvMQTTDemoTask, /* Function that implements the task. */ "MQTTDemo", /* Text name for the task - only used for debugging. */ configMINIMAL_STACK_SIZE, /* Size of stack (in words, not bytes) to allocate for the task. */ - NULL, /* Task parameter - not used in this case. */ + ( void * ) x, /* Task parameter - not used in this case. */ tskIDLE_PRIORITY, /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */ NULL ); /* Used to pass out a handle to the created task - not used in this case. */ } +} /*-----------------------------------------------------------*/ static void prvMQTTDemoTask( void *pvParameters ) { IotMqttError_t xResult; uint32_t ulNotificationValue = 0, ulPublishCount; -const uint32_t ulMaxPublishCount = 5UL; -const TickType_t xNoDelay = ( TickType_t ) 0; +uint32_t ulMaxPublishCount = 0UL; +const TickType_t xNoDelay = ( TickType_t ) 1; +IotMqttConnection_t xMQTTConnection = IOT_MQTT_CONNECTION_INITIALIZER; +uint32_t ulTaskNumber = ( uint32_t ) pvParameters, x; +char cTopicString[ sizeof( mqttexampleTOPIC ) + 5 ];//_RB_ Access by other tasks so must be persistant and will cause memory faults on memory protected systems. +#pragma message ("Access by other tasks so must be persistant and will cause memory faults on memory protected systems.") /* Remove compiler warnings about unused parameters. */ ( void ) pvParameters; @@ -274,10 +281,15 @@ const TickType_t xNoDelay = ( TickType_t ) 0; xResult = IotMqtt_Init(); configASSERT( xResult == IOT_MQTT_SUCCESS ); + /* Create a topic string that is unique to the MQTT connection created by + this task. */ + snprintf( cTopicString, sizeof( cTopicString ), "%s/%s", mqttexampleTOPIC, pcClientIdentifiers[ ulTaskNumber ] ); + for( ; ; ) { /* Don't expect any notifications to be pending yet. */ - configASSERT( ulTaskNotifyTake( pdTRUE, xNoDelay ) == 0 ); + ulNotificationValue = ulTaskNotifyTake( pdTRUE, xNoDelay ); + configASSERT( ulNotificationValue == 0 ); /****************************** Connect. ******************************/ @@ -287,7 +299,7 @@ const TickType_t xNoDelay = ( TickType_t ) 0; * mqttexampleMQTT_BROKER_PORT at the top of this file. Please change * it to the MQTT broker you want to connect to. Note that this example * does not use TLS and therefore will not work with AWS IoT. */ - prvMQTTConnect(); + prvMQTTConnect( &xMQTTConnection, pcClientIdentifiers[ ulTaskNumber ] ); configPRINTF( ( "Connected to %s\r\n", mqttexampleMQTT_BROKER_ENDPOINT ) ); @@ -298,19 +310,28 @@ const TickType_t xNoDelay = ( TickType_t ) 0; * client will then publish to the same topic it subscribed to, so will * expect all the messages it sends to the broker to be sent back to it * from the broker. */ - prvMQTTSubscribe(); - configPRINTF( ( "Subscribed to the topic %s\r\n", mqttexampleTOPIC ) ); + prvMQTTSubscribe( xMQTTConnection, cTopicString ); + configPRINTF( ( "Subscribed to the topic %s\r\n", cTopicString ) ); /*********************** Publish 5 messages. **************************/ /* Publish a few messages while connected. */ + for( x = 0; x < ( ulTaskNumber + 1UL ); x++ ) + { + ulMaxPublishCount = uxRand(); + } + + /* Cap ulMaxPublishCount but ensure it is not zero. */ + ulMaxPublishCount %= 10UL; + ulMaxPublishCount++; + for( ulPublishCount = 0; ulPublishCount < ulMaxPublishCount; ulPublishCount++ ) { /* Publish a message on the mqttexampleTOPIC topic as specified at * the top of this file. */ - prvMQTTPublish(); - configPRINTF( ( "Published %s on the topic %s\r\n", mqttexampleMESSAGE, mqttexampleTOPIC ) ); + prvMQTTPublish( xMQTTConnection, cTopicString ); + configPRINTF( ( "Published %s on the topic %s\r\n", mqttexampleMESSAGE, cTopicString ) ); /* Since we are subscribed to the same topic as we published on, we * will get the same message back from the MQTT broker. Wait for the @@ -331,8 +352,8 @@ const TickType_t xNoDelay = ( TickType_t ) 0; /* Unsubscribe from the topic mqttexampleTOPIC and disconnect * gracefully. */ - prvMQTTUnsubscribe(); - prvMQTTDisconnect(); + prvMQTTUnsubscribe( xMQTTConnection, cTopicString ); + prvMQTTDisconnect( xMQTTConnection ); configPRINTF( ( "Disconnected from %s\r\n\r\n", mqttexampleMQTT_BROKER_ENDPOINT ) ); /* Wait for the disconnect operation to complete which is informed to us @@ -349,18 +370,19 @@ const TickType_t xNoDelay = ( TickType_t ) 0; /* Wait for some time between two iterations to ensure that we do not * bombard the public test mosquitto broker. */ configPRINTF( ( "prvMQTTDemoTask() completed an iteration without hitting an assert. Total free heap is %u\r\n\r\n", xPortGetFreeHeapSize() ) ); - vTaskDelay( pdMS_TO_TICKS( 5000 ) ); +// vTaskDelay( pdMS_TO_TICKS( 5000 ) ); } } /*-----------------------------------------------------------*/ -static void prvMQTTConnect( void ) +static void prvMQTTConnect( IotMqttConnection_t *xMQTTConnection, const char *pcClientID ) { IotMqttError_t xResult; IotNetworkServerInfo_t xMQTTBrokerInfo; IotMqttNetworkInfo_t xNetworkInfo = IOT_MQTT_NETWORK_INFO_INITIALIZER; IotMqttConnectInfo_t xConnectInfo = IOT_MQTT_CONNECT_INFO_INITIALIZER; - +static char c[ 10 ]; +static int id = 0; /******************* Broker information setup. **********************/ @@ -417,8 +439,8 @@ IotMqttConnectInfo_t xConnectInfo = IOT_MQTT_CONNECT_INFO_INITIALIZER; /* The client identifier is used to uniquely identify this MQTT client to * the MQTT broker. In a production device the identifier can be something * unique, such as a device serial number. */ - xConnectInfo.pClientIdentifier = mqttexampleCLIENT_IDENTIFIER; - xConnectInfo.clientIdentifierLength = ( uint16_t ) strlen( mqttexampleCLIENT_IDENTIFIER ); + xConnectInfo.pClientIdentifier = pcClientID; + xConnectInfo.clientIdentifierLength = ( uint16_t ) strlen( pcClientID ); /* This example does not use any authentication and therefore username and * password fields are not used. */ @@ -432,12 +454,12 @@ IotMqttConnectInfo_t xConnectInfo = IOT_MQTT_CONNECT_INFO_INITIALIZER; xResult = IotMqtt_Connect( &( xNetworkInfo ), &( xConnectInfo ), mqttexampleMQTT_TIMEOUT_MS, - &( xMQTTConnection ) ); + xMQTTConnection ); configASSERT( xResult == IOT_MQTT_SUCCESS ); } /*-----------------------------------------------------------*/ -static void prvMQTTSubscribe( void ) +static void prvMQTTSubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString ) { IotMqttError_t xResult; IotMqttSubscription_t xMQTTSubscription; @@ -446,8 +468,8 @@ IotMqttSubscription_t xMQTTSubscription; * as the callback context which is used by the callback to send a task * notification to this task.*/ xMQTTSubscription.qos = IOT_MQTT_QOS_1; - xMQTTSubscription.pTopicFilter = mqttexampleTOPIC; - xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( mqttexampleTOPIC ); + xMQTTSubscription.pTopicFilter = pcTopicString; + xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( pcTopicString ); xMQTTSubscription.callback.pCallbackContext = ( void * ) xTaskGetCurrentTaskHandle(); xMQTTSubscription.callback.function = prvExample_OnMessageReceived; @@ -462,7 +484,7 @@ IotMqttSubscription_t xMQTTSubscription; } /*-----------------------------------------------------------*/ -static void prvMQTTPublish( void ) +static void prvMQTTPublish( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString ) { IotMqttError_t xResult; IotMqttPublishInfo_t xMQTTPublishInfo; @@ -472,8 +494,8 @@ IotMqttPublishInfo_t xMQTTPublishInfo; * back to us. It is verified in the publish callback. */ xMQTTPublishInfo.qos = IOT_MQTT_QOS_1; xMQTTPublishInfo.retain = false; - xMQTTPublishInfo.pTopicName = mqttexampleTOPIC; - xMQTTPublishInfo.topicNameLength = ( uint16_t ) strlen( mqttexampleTOPIC ); + xMQTTPublishInfo.pTopicName = pcTopicString; + xMQTTPublishInfo.topicNameLength = ( uint16_t ) strlen( pcTopicString ); xMQTTPublishInfo.pPayload = mqttexampleMESSAGE; xMQTTPublishInfo.payloadLength = strlen( mqttexampleMESSAGE ); xMQTTPublishInfo.retryMs = mqttexamplePUBLISH_RETRY_MS; @@ -489,14 +511,14 @@ IotMqttPublishInfo_t xMQTTPublishInfo; } /*-----------------------------------------------------------*/ -static void prvMQTTUnsubscribe( void ) +static void prvMQTTUnsubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString ) { IotMqttError_t xResult; IotMqttSubscription_t xMQTTSubscription; /* Unsubscribe from the mqttexampleTOPIC topic filter. */ - xMQTTSubscription.pTopicFilter = mqttexampleTOPIC; - xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( mqttexampleTOPIC ); + xMQTTSubscription.pTopicFilter = pcTopicString; + xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( pcTopicString ); /* The following members of the IotMqttSubscription_t are ignored by the * unsubscribe operation. Just initialize them to avoid "use of uninitialized * variable" warnings. */ @@ -515,7 +537,7 @@ IotMqttSubscription_t xMQTTSubscription; } /*-----------------------------------------------------------*/ -static void prvMQTTDisconnect( void ) +static void prvMQTTDisconnect( IotMqttConnection_t xMQTTConnection ) { /* Send a MQTT DISCONNECT packet to the MQTT broker to do a graceful * disconnect. */ diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSConfig.h index 966ac7050..29b4aace0 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSConfig.h +++ b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSConfig.h @@ -136,14 +136,14 @@ example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4 results in the wired network being used, while setting configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being used. */ -#define configNETWORK_INTERFACE_TO_USE 3L +#define configNETWORK_INTERFACE_TO_USE 2L /* The address of an echo server is only left in this project as it doubles as the address to which logging is sent should UDP logging be enabled. */ #define configECHO_SERVER_ADDR0 192 #define configECHO_SERVER_ADDR1 168 -#define configECHO_SERVER_ADDR2 0 -#define configECHO_SERVER_ADDR3 11 +#define configECHO_SERVER_ADDR2 26 +#define configECHO_SERVER_ADDR3 100 /* Default MAC address configuration. The demo creates a virtual network connection that uses this MAC address by accessing the raw Ethernet/WiFi data @@ -159,31 +159,31 @@ configure the real network connection to use. */ /* Default IP address configuration. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */ -#define configIP_ADDR0 10 -#define configIP_ADDR1 10 -#define configIP_ADDR2 10 -#define configIP_ADDR3 200 +#define configIP_ADDR0 192 +#define configIP_ADDR1 168 +#define configIP_ADDR2 1 +#define configIP_ADDR3 51 /* Default gateway IP address configuration. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */ -#define configGATEWAY_ADDR0 10 -#define configGATEWAY_ADDR1 10 -#define configGATEWAY_ADDR2 10 +#define configGATEWAY_ADDR0 192 +#define configGATEWAY_ADDR1 168 +#define configGATEWAY_ADDR2 1 #define configGATEWAY_ADDR3 1 /* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and 208.67.220.220. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted.*/ -#define configDNS_SERVER_ADDR0 208 -#define configDNS_SERVER_ADDR1 67 -#define configDNS_SERVER_ADDR2 222 -#define configDNS_SERVER_ADDR3 222 +#define configDNS_SERVER_ADDR0 8 +#define configDNS_SERVER_ADDR1 8 +#define configDNS_SERVER_ADDR2 8 +#define configDNS_SERVER_ADDR3 8 /* Default netmask configuration. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */ #define configNET_MASK0 255 -#define configNET_MASK1 0 -#define configNET_MASK2 0 +#define configNET_MASK1 255 +#define configNET_MASK2 255 #define configNET_MASK3 0 /* The UDP port to which print messages are sent. */ diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSIPConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSIPConfig.h index 4729ef107..563f0cb09 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSIPConfig.h +++ b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSIPConfig.h @@ -146,7 +146,7 @@ stack will revert to using the static IP address even when ipconfigUSE_DHCP is set to 1 if a valid configuration cannot be obtained from a DHCP server for any reason. The static configuration used is that passed into the stack by the FreeRTOS_IPInit() function call. */ -#define ipconfigUSE_DHCP 1 +#define ipconfigUSE_DHCP 0 /* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at increasing time intervals until either a reply is received from a DHCP server diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c index bedfd3e85..f2f8eb5a2 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c @@ -353,3 +353,12 @@ void vApplicationGetTimerTaskMemory( StaticTask_t** ppxTimerTaskTCBBuffer, Stack *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; } /*-----------------------------------------------------------*/ + + + + + + + + + diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj index 29a2fba0c..f3f219259 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj @@ -19,13 +19,11 @@ Application false MultiByte - v140 Application false MultiByte - v140 diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/main.c index beae122f0..fae30bd74 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/main.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/main.c @@ -371,3 +371,14 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress, return uxRand(); } +/* + * Supply a random number to FreeRTOS+TCP stack. + * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER + * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS. + */ +BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber) +{ + *(pulNumber) = uxRand(); + return pdTRUE; +} + diff --git a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c index 22950ff1a..7903326e1 100644 --- a/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c +++ b/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c @@ -86,6 +86,7 @@ #include "xscutimer.h" #include "xscugic.h" #include "xil_exception.h" +#include "xuartps_hw.h" /* mainSELECTED_APPLICATION is used to select between three demo applications, * as described at the top of this file. @@ -208,6 +209,12 @@ XScuGic_Config *pxGICConfig; FreeRTOS_asm_vectors.S, which is part of this project. Switch to use the FreeRTOS vector table. */ vPortInstallFreeRTOSVectorTable(); + + /* Initialise UART for use with QEMU. */ + XUartPs_ResetHw( 0xE0000000 ); + XUartPs_WriteReg(0xE0000000, XUARTPS_CR_OFFSET, + ((u32)XUARTPS_CR_RX_DIS | (u32)XUARTPS_CR_TX_EN | + (u32)XUARTPS_CR_STOPBRK)); } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx index 189102f99..5d7cd2f50 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx @@ -73,7 +73,7 @@ 0 - 0 + 1 0 1 @@ -103,7 +103,7 @@ 1 0 0 - 15 + 16 @@ -120,7 +120,7 @@ 0 DLGTARM - (6010=70,43,547,639,0)(6018=1091,145,1280,478,0)(6019=1091,137,1280,457,0)(6008=-1,-1,-1,-1,0)(6009=-1,-1,-1,-1,0)(6014=1022,0,1280,731,0)(6015=777,40,1035,662,1)(6003=207,84,780,620,1)(6000=-1,-1,-1,-1,0) + (6010=70,43,547,639,0)(6018=1091,145,1280,478,0)(6019=1091,137,1280,457,0)(6008=-1,-1,-1,-1,0)(6009=-1,-1,-1,-1,0)(6014=1022,0,1280,731,0)(6015=2837,586,3095,1208,1)(6003=2678,41,3260,577,1)(6000=-1,-1,-1,-1,0) 0 @@ -143,7 +143,40 @@ UL2V8M(-S0 -C0 -P0 -FD20000000 -FC1000) - + + + 0 + 0 + 105 + 1 +
2116472
+ 0 + 0 + 0 + 0 + 0 + 1 + <2>.\main_ns.c + + \\FreeRTOSDemo_ns\main_ns.c\105 +
+ + 1 + 0 + 67 + 1 +
2044
+ 0 + 0 + 0 + 0 + 0 + 1 + <1>.\main_s.c + + \\FreeRTOSDemo_s\main_s.c\67 +
+
0 @@ -439,7 +472,7 @@ User - 0 + 1 0 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx index 5c98a40b9..4edbd14c6 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx @@ -10,13 +10,13 @@ FVP Simulation Model 0x4 ARM-ADS - 6070000::V6.7::.\ARMCLANG + 6130001::V6.13.1::.\ARMCLANG 1 ARMCM33_DSP_FP_TZ ARM - ARM.CMSIS.5.5.1 + ARM.CMSIS.5.6.0 http://www.keil.com/pack/ IRAM(0x20000000,0x00020000) IRAM2(0x20200000,0x00020000) IROM(0x00000000,0x00200000) IROM2(0x00200000,0x00200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ESEL ELITTLE @@ -133,7 +133,7 @@ 0 0 1 - 1 + 0 4099 1 @@ -540,24 +540,24 @@ RTE\Device\ARMCM33_DSP_FP_TZ\partition_ARMCM33.h - - + + RTE\Device\ARMCM33_DSP_FP_TZ\startup_ARMCM33.s - - + + RTE\Device\ARMCM33_DSP_FP_TZ\system_ARMCM33.c - - + + diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvoptx index 5d15b9138..ac87fd034 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvoptx @@ -103,7 +103,7 @@ 1 0 0 - 15 + 16 diff --git a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvprojx index 0ad1de3d3..220ee39be 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvprojx @@ -10,13 +10,13 @@ FVP Simulation Model 0x4 ARM-ADS - 6070000::V6.7::.\ARMCLANG + 6130001::V6.13.1::.\ARMCLANG 1 ARMCM33_DSP_FP_TZ ARM - ARM.CMSIS.5.5.1 + ARM.CMSIS.5.6.0 http://www.keil.com/pack/ IRAM(0x20000000,0x00020000) IRAM2(0x20200000,0x00020000) IROM(0x00000000,0x00200000) IROM2(0x00200000,0x00200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ESEL ELITTLE @@ -488,24 +488,24 @@ RTE\Device\ARMCM33_DSP_FP_TZ\partition_ARMCM33.h - - + + RTE\Device\ARMCM33_DSP_FP_TZ\startup_ARMCM33.s - - + + RTE\Device\ARMCM33_DSP_FP_TZ\system_ARMCM33.c - - + + diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx index e07fcd2de..f711f26a5 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx @@ -101,6 +101,8 @@ 0 0 1 + 0 + 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx index fcdc1f4a7..015238d5e 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx @@ -16,7 +16,7 @@ ARMCM4_FP ARM - ARM.CMSIS.5.5.1 + ARM.CMSIS.5.6.0 http://www.keil.com/pack/ IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE @@ -184,6 +184,7 @@ 0 0 2 + 0 0 0 8 @@ -324,6 +325,7 @@ 0 0 0 + 0 0 0 0 diff --git a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c index 185ac7ba7..9a13d6f23 100644 --- a/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c @@ -778,7 +778,7 @@ static void prvTaskToDelete( void *pvParameters ) configASSERT( uxTaskGetStackHighWaterMark2( NULL ) > 0 ); /* Run time stats are not being gathered - this is just to exercise API. */ - configASSERT( xTaskGetIdleRunTimeCounter() == 0 ); + configASSERT( ulTaskGetIdleRunTimeCounter() == 0 ); vTaskSuspend( NULL ); } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/Common/Minimal/AbortDelay.c b/FreeRTOS/Demo/Common/Minimal/AbortDelay.c index 9fc8cfeb0..65d0104e8 100644 --- a/FreeRTOS/Demo/Common/Minimal/AbortDelay.c +++ b/FreeRTOS/Demo/Common/Minimal/AbortDelay.c @@ -149,10 +149,6 @@ uint32_t ulTestToPerform = abtNOTIFY_WAIT_ABORTS; TickType_t xTimeAtStart; const TickType_t xStartMargin = 2UL; -/* Used to control whether to use xTaskAbortDelay() or xTaskAbortDelayFromISR() so -both are used with all the tests. */ -BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken; - /* Just to remove compiler warnings. */ ( void ) pvParameters; @@ -177,46 +173,10 @@ BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken; raise the priority of the controlling task to that of the blocking task to minimise discrepancies. */ vTaskPrioritySet( NULL, abtBLOCKING_PRIORITY ); - vTaskDelay( xMaxBlockTime + xHalfMaxBlockTime + xStartMargin ); - - /* For test coverage sometimes xTaskAbortDelay() is used and sometimes - xTaskAbortDelayFromISR() is used. */ - if( xUseFromISRVersion == pdFALSE ) + if( xTaskAbortDelay( xBlockingTask ) != pdPASS ) { - if( xTaskAbortDelay( xBlockingTask ) != pdPASS ) - { - xErrorOccurred = pdTRUE; - } - } - else - { - xHigherPriorityTaskWoken = pdFALSE; - - /* For test coverage, sometimes xHigherPriorityTaskWoken is used, and - sometimes NULL is used. */ - - if( ( xControllingCycles % 2 ) == 0 ) - { - if( xTaskAbortDelayFromISR( xBlockingTask, &xHigherPriorityTaskWoken ) != pdPASS ) - { - xErrorOccurred = pdTRUE; - } - } - else - { - if( xTaskAbortDelayFromISR( xBlockingTask, NULL ) != pdPASS ) - { - xErrorOccurred = pdTRUE; - } - } - - /* The tasks have the same priority so xHigherPriorityTaskWoken should - never get set. */ - if( xHigherPriorityTaskWoken != pdFALSE ) - { - xErrorOccurred = pdTRUE; - } + xErrorOccurred = pdTRUE; } /* Reset the priority to the normal controlling priority. */ @@ -241,13 +201,6 @@ BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken; /* To indicate this task is still executing. */ xControllingCycles++; - - if( ( xControllingCycles % abtMAX_TESTS ) == 0 ) - { - /* Looped through all the tests. Switch between using xTaskAbortDelay() - and xTaskAbortDelayFromISR() for the next round of tests. */ - xUseFromISRVersion = !xUseFromISRVersion; - } } } /*-----------------------------------------------------------*/ @@ -335,12 +288,6 @@ BaseType_t xReturned; { xErrorOccurred = pdTRUE; } - - xReturned = xTaskAbortDelayFromISR( xThisTask, NULL ); - if( xReturned != pdFALSE ) - { - xErrorOccurred = pdTRUE; - } } /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/Common/Minimal/GenQTest.c b/FreeRTOS/Demo/Common/Minimal/GenQTest.c index 97f693c85..b9022333f 100644 --- a/FreeRTOS/Demo/Common/Minimal/GenQTest.c +++ b/FreeRTOS/Demo/Common/Minimal/GenQTest.c @@ -218,7 +218,7 @@ QueueHandle_t xQueue; for( ;; ) { /* The queue is empty, so sending an item to the back of the queue - should have the same efect as sending it to the front of the queue. + should have the same effect as sending it to the front of the queue. First send to the front and check everything is as expected. */ ulLoopCounterSnapshot = ulLoopCounter; diff --git a/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c b/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c index c5854bc62..3eac259cf 100644 --- a/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c +++ b/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c @@ -971,8 +971,10 @@ BaseType_t xErrorDetected = pdFALSE; else if( xTriggerLevel < xReadBlockTime ) { /* Trigger level was less than the block time so we expect to - have received the trigger level number of bytes. */ - if( ( xTriggerLevel - xBytesReceived ) > xAllowableMargin ) + have received the trigger level number of bytes - could be more + though depending on other activity between the task being + unblocked and the task reading the number of bytes received. */ + if( ( xBytesReceived - xTriggerLevel ) > xAllowableMargin ) { xErrorDetected = pdTRUE; } @@ -983,7 +985,7 @@ BaseType_t xErrorDetected = pdFALSE; receive no greater than the block time, but one or two less is ok due to variations in how far through the time slice the functions get executed. */ - if( xBytesReceived > xReadBlockTime ) + if( ( xBytesReceived - xReadBlockTime ) > xAllowableMargin ) { xErrorDetected = pdTRUE; } diff --git a/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.cproject b/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.cproject index 377ae24d4..359830148 100644 --- a/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.cproject +++ b/FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.cproject @@ -31,7 +31,7 @@ -