]> git.sur5r.net Git - freertos/commitdiff
Update libraries and sundry check-ins ready for the V10.3.0 kernel release.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 6 Feb 2020 18:52:35 +0000 (18:52 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 6 Feb 2020 18:52:35 +0000 (18:52 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2817 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

52 files changed:
FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/https/common/main.c
FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/main.c
FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/main.c
FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/shadow/shadow_device_operations/main.c
FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/main.c
FreeRTOS-Labs/Demo/FreeRTOS_Plus_TCP_and_FAT_Windows_Simulator/main.c
FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c
FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h
FreeRTOS-Labs/Source/FreeRTOS-Plus-CLI/History.txt
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/DemoTasks/SimpleMQTTExamples.c
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSConfig.h
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/FreeRTOSIPConfig.h
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj
FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/main.c
FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c
FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvoptx
FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.uvprojx
FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvoptx
FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/FreeRTOSDemo_s.uvprojx
FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvoptx
FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/Keil_Specific/RTOSDemo.uvprojx
FreeRTOS/Demo/CORTEX_MPU_Simulator_Keil_GCC/main.c
FreeRTOS/Demo/Common/Minimal/AbortDelay.c
FreeRTOS/Demo/Common/Minimal/GenQTest.c
FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.cproject
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c
FreeRTOS/Demo/RISC-V_RV32M1_Vega_GCC_Eclipse/projects/RTOSDemo_ri5cy/.cproject
FreeRTOS/Demo/RISC-V_RV32M1_Vega_GCC_Eclipse/projects/RTOSDemo_ri5cy/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/main.c
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/miv-basic.resc
FreeRTOS/Demo/WIN32-MSVC-Static-Allocation-Only/WIN32.vcxproj
FreeRTOS/Demo/WIN32-MingW/main_full.c
FreeRTOS/History.txt
FreeRTOS/Source/include/FreeRTOS.h
FreeRTOS/Source/include/task.h
FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/portmacro.h
FreeRTOS/Source/portable/GCC/ARM_CM4_MPU/portmacro.h
FreeRTOS/Source/portable/GCC/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions/freertos_risc_v_chip_specific_extensions.h
FreeRTOS/Source/portable/GCC/RISC-V/port.c
FreeRTOS/Source/portable/GCC/RISC-V/portASM.S
FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h
FreeRTOS/Source/portable/IAR/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions/freertos_risc_v_chip_specific_extensions.h
FreeRTOS/Source/portable/IAR/RISC-V/port.c
FreeRTOS/Source/portable/IAR/RISC-V/portASM.s
FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM4_MPU/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM4_MPU/portmacro.h
FreeRTOS/Source/tasks.c

index dd485a67bebd68931e1d6f21f8c35401ee27b64f..a1b0fa5e92ac201029761d69858ac8624d70697d 100644 (file)
@@ -305,6 +305,19 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack.\r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER\r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       *(pulNumber) = uxRand();\r
+       return pdTRUE;\r
+}\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
 /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an\r
 implementation of vApplicationGetIdleTaskMemory() to provide the memory that is\r
 used by the Idle task. */\r
index e07f2c2eb35fe6ce4b3d6ab0ef6e4a36eb3c0592..f06d37c21038cf9aa512c6cad414c635e85614ee 100644 (file)
@@ -305,6 +305,18 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack.\r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER\r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       *(pulNumber) = uxRand();\r
+       return pdTRUE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an\r
 implementation of vApplicationGetIdleTaskMemory() to provide the memory that is\r
 used by the Idle task. */\r
index 3c531b6d953d3bb8c79440b59af7dd55a1166050..0c11b0c1dfb560d185ae75964909c6a351e96d2d 100644 (file)
@@ -314,6 +314,18 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack.\r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER\r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       *(pulNumber) = uxRand();\r
+       return pdTRUE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an\r
 implementation of vApplicationGetIdleTaskMemory() to provide the memory that is\r
 used by the Idle task. */\r
index 6b71b1a83480a3d1be3f47da9e3d21d13d880ae6..357a2c2235ea4b8157f51a03651ab2924a93e490 100644 (file)
@@ -306,6 +306,18 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack.\r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER\r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       *(pulNumber) = uxRand();\r
+       return pdTRUE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 /* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an\r
 implementation of vApplicationGetIdleTaskMemory() to provide the memory that is\r
 used by the Idle task. */\r
index f7bc12dcbbf281bba7d4eb1870d54e538ff578c0..22f95907c075ef821ca8d53f727904f108fc47d3 100644 (file)
@@ -146,6 +146,23 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack.\r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER\r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       /* This example is the first in a sequence that adds IoT functionality into\r
+       an existing TCP / IP project.In this first project the TCP / IP stack is not\r
+       actually used, but it is still built, which requires this function to be\r
+       present.For now this function does not need to do anything. */\r
+       __debugbreak();\r
+       *(pulNumber) = 0;\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 UBaseType_t uxRand( void )\r
 {\r
        /* This example is the first in a sequence that adds IoT functionality into\r
index a94a1cd54fe633361bd7e61eb45fb838785880fe..647469760477963c8c9cb915aaa720bd6c7ed317 100644 (file)
@@ -814,6 +814,19 @@ extern uint32_t ulApplicationGetNextSequenceNumber(uint32_t ulSourceAddress,
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack. \r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER \r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       *(pulNumber) = uxRand();\r
+       return pdTRUE;\r
+}\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
 #if( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME != 0 )\r
 \r
        const char *pcApplicationHostnameHook( void )\r
index a9770159c756f2bfe0cfdee7d557bca58151ee88..0e0a75934dc1fe79532b07062782fd543e4e6fa8 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * FreeRTOS+CLI V1.0.4\r
+ * FreeRTOS+CLI V1.0.x Labs copy\r
  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
index 12fdd706243eb32cf0882fa6c390cab867703102..25c2392149f5e8c2d4ddc636db40fab2c08d20a7 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * FreeRTOS+CLI V1.0.4\r
+ * FreeRTOS+CLI V1.0.x Labs copy\r
  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
index 8c62cf90bb1d1995ece6ba95f12862505ab27303..95a6130166c12598eaef6b4a977f670d7c273789 100644 (file)
@@ -1,4 +1,4 @@
-Changes between V1.0.3 and V1.0.4 released\r
+Changes between V1.0.3 and TBD\r
 \r
        + Update to use stdint and the FreeRTOS specific typedefs that were\r
          introduced in FreeRTOS V8.0.0.\r
index 3ad5e662d1f061805690d08945a957f55b6cd2c6..80a04169e78208d8e5223203d12369920199a592 100644 (file)
 /**\r
  * @brief The timeout for MQTT operations in this example.\r
  */\r
-#define mqttexampleMQTT_TIMEOUT_MS                     ( 5000 )\r
+#define mqttexampleMQTT_TIMEOUT_MS                     ( 50000 )\r
 \r
 /**\r
  * @brief The MQTT client identifier used in this example.\r
  */\r
 #define mqttexampleCLIENT_IDENTIFIER           "mqttexampleclient"\r
 \r
+const char *pcClientIdentifiers[] = { "AAA" };//, "BBB", "CCC", "DDD", "EEE", "FFF", "GGG", "HHH", "III", "JJJ" };\r
+\r
 /**\r
  * @brief Details of the MQTT broker to connect to.\r
  *\r
 #define mqttexampleMESSAGE_RECEIVED_BIT                ( 1UL << 1UL )\r
 /*-----------------------------------------------------------*/\r
 \r
-/**\r
- * @brief The MQTT connection handle used in this example.\r
- */\r
-static IotMqttConnection_t xMQTTConnection = IOT_MQTT_CONNECTION_INITIALIZER;\r
-\r
 /**\r
  * @brief Parameters used to create the system task pool.\r
  */\r
@@ -167,28 +164,28 @@ static void prvExample_OnMessageReceived( void * pvCallbackContext,
  *\r
  * @note This example does not use TLS and therefore will not work with MQTT.\r
  */\r
-static void prvMQTTConnect( void );\r
+static void prvMQTTConnect( IotMqttConnection_t *xMQTTConnection, const char *pcClientID );\r
 \r
 /**\r
- * @brief Subscribes to the topic as specified in mqttexampleTOPIC.\r
+ * @brief Subscribes to pcTopicString.\r
  */\r
-static void prvMQTTSubscribe( void );\r
+static void prvMQTTSubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString );\r
 \r
 /**\r
  * @brief Publishes a messages mqttexampleMESSAGE on mqttexampleTOPIC topic.\r
  */\r
-static void prvMQTTPublish( void );\r
+static void prvMQTTPublish( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString );\r
 \r
 /**\r
  * @brief Unsubscribes from the mqttexampleTOPIC topic.\r
  */\r
-static void prvMQTTUnsubscribe( void );\r
+static void prvMQTTUnsubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString );\r
 \r
 /**\r
  * @brief Disconnects from the MQTT broker gracefully by sending an MQTT\r
  * DISCONNECT message.\r
  */\r
-static void prvMQTTDisconnect( void );\r
+static void prvMQTTDisconnect( IotMqttConnection_t xMQTTConnection );\r
 /*-----------------------------------------------------------*/\r
 \r
 static void prvExample_OnDisconnect( void * pvCallbackContext,\r
@@ -213,10 +210,10 @@ static void prvExample_OnMessageReceived( void * pvCallbackContext,
 TaskHandle_t xDemoTaskHandle = ( TaskHandle_t ) pvCallbackContext;\r
 \r
        /* Ensure that the message is received on the expected topic. */\r
-       configASSERT( pxCallbackParams->u.message.info.topicNameLength == strlen( mqttexampleTOPIC ) );\r
-       configASSERT( strncmp( pxCallbackParams->u.message.info.pTopicName,\r
-                                                  mqttexampleTOPIC,\r
-                                                  strlen( mqttexampleTOPIC ) ) == 0 );\r
+//     configASSERT( pxCallbackParams->u.message.info.topicNameLength == strlen( mqttexampleTOPIC ) );\r
+//     configASSERT( strncmp( pxCallbackParams->u.message.info.pTopicName,\r
+//                                                mqttexampleTOPIC,\r
+//                                                strlen( mqttexampleTOPIC ) ) == 0 );\r
 \r
        /* Ensure that the expected message is received. */\r
        configASSERT( pxCallbackParams->u.message.info.payloadLength == strlen( mqttexampleMESSAGE ) );\r
@@ -243,24 +240,34 @@ TaskHandle_t xDemoTaskHandle = ( TaskHandle_t ) pvCallbackContext;
 \r
 void vStartSimpleMQTTDemo( void )\r
 {\r
+uint32_t x;\r
+const uint32_t ulMax_x = sizeof( pcClientIdentifiers ) / sizeof( char * );\r
+\r
        /* This example uses a single application task, which in turn is used to\r
         * connect, subscribe, publish, unsubscribe and disconnect from the MQTT\r
         * broker. */\r
+for( x = 0; x < ulMax_x; x++ )\r
+{\r
        xTaskCreate( prvMQTTDemoTask,                   /* Function that implements the task. */\r
                                 "MQTTDemo",                            /* Text name for the task - only used for debugging. */\r
                                 configMINIMAL_STACK_SIZE,      /* Size of stack (in words, not bytes) to allocate for the task. */\r
-                                NULL,                                          /* Task parameter - not used in this case. */\r
+                                ( void * ) x,                                          /* Task parameter - not used in this case. */\r
                                 tskIDLE_PRIORITY,                      /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */\r
                                 NULL );                                        /* Used to pass out a handle to the created task - not used in this case. */\r
 }\r
+}\r
 /*-----------------------------------------------------------*/\r
 \r
 static void prvMQTTDemoTask( void *pvParameters )\r
 {\r
 IotMqttError_t xResult;\r
 uint32_t ulNotificationValue = 0, ulPublishCount;\r
-const uint32_t ulMaxPublishCount = 5UL;\r
-const TickType_t xNoDelay = ( TickType_t ) 0;\r
+uint32_t ulMaxPublishCount = 0UL;\r
+const TickType_t xNoDelay = ( TickType_t ) 1;\r
+IotMqttConnection_t xMQTTConnection = IOT_MQTT_CONNECTION_INITIALIZER;\r
+uint32_t ulTaskNumber = ( uint32_t ) pvParameters, x;\r
+char cTopicString[ sizeof( mqttexampleTOPIC ) + 5 ];//_RB_ Access by other tasks so must be persistant and will cause memory faults on memory protected systems.\r
+#pragma message ("Access by other tasks so must be persistant and will cause memory faults on memory protected systems.")\r
 \r
        /* Remove compiler warnings about unused parameters. */\r
        ( void ) pvParameters;\r
@@ -274,10 +281,15 @@ const TickType_t xNoDelay = ( TickType_t ) 0;
        xResult = IotMqtt_Init();\r
        configASSERT( xResult == IOT_MQTT_SUCCESS );\r
 \r
+       /* Create a topic string that is unique to the MQTT connection created by\r
+       this task. */\r
+       snprintf( cTopicString, sizeof( cTopicString ), "%s/%s", mqttexampleTOPIC, pcClientIdentifiers[ ulTaskNumber ] );\r
+\r
        for( ; ; )\r
        {\r
                /* Don't expect any notifications to be pending yet. */\r
-               configASSERT( ulTaskNotifyTake( pdTRUE, xNoDelay ) == 0 );\r
+               ulNotificationValue = ulTaskNotifyTake( pdTRUE, xNoDelay );\r
+               configASSERT( ulNotificationValue == 0 );\r
 \r
 \r
                /****************************** Connect. ******************************/\r
@@ -287,7 +299,7 @@ const TickType_t xNoDelay = ( TickType_t ) 0;
                 * mqttexampleMQTT_BROKER_PORT at the top of this file. Please change\r
                 * it to the MQTT broker you want to connect to. Note that this example\r
                 * does not use TLS and therefore will not work with AWS IoT. */\r
-               prvMQTTConnect();\r
+               prvMQTTConnect( &xMQTTConnection, pcClientIdentifiers[ ulTaskNumber ] );\r
                configPRINTF( ( "Connected to %s\r\n", mqttexampleMQTT_BROKER_ENDPOINT ) );\r
 \r
 \r
@@ -298,19 +310,28 @@ const TickType_t xNoDelay = ( TickType_t ) 0;
                 * client will then publish to the same topic it subscribed to, so will\r
                 * expect all the messages it sends to the broker to be sent back to it\r
                 * from the broker. */\r
-               prvMQTTSubscribe();\r
-               configPRINTF( ( "Subscribed to the topic %s\r\n", mqttexampleTOPIC ) );\r
+               prvMQTTSubscribe( xMQTTConnection, cTopicString );\r
+               configPRINTF( ( "Subscribed to the topic %s\r\n", cTopicString ) );\r
 \r
 \r
                /*********************** Publish 5 messages. **************************/\r
 \r
                /* Publish a few messages while connected. */\r
+               for( x = 0; x < ( ulTaskNumber + 1UL ); x++ )\r
+               {\r
+                       ulMaxPublishCount = uxRand();\r
+               }\r
+\r
+               /* Cap ulMaxPublishCount but ensure it is not zero. */\r
+               ulMaxPublishCount %= 10UL;\r
+               ulMaxPublishCount++;\r
+\r
                for( ulPublishCount = 0; ulPublishCount < ulMaxPublishCount; ulPublishCount++ )\r
                {\r
                        /* Publish a message on the mqttexampleTOPIC topic as specified at\r
                         * the top of this file. */\r
-                       prvMQTTPublish();\r
-                       configPRINTF( ( "Published %s on the topic %s\r\n", mqttexampleMESSAGE, mqttexampleTOPIC ) );\r
+                       prvMQTTPublish( xMQTTConnection, cTopicString );\r
+                       configPRINTF( ( "Published %s on the topic %s\r\n", mqttexampleMESSAGE, cTopicString ) );\r
 \r
                        /* Since we are subscribed to the same topic as we published on, we\r
                         * will get the same message back from the MQTT broker. Wait for the\r
@@ -331,8 +352,8 @@ const TickType_t xNoDelay = ( TickType_t ) 0;
 \r
                /* Unsubscribe from the topic mqttexampleTOPIC and disconnect\r
                 * gracefully. */\r
-               prvMQTTUnsubscribe();\r
-               prvMQTTDisconnect();\r
+               prvMQTTUnsubscribe( xMQTTConnection, cTopicString );\r
+               prvMQTTDisconnect( xMQTTConnection );\r
                configPRINTF( ( "Disconnected from %s\r\n\r\n", mqttexampleMQTT_BROKER_ENDPOINT ) );\r
 \r
                /* Wait for the disconnect operation to complete which is informed to us\r
@@ -349,18 +370,19 @@ const TickType_t xNoDelay = ( TickType_t ) 0;
                /* Wait for some time between two iterations to ensure that we do not\r
                 * bombard the public test mosquitto broker. */\r
                configPRINTF( ( "prvMQTTDemoTask() completed an iteration without hitting an assert. Total free heap is %u\r\n\r\n", xPortGetFreeHeapSize() ) );\r
-               vTaskDelay( pdMS_TO_TICKS( 5000 ) );\r
+//             vTaskDelay( pdMS_TO_TICKS( 5000 ) );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvMQTTConnect( void )\r
+static void prvMQTTConnect( IotMqttConnection_t *xMQTTConnection, const char *pcClientID )\r
 {\r
 IotMqttError_t xResult;\r
 IotNetworkServerInfo_t xMQTTBrokerInfo;\r
 IotMqttNetworkInfo_t xNetworkInfo = IOT_MQTT_NETWORK_INFO_INITIALIZER;\r
 IotMqttConnectInfo_t xConnectInfo = IOT_MQTT_CONNECT_INFO_INITIALIZER;\r
-\r
+static char c[ 10 ];\r
+static int id = 0;\r
 \r
        /******************* Broker information setup. **********************/\r
 \r
@@ -417,8 +439,8 @@ IotMqttConnectInfo_t xConnectInfo = IOT_MQTT_CONNECT_INFO_INITIALIZER;
        /* The client identifier is used to uniquely identify this MQTT client to\r
         * the MQTT broker.  In a production device the identifier can be something\r
         * unique, such as a device serial number. */\r
-       xConnectInfo.pClientIdentifier = mqttexampleCLIENT_IDENTIFIER;\r
-       xConnectInfo.clientIdentifierLength = ( uint16_t ) strlen( mqttexampleCLIENT_IDENTIFIER );\r
+       xConnectInfo.pClientIdentifier = pcClientID;\r
+       xConnectInfo.clientIdentifierLength = ( uint16_t ) strlen( pcClientID );\r
 \r
        /* This example does not use any authentication and therefore username and\r
         * password fields are not used. */\r
@@ -432,12 +454,12 @@ IotMqttConnectInfo_t xConnectInfo = IOT_MQTT_CONNECT_INFO_INITIALIZER;
        xResult = IotMqtt_Connect( &( xNetworkInfo ),\r
                                                           &( xConnectInfo ),\r
                                                           mqttexampleMQTT_TIMEOUT_MS,\r
-                                                          &( xMQTTConnection ) );\r
+                                                          xMQTTConnection );\r
        configASSERT( xResult == IOT_MQTT_SUCCESS );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvMQTTSubscribe( void )\r
+static void prvMQTTSubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString )\r
 {\r
 IotMqttError_t xResult;\r
 IotMqttSubscription_t xMQTTSubscription;\r
@@ -446,8 +468,8 @@ IotMqttSubscription_t xMQTTSubscription;
         * as the callback context which is used by the callback to send a task\r
         * notification to this task.*/\r
        xMQTTSubscription.qos = IOT_MQTT_QOS_1;\r
-       xMQTTSubscription.pTopicFilter = mqttexampleTOPIC;\r
-       xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( mqttexampleTOPIC );\r
+       xMQTTSubscription.pTopicFilter = pcTopicString;\r
+       xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( pcTopicString );\r
        xMQTTSubscription.callback.pCallbackContext = ( void * ) xTaskGetCurrentTaskHandle();\r
        xMQTTSubscription.callback.function = prvExample_OnMessageReceived;\r
 \r
@@ -462,7 +484,7 @@ IotMqttSubscription_t xMQTTSubscription;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvMQTTPublish( void )\r
+static void prvMQTTPublish( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString )\r
 {\r
 IotMqttError_t xResult;\r
 IotMqttPublishInfo_t xMQTTPublishInfo;\r
@@ -472,8 +494,8 @@ IotMqttPublishInfo_t xMQTTPublishInfo;
         * back to us. It is verified in the publish callback. */\r
        xMQTTPublishInfo.qos = IOT_MQTT_QOS_1;\r
        xMQTTPublishInfo.retain = false;\r
-       xMQTTPublishInfo.pTopicName = mqttexampleTOPIC;\r
-       xMQTTPublishInfo.topicNameLength = ( uint16_t ) strlen( mqttexampleTOPIC );\r
+       xMQTTPublishInfo.pTopicName = pcTopicString;\r
+       xMQTTPublishInfo.topicNameLength = ( uint16_t ) strlen( pcTopicString );\r
        xMQTTPublishInfo.pPayload = mqttexampleMESSAGE;\r
        xMQTTPublishInfo.payloadLength = strlen( mqttexampleMESSAGE );\r
        xMQTTPublishInfo.retryMs = mqttexamplePUBLISH_RETRY_MS;\r
@@ -489,14 +511,14 @@ IotMqttPublishInfo_t xMQTTPublishInfo;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvMQTTUnsubscribe( void )\r
+static void prvMQTTUnsubscribe( IotMqttConnection_t xMQTTConnection, const char * const pcTopicString )\r
 {\r
 IotMqttError_t xResult;\r
 IotMqttSubscription_t xMQTTSubscription;\r
 \r
        /* Unsubscribe from the mqttexampleTOPIC topic filter. */\r
-       xMQTTSubscription.pTopicFilter = mqttexampleTOPIC;\r
-       xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( mqttexampleTOPIC );\r
+       xMQTTSubscription.pTopicFilter = pcTopicString;\r
+       xMQTTSubscription.topicFilterLength = ( uint16_t ) strlen( pcTopicString );\r
        /* The following members of the IotMqttSubscription_t are ignored by the\r
         * unsubscribe operation. Just initialize them to avoid "use of uninitialized\r
         * variable" warnings. */\r
@@ -515,7 +537,7 @@ IotMqttSubscription_t xMQTTSubscription;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvMQTTDisconnect( void )\r
+static void prvMQTTDisconnect( IotMqttConnection_t xMQTTConnection )\r
 {\r
        /* Send a MQTT DISCONNECT packet to the MQTT broker to do a graceful\r
         * disconnect. */\r
index 966ac7050375df69bd896f431eab1fc9a3e045e3..29b4aace09c4ea83b37788b8ec83edc9bf4d0953 100644 (file)
@@ -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\r
 configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being\r
 used. */\r
-#define configNETWORK_INTERFACE_TO_USE 3L\r
+#define configNETWORK_INTERFACE_TO_USE 2L\r
 \r
 /* The address of an echo server is only left in this project as it doubles as\r
 the address to which logging is sent should UDP logging be enabled. */\r
 #define configECHO_SERVER_ADDR0        192\r
 #define configECHO_SERVER_ADDR1 168\r
-#define configECHO_SERVER_ADDR2 0\r
-#define configECHO_SERVER_ADDR3 11\r
+#define configECHO_SERVER_ADDR2 26\r
+#define configECHO_SERVER_ADDR3 100\r
 \r
 /* Default MAC address configuration.  The demo creates a virtual network\r
 connection that uses this MAC address by accessing the raw Ethernet/WiFi data\r
@@ -159,31 +159,31 @@ configure the real network connection to use. */
 \r
 /* Default IP address configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
-#define configIP_ADDR0         10\r
-#define configIP_ADDR1         10\r
-#define configIP_ADDR2         10\r
-#define configIP_ADDR3         200\r
+#define configIP_ADDR0         192\r
+#define configIP_ADDR1         168\r
+#define configIP_ADDR2         1\r
+#define configIP_ADDR3         51\r
 \r
 /* Default gateway IP address configuration.  Used in ipconfigUSE_DNS is set to\r
 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
-#define configGATEWAY_ADDR0    10\r
-#define configGATEWAY_ADDR1    10\r
-#define configGATEWAY_ADDR2    10\r
+#define configGATEWAY_ADDR0    192\r
+#define configGATEWAY_ADDR1    168\r
+#define configGATEWAY_ADDR2    1\r
 #define configGATEWAY_ADDR3    1\r
 \r
 /* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and\r
 208.67.220.220.  Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set\r
 to 1 but a DNS server cannot be contacted.*/\r
-#define configDNS_SERVER_ADDR0         208\r
-#define configDNS_SERVER_ADDR1         67\r
-#define configDNS_SERVER_ADDR2         222\r
-#define configDNS_SERVER_ADDR3         222\r
+#define configDNS_SERVER_ADDR0         8\r
+#define configDNS_SERVER_ADDR1         8\r
+#define configDNS_SERVER_ADDR2         8\r
+#define configDNS_SERVER_ADDR3         8\r
 \r
 /* Default netmask configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
 #define configNET_MASK0                255\r
-#define configNET_MASK1                0\r
-#define configNET_MASK2                0\r
+#define configNET_MASK1                255\r
+#define configNET_MASK2                255\r
 #define configNET_MASK3                0\r
 \r
 /* The UDP port to which print messages are sent. */\r
index 4729ef107ba4eb2afc1148ae096428889181546a..563f0cb09542bf9ab0b36806d8ff9ec7a28e69a7 100644 (file)
@@ -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\r
 reason.  The static configuration used is that passed into the stack by the\r
 FreeRTOS_IPInit() function call. */\r
-#define ipconfigUSE_DHCP       1\r
+#define ipconfigUSE_DHCP       0\r
 \r
 /* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at\r
 increasing time intervals until either a reply is received from a DHCP server\r
index bedfd3e859a2f1405da42c34f19822f3c39984c7..f2f8eb5a27aac43405e0dad9cca3008cbc25c401 100644 (file)
@@ -353,3 +353,12 @@ void vApplicationGetTimerTaskMemory( StaticTask_t** ppxTimerTaskTCBBuffer, Stack
        *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;\r
 }\r
 /*-----------------------------------------------------------*/\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
index 29a2fba0c3bd405f2c62a026b63ba9e781a66917..f3f21925965168ebcda9c62e410b39a2e9e686bd 100644 (file)
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
-    <PlatformToolset>v140</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
-    <PlatformToolset>v140</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
index beae122f09a324475a09e19d0b2c21c23f3cb7fb..fae30bd74690936f5093d293410595857276ac2c 100644 (file)
@@ -371,3 +371,14 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
        return uxRand();\r
 }\r
 \r
+/*\r
+ * Supply a random number to FreeRTOS+TCP stack. \r
+ * THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER \r
+ * SO IS NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.\r
+ */\r
+BaseType_t xApplicationGetRandomNumber(uint32_t* pulNumber)\r
+{\r
+       *(pulNumber) = uxRand();\r
+       return pdTRUE;\r
+}\r
+\r
index 22950ff1a8873168a59d844d5459bb57c62bbf9d..7903326e163e0f795a18b831ecf649aa12fb048d 100644 (file)
@@ -86,6 +86,7 @@
 #include "xscutimer.h"\r
 #include "xscugic.h"\r
 #include "xil_exception.h"\r
+#include "xuartps_hw.h"\r
 \r
 /* mainSELECTED_APPLICATION is used to select between three demo applications,\r
  * as described at the top of this file.\r
@@ -208,6 +209,12 @@ XScuGic_Config *pxGICConfig;
        FreeRTOS_asm_vectors.S, which is part of this project.  Switch to use the\r
        FreeRTOS vector table. */\r
        vPortInstallFreeRTOSVectorTable();\r
+\r
+       /* Initialise UART for use with QEMU. */\r
+       XUartPs_ResetHw( 0xE0000000 );\r
+       XUartPs_WriteReg(0xE0000000, XUARTPS_CR_OFFSET,\r
+                               ((u32)XUARTPS_CR_RX_DIS | (u32)XUARTPS_CR_TX_EN |\r
+                                               (u32)XUARTPS_CR_STOPBRK));\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 189102f9917e299ac961785ef621336d3bb9a2b3..5d7cd2f505528098031d38807f814ab98fe0840b 100644 (file)
@@ -73,7 +73,7 @@
         <LExpSel>0</LExpSel>
       </OPTXL>
       <OPTFL>
-        <tvExp>0</tvExp>
+        <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
         <IsCurrentTarget>1</IsCurrentTarget>
       </OPTFL>
         <bEvRecOn>1</bEvRecOn>
         <bSchkAxf>0</bSchkAxf>
         <bTchkAxf>0</bTchkAxf>
-        <nTsel>15</nTsel>
+        <nTsel>16</nTsel>
         <sDll></sDll>
         <sDllPa></sDllPa>
         <sDlgDll></sDlgDll>
         <SetRegEntry>
           <Number>0</Number>
           <Key>DLGTARM</Key>
-          <Name>(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)</Name>
+          <Name>(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)</Name>
         </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
           <Name>UL2V8M(-S0 -C0 -P0 -FD20000000 -FC1000)</Name>
         </SetRegEntry>
       </TargetDriverDllRegistry>
-      <Breakpoint/>
+      <Breakpoint>
+        <Bp>
+          <Number>0</Number>
+          <Type>0</Type>
+          <LineNumber>105</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>2116472</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>&lt;2&gt;.\main_ns.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\FreeRTOSDemo_ns\main_ns.c\105</Expression>
+        </Bp>
+        <Bp>
+          <Number>1</Number>
+          <Type>0</Type>
+          <LineNumber>67</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>2044</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>&lt;1&gt;.\main_s.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\FreeRTOSDemo_s\main_s.c\67</Expression>
+        </Bp>
+      </Breakpoint>
       <Tracepoint>
         <THDelay>0</THDelay>
       </Tracepoint>
 
   <Group>
     <GroupName>User</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
index 5c98a40b933855fe46c2427228348520896dc221..4edbd14c65005497c8cda7be8936753c44713563 100644 (file)
       <TargetName>FVP Simulation Model</TargetName>
       <ToolsetNumber>0x4</ToolsetNumber>
       <ToolsetName>ARM-ADS</ToolsetName>
-      <pCCUsed>6070000::V6.7::.\ARMCLANG</pCCUsed>
+      <pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
       <uAC6>1</uAC6>
       <TargetOption>
         <TargetCommonOption>
           <Device>ARMCM33_DSP_FP_TZ</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.5.1</PackID>
+          <PackID>ARM.CMSIS.5.6.0</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x20200000,0x00020000) IROM(0x00000000,0x00200000) IROM2(0x00200000,0x00200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
             <UseExternalTool>0</UseExternalTool>
             <RunIndependent>0</RunIndependent>
             <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
-            <Capability>1</Capability>
+            <Capability>0</Capability>
             <DriverSelection>4099</DriverSelection>
           </Flash1>
           <bUseTDR>1</bUseTDR>
       </file>
       <file attr="config" category="header" condition="ARMv8-M TZ Device" name="Device\ARM\ARMCM33\Include\Template\partition_ARMCM33.h" version="1.1.0">
         <instance index="0">RTE\Device\ARMCM33_DSP_FP_TZ\partition_ARMCM33.h</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.1.0" condition="ARMCM33 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.2.0" condition="ARMCM33 CMSIS"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
         <targetInfos>
           <targetInfo name="FVP Simulation Model"/>
         </targetInfos>
       </file>
       <file attr="config" category="sourceAsm" condition="ARMCC" name="Device\ARM\ARMCM33\Source\ARM\startup_ARMCM33.s" version="1.0.0">
         <instance index="0">RTE\Device\ARMCM33_DSP_FP_TZ\startup_ARMCM33.s</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.1.0" condition="ARMCM33 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.2.0" condition="ARMCM33 CMSIS"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
         <targetInfos>
           <targetInfo name="FVP Simulation Model"/>
         </targetInfos>
       </file>
       <file attr="config" category="sourceC" name="Device\ARM\ARMCM33\Source\system_ARMCM33.c" version="1.0.0">
         <instance index="0">RTE\Device\ARMCM33_DSP_FP_TZ\system_ARMCM33.c</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.1.0" condition="ARMCM33 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.2.0" condition="ARMCM33 CMSIS"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
         <targetInfos>
           <targetInfo name="FVP Simulation Model"/>
         </targetInfos>
index 5d15b9138586a6346c541002c93ab5337e6a7b26..ac87fd034b7b6ff7e55cdcbb3113cb3e47709920 100644 (file)
         <bEvRecOn>1</bEvRecOn>
         <bSchkAxf>0</bSchkAxf>
         <bTchkAxf>0</bTchkAxf>
-        <nTsel>15</nTsel>
+        <nTsel>16</nTsel>
         <sDll></sDll>
         <sDllPa></sDllPa>
         <sDlgDll></sDlgDll>
index 0ad1de3d39ad7be51614cd52b2d4f913be25d4e4..220ee39be9a9c14bd42691dcf88fdd7a0b66ff4a 100644 (file)
       <TargetName>FVP Simulation Model</TargetName>
       <ToolsetNumber>0x4</ToolsetNumber>
       <ToolsetName>ARM-ADS</ToolsetName>
-      <pCCUsed>6070000::V6.7::.\ARMCLANG</pCCUsed>
+      <pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
       <uAC6>1</uAC6>
       <TargetOption>
         <TargetCommonOption>
           <Device>ARMCM33_DSP_FP_TZ</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.5.1</PackID>
+          <PackID>ARM.CMSIS.5.6.0</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x20200000,0x00020000) IROM(0x00000000,0x00200000) IROM2(0x00200000,0x00200000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
     <files>
       <file attr="config" category="header" condition="ARMv8-M TZ Device" name="Device\ARM\ARMCM33\Include\Template\partition_ARMCM33.h" version="1.1.0">
         <instance index="0">RTE\Device\ARMCM33_DSP_FP_TZ\partition_ARMCM33.h</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.1.0" condition="ARMCM33 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.2.0" condition="ARMCM33 CMSIS"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
         <targetInfos>
           <targetInfo name="FVP Simulation Model"/>
         </targetInfos>
       </file>
       <file attr="config" category="sourceAsm" condition="ARMCC" name="Device\ARM\ARMCM33\Source\ARM\startup_ARMCM33.s" version="1.0.0">
         <instance index="0">RTE\Device\ARMCM33_DSP_FP_TZ\startup_ARMCM33.s</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.1.0" condition="ARMCM33 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.2.0" condition="ARMCM33 CMSIS"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
         <targetInfos>
           <targetInfo name="FVP Simulation Model"/>
         </targetInfos>
       </file>
       <file attr="config" category="sourceC" name="Device\ARM\ARMCM33\Source\system_ARMCM33.c" version="1.0.0">
         <instance index="0">RTE\Device\ARMCM33_DSP_FP_TZ\system_ARMCM33.c</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.1.0" condition="ARMCM33 CMSIS"/>
-        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="ARM" Cversion="1.2.0" condition="ARMCM33 CMSIS"/>
+        <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
         <targetInfos>
           <targetInfo name="FVP Simulation Model"/>
         </targetInfos>
index e07fcd2debd974a8ded5befc3f0597da42031ba6..f711f26a55f23317e9732a6c543535f82c6e28ed 100644 (file)
         <sRunDeb>0</sRunDeb>
         <sLrtime>0</sLrtime>
         <bEvRecOn>1</bEvRecOn>
+        <bSchkAxf>0</bSchkAxf>
+        <bTchkAxf>0</bTchkAxf>
         <nTsel>0</nTsel>
         <sDll></sDll>
         <sDllPa></sDllPa>
index fcdc1f4a7bb50d249b91693e9e0230a38ec87783..015238d5e6c866660df989420b47069a3728bc95 100644 (file)
@@ -16,7 +16,7 @@
         <TargetCommonOption>
           <Device>ARMCM4_FP</Device>
           <Vendor>ARM</Vendor>
-          <PackID>ARM.CMSIS.5.5.1</PackID>
+          <PackID>ARM.CMSIS.5.6.0</PackID>
           <PackURL>http://www.keil.com/pack/</PackURL>
           <Cpu>IROM(0x00000000,0x80000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ESEL ELITTLE</Cpu>
           <FlashUtilSpec></FlashUtilSpec>
             <hadXRAM>0</hadXRAM>
             <uocXRam>0</uocXRam>
             <RvdsVP>2</RvdsVP>
+            <RvdsMve>0</RvdsMve>
             <hadIRAM2>0</hadIRAM2>
             <hadIROM2>0</hadIROM2>
             <StupSel>8</StupSel>
             <uThumb>0</uThumb>
             <uSurpInc>0</uSurpInc>
             <uC99>0</uC99>
+            <uGnu>0</uGnu>
             <useXO>0</useXO>
             <v6Lang>0</v6Lang>
             <v6LangP>0</v6LangP>
index 185ac7ba7069c4a171adbca7c17b914d63ab14b3..9a13d6f230e61a573fd00655b1748e77b9c59b01 100644 (file)
@@ -778,7 +778,7 @@ static void prvTaskToDelete( void *pvParameters )
        configASSERT( uxTaskGetStackHighWaterMark2( NULL ) > 0 );\r
        /* Run time stats are not being gathered - this is just to exercise\r
        API. */\r
-       configASSERT( xTaskGetIdleRunTimeCounter() == 0 ); \r
+       configASSERT( ulTaskGetIdleRunTimeCounter() == 0 ); \r
        vTaskSuspend( NULL );\r
 }\r
 /*-----------------------------------------------------------*/\r
index 9fc8cfeb0d3b984168473d993c534e01e2cdc422..65d0104e8d9dd341ea31dbfd9675e927bde27b5e 100644 (file)
@@ -149,10 +149,6 @@ uint32_t ulTestToPerform = abtNOTIFY_WAIT_ABORTS;
 TickType_t xTimeAtStart;\r
 const TickType_t xStartMargin = 2UL;\r
 \r
-/* Used to control whether to use xTaskAbortDelay() or xTaskAbortDelayFromISR() so\r
-both are used with all the tests. */\r
-BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken;\r
-\r
        /* Just to remove compiler warnings. */\r
        ( void ) pvParameters;\r
 \r
@@ -177,46 +173,10 @@ BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken;
                raise the priority of the controlling task to that of the blocking\r
                task to minimise discrepancies. */\r
                vTaskPrioritySet( NULL, abtBLOCKING_PRIORITY );\r
-\r
                vTaskDelay( xMaxBlockTime + xHalfMaxBlockTime + xStartMargin );\r
-\r
-               /* For test coverage sometimes xTaskAbortDelay() is used and sometimes\r
-               xTaskAbortDelayFromISR() is used. */\r
-               if( xUseFromISRVersion == pdFALSE )\r
+               if( xTaskAbortDelay( xBlockingTask ) != pdPASS )\r
                {\r
-                       if( xTaskAbortDelay( xBlockingTask ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       xHigherPriorityTaskWoken = pdFALSE;\r
-\r
-                       /* For test coverage, sometimes xHigherPriorityTaskWoken is used, and\r
-                       sometimes NULL is used. */\r
-\r
-                       if( ( xControllingCycles % 2 ) == 0 )\r
-                       {\r
-                               if( xTaskAbortDelayFromISR( xBlockingTask, &xHigherPriorityTaskWoken ) != pdPASS )\r
-                               {\r
-                                       xErrorOccurred = pdTRUE;\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               if( xTaskAbortDelayFromISR( xBlockingTask, NULL ) != pdPASS )\r
-                               {\r
-                                       xErrorOccurred = pdTRUE;\r
-                               }\r
-                       }\r
-\r
-                       /* The tasks have the same priority so xHigherPriorityTaskWoken should\r
-                       never get set. */\r
-                       if( xHigherPriorityTaskWoken != pdFALSE )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
+                       xErrorOccurred = pdTRUE;\r
                }\r
 \r
                /* Reset the priority to the normal controlling priority. */\r
@@ -241,13 +201,6 @@ BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken;
 \r
                /* To indicate this task is still executing. */\r
                xControllingCycles++;\r
-\r
-               if( ( xControllingCycles % abtMAX_TESTS ) == 0 )\r
-               {\r
-                       /* Looped through all the tests.  Switch between using xTaskAbortDelay()\r
-                       and xTaskAbortDelayFromISR() for the next round of tests. */\r
-                       xUseFromISRVersion = !xUseFromISRVersion;\r
-               }\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -335,12 +288,6 @@ BaseType_t xReturned;
        {\r
                xErrorOccurred = pdTRUE;\r
        }\r
-\r
-       xReturned = xTaskAbortDelayFromISR( xThisTask, NULL );\r
-       if( xReturned != pdFALSE )\r
-       {\r
-               xErrorOccurred = pdTRUE;\r
-       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 97f693c854f8d9360d0a132ac5fbfaea7d2ec991..b9022333ffd04f08332b06c3b80735af165c477d 100644 (file)
@@ -218,7 +218,7 @@ QueueHandle_t xQueue;
        for( ;; )\r
        {\r
                /* The queue is empty, so sending an item to the back of the queue\r
-               should have the same efect as sending it to the front of the queue.\r
+               should have the same effect as sending it to the front of the queue.\r
 \r
                First send to the front and check everything is as expected. */\r
                ulLoopCounterSnapshot = ulLoopCounter;\r
index c5854bc62f63b2eff8567d680da3e5543b6bdce1..3eac259cfdec207b5b251d658a7016a8b6a6ca28 100644 (file)
@@ -971,8 +971,10 @@ BaseType_t xErrorDetected = pdFALSE;
                        else if( xTriggerLevel < xReadBlockTime )\r
                        {\r
                                /* Trigger level was less than the block time so we expect to\r
-                               have received the trigger level number of bytes. */\r
-                               if( ( xTriggerLevel - xBytesReceived ) > xAllowableMargin )\r
+                               have received the trigger level number of bytes - could be more\r
+                               though depending on other activity between the task being\r
+                               unblocked and the task reading the number of bytes received. */\r
+                               if( ( xBytesReceived - xTriggerLevel ) > xAllowableMargin )\r
                                {\r
                                        xErrorDetected = pdTRUE;\r
                                }\r
@@ -983,7 +985,7 @@ BaseType_t xErrorDetected = pdFALSE;
                                receive no greater than the block time, but one or two less is\r
                                ok due to variations in how far through the time slice the\r
                                functions get executed. */\r
-                               if( xBytesReceived > xReadBlockTime )\r
+                               if( ( xBytesReceived - xReadBlockTime ) > xAllowableMargin )\r
                                {\r
                                        xErrorDetected = pdTRUE;\r
                                }\r
index 377ae24d4bb70ec339a6e5e22a01405fd2e32634..3598301483b3edc4ad9835941db2dd158036d3f7 100644 (file)
@@ -31,7 +31,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos_source/include}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freertos_source/portable/GCC/RISC-V}&quot;"/>\r
                                                                </option>\r
-                                                               <option id="gnu.c.compiler.option.misc.other.1598749994" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections --specs=nano.specs -fno-builtin-printf" valueType="string"/>\r
+                                                               <option id="gnu.c.compiler.option.misc.other.1598749994" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections --specs=nano.specs -fno-builtin-printf  -Wno-unused-parameter" valueType="string"/>\r
                                                                <option id="gnu.c.compiler.option.warnings.extrawarn.527816261" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>\r
                                                                <option id="gnu.c.compiler.option.dialect.std.1770102192" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>\r
                                                                <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.252676358" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">\r
index 3132565c1b56c12895780f42ea6134faa829988a..33d8e4cbe26b0fe5ebbea36c05c09b56fc3664f6 100644 (file)
  * See http://www.freertos.org/a00110.html.\r
  *----------------------------------------------------------*/\r
 \r
-#define configCLINT_BASE_ADDRESS               CLINT_CTRL_ADDR\r
+/* See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html */\r
+#define configMTIME_BASE_ADDRESS       ( ( CLINT_CTRL_ADDR ) + 0xBFF8UL )\r
+#define configMTIMECMP_BASE_ADDRESS ( ( CLINT_CTRL_ADDR ) + 0x4000UL )\r
+\r
 #define configUSE_PREEMPTION                   1\r
 #define configUSE_IDLE_HOOK                            0\r
 #define configUSE_TICK_HOOK                            1\r
-#define configCPU_CLOCK_HZ                             ( 10000000 ) /*QEMU*/\r
+#define configCPU_CLOCK_HZ                             ( 1000000 )\r
 #define configTICK_RATE_HZ                             ( ( TickType_t ) 1000 )\r
 #define configMAX_PRIORITIES                   ( 7 )\r
 #define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 105 )\r
 /* Software timer definitions. */\r
 #define configUSE_TIMERS                               1\r
 #define configTIMER_TASK_PRIORITY              ( configMAX_PRIORITIES - 1 )\r
-#define configTIMER_QUEUE_LENGTH               4\r
+#define configTIMER_QUEUE_LENGTH               6\r
 #define configTIMER_TASK_STACK_DEPTH   ( 110 )\r
 \r
 /* Task priorities.  Allow these to be overridden. */\r
index d274e16cc41107eae375bb8a90f65974df5895a7..04c095bcecb8772ae6f088023d79e2698c4b290a 100644 (file)
@@ -74,7 +74,7 @@
 \r
 /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
 or 0 to run the more comprehensive test and demo application. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     0\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     1\r
 \r
 /*\r
  * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
@@ -83,6 +83,7 @@ or 0 to run the more comprehensive test and demo application. */
 #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1\r
        extern void main_blinky( void );\r
 #else\r
+       #warning At the time of writing the QEMU MTIME behaviour is erratic, resulting in test failures.\r
        extern void main_full( void );\r
 #endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */\r
 \r
index 54955b322590e0565e1fa32362356a354800b135..273960b9090e6541635f12e963fed508eeb3a78a 100644 (file)
                                                        </tool>\r
                                                </toolChain>\r
                                        </folderInfo>\r
-                                       <fileInfo id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.2124579326.468406560" name="fsl_lpuart.c" rcbsApplicability="disable" resourcePath="common/rv32m1_sdk_riscv/devices/RV32M1/drivers/fsl_lpuart.c" toolsToInvoke="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.906968630.2006953853">\r
-                                               <tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.906968630.2006953853" name="GNU RISC-V Cross C Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.906968630"/>\r
-                                       </fileInfo>\r
                                        <sourceEntries>\r
                                                <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
                                        </sourceEntries>\r
index 3903ae515aa3dc9e3b8cef3296cd732dea4fbee9..2821797b2e8bcd4680c1ce27d99ba06d557f4016 100644 (file)
@@ -85,8 +85,9 @@
  * See http://www.freertos.org/a00110.html.\r
  *----------------------------------------------------------*/\r
 \r
-#define configCLINT_BASE_ADDRESS               0 /* There is no CLINT so the base address must be set to 0. */\r
-\r
+/* See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html */\r
+#define configMTIME_BASE_ADDRESS       ( 0 )\r
+#define configMTIMECMP_BASE_ADDRESS ( 0 )\r
 \r
 \r
 #define configUSE_PREEMPTION                   1\r
index 79f1a00a1a814ff37e9aa930f7e2c3fa8b87b7d4..e426d946be6188180f9098ee7768bb4ae4edc994 100644 (file)
 #include "hw_platform.h"\r
 #include "riscv_plic.h"\r
 \r
+/* See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html */\r
+#define configMTIME_BASE_ADDRESS       ( ( PRCI_BASE ) + 0xBFF8UL )\r
+#define configMTIMECMP_BASE_ADDRESS ( ( PRCI_BASE ) + 0x4000UL )\r
+\r
+\r
 /*-----------------------------------------------------------\r
  * Application specific definitions.\r
  *\r
@@ -85,7 +90,7 @@
  *\r
  * See http://www.freertos.org/a00110.html.\r
  *----------------------------------------------------------*/\r
-#define configCLINT_BASE_ADDRESS               PRCI_BASE\r
+\r
 #define configUSE_PREEMPTION                   1\r
 #define configUSE_IDLE_HOOK                            1\r
 #define configUSE_TICK_HOOK                            1\r
index d8923ac5bd2a1f7781eb3a8aa6d54ddc51ed8582..0f0d40d3ef8a46e4a24ead225c416682a80eee9b 100644 (file)
@@ -52,7 +52,7 @@
 \r
 /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
 or 0 to run the more comprehensive test and demo application. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     0\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     1\r
 \r
 /*\r
  * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
index a16ab93ba3a45d154c27e29a03a01b22d22485b3..55dfc6b1e2cd4f4819d4066ae5d4e339428514b2 100644 (file)
@@ -3,5 +3,5 @@ mach create "Mi-V"
 machine LoadPlatformDescription @platforms/boards/miv-board.repl
 peripherals
 showAnalyzer sysbus.uart
-sysbus.cpu StartGdbServer 3333 true
+machine StartGdbServer 3333 true
 log "Renode has been started successfully and is ready for a gdb connection. (This is not an error)" 3
index bf5bf028c9a01475d55a4e0da8945ece11459083..97f11d53f43fe09a64b3c164cac95248545dc7fd 100644 (file)
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
-    <PlatformToolset>v140</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
-    <PlatformToolset>v140</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
-    <PlatformToolset>v140</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
index 718c1e1b0a86edcc052fc646f43a7855cdecd2ce..d444d51e0f6087647070407b39375407a248a9f6 100644 (file)
@@ -627,8 +627,8 @@ static portBASE_TYPE xPerformedOneShotTests = pdFALSE;
 TaskHandle_t xTestTask;\r
 TaskStatus_t xTaskInfo;\r
 extern StackType_t uxTimerTaskStack[];\r
-static TickType_t xLastIdleExecutionTime = 0;\r
-TickType_t xIdleExecutionTime;\r
+static uint32_t ulLastIdleExecutionTime = 0;\r
+uint32_t ulIdleExecutionTime;\r
 \r
        /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and\r
        xTaskGetIdleTaskHandle() functions.  Also try using the function that sets\r
@@ -728,12 +728,12 @@ TickType_t xIdleExecutionTime;
                }\r
        }\r
 \r
-       xIdleExecutionTime = xTaskGetIdleRunTimeCounter();\r
-       if( xIdleExecutionTime == xLastIdleExecutionTime )\r
+       ulIdleExecutionTime = ulTaskGetIdleRunTimeCounter();\r
+       if( ulIdleExecutionTime == ulLastIdleExecutionTime )\r
        {\r
                pcStatusMessage = "Error: Total amount of Idle task execution time did not change";\r
        }\r
-       xLastIdleExecutionTime = xIdleExecutionTime;\r
+       ulLastIdleExecutionTime = ulIdleExecutionTime;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 0c932dc9eec0a6a4028fee7d15a3261ef924a362..3a22164f5ccf0b4d8ed15bd0e393560cb74dc70d 100644 (file)
@@ -26,11 +26,13 @@ Changes since the last release:
          ports.\r
        + Updated the behaviour of the ARMv7-M MPU (Memory Protection Unit) ports to\r
          match that of the ARMv8-M ports whereby privilege escalations can only\r
-         originate from within the kernel's own memory segment.\r
+         originate from within the kernel's own memory segment.  Added\r
+         configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY configuration constant.\r
+       +  Update existing MPU ports to correctly disable the MPU before it is\r
+          updated.\r
        + Added LPC51U68 Cortex-M0+ port for GCC (MCUXpresso), Keil and IAR\r
          compilers.\r
        + Added CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube demo.\r
-       + Added xTaskAbortDelayFromISR() API function.\r
        + Added xTaskNotifyValueClear() API function.\r
        + Improve timing accuracy (reduce clock slippage when compared to real time)\r
          in the Windows simulator port by using a waitable timer to determine the\r
@@ -38,6 +40,8 @@ Changes since the last release:
        + Added T-Head demo.\r
        + Added LPC54018 MPU demo.\r
        + Added uxTimerGetReloadMode() API function.\r
+       + Rename xTaskGetIdleRunTimeCounter() to ulTaskGetIdleRunTimeCounter().\r
+       + Added RISC-V port for IAR compiler.\r
 \r
 \r
 Changes between FreeRTOS V10.2.1 and FreeRTOS V10.2.0 released May 13 2019:\r
index c2ebf24c33d88b4a3d80419508e3beab51b51843..33e9fa6b65a0f3ab178a2df3821263e384ddd35b 100644 (file)
@@ -953,6 +953,7 @@ V8 if desired. */
        #define pcTimerGetTimerName pcTimerGetName\r
        #define pcQueueGetQueueName pcQueueGetName\r
        #define vTaskGetTaskInfo vTaskGetInfo\r
+       #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter\r
 \r
        /* Backward compatibility within the scheduler code only - these definitions\r
        are not really required but are included for completeness. */\r
index 40e1e533ddf8a7ff3e7be2ac3a0dcb8bfa35d4a5..62302f066745d47820d829f8a868493d5c3b5836 100644 (file)
@@ -831,6 +831,11 @@ void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xT
  * task will leave the Blocked state, and return from whichever function call\r
  * placed the task into the Blocked state.\r
  *\r
+ * There is no 'FromISR' version of this function as an interrupt would need to\r
+ * know which object a task was blocked on in order to know which actions to\r
+ * take.  For example, if the task was blocked on a queue the interrupt handler\r
+ * would then need to know if the queue was locked.\r
+ *\r
  * @param xTask The handle of the task to remove from the Blocked state.\r
  *\r
  * @return If the task referenced by xTask was not in the Blocked state then\r
@@ -841,39 +846,6 @@ void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xT
  */\r
 BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
 \r
-/**\r
-* task. h\r
-* <pre>BaseType_t xTaskAbortDelayFromISR( TaskHandle_t xTask, BaseType_t * const pxHigherPriorityTaskWoken )</pre>\r
-*\r
-* INCLUDE_xTaskAbortDelay must be defined as 1 in FreeRTOSConfig.h for this\r
-* function to be available.\r
-*\r
-* A version of xTaskAbortDelay() that can be used from an interrupt service routine.\r
-*\r
-* A task will enter the Blocked state when it is waiting for an event.  The\r
-* event it is waiting for can be a temporal event (waiting for a time), such\r
-* as when vTaskDelay() is called, or an event on an object, such as when\r
-* xQueueReceive() or ulTaskNotifyTake() is called.  If the handle of a task\r
-* that is in the Blocked state is used in a call to xTaskAbortDelay() then the\r
-* task will leave the Blocked state, and return from whichever function call\r
-* placed the task into the Blocked state.\r
-*\r
-* @param xTask The handle of the task to remove from the Blocked state.\r
-*\r
-* @param pxHigherPriorityTaskWoken xTaskAbortDelayFromISR() will set\r
-* *pxHigherPriorityTaskWoken to pdTRUE if a task was removed from the Blocked state,\r
-* and the task that was removed from the Blocked state has a priority higher than the\r
-* currently running task.  If xTaskAbortDelayFromISR() sets this value to pdTRUE then\r
-* a context switch should be requested before the interrupt is exited.\r
-*\r
-* @return If the task referenced by xTask was not in the Blocked state then\r
-* pdFAIL is returned.  Otherwise pdPASS is returned.\r
-*\r
-* \defgroup xTaskAbortDelay xTaskAbortDelayFromISR\r
-* \ingroup TaskCtrl\r
-*/\r
-BaseType_t xTaskAbortDelayFromISR( TaskHandle_t xTask, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
-\r
 /**\r
  * task. h\r
  * <pre>UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask );</pre>\r
index 415255f6fd5ba8717f30fe51b9774f02928d7c9d..54f37e0e127fa89a34ff2b2825c9183da282cb1b 100644 (file)
@@ -295,7 +295,7 @@ portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue )
 #define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )\r
 \r
 #ifndef configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY\r
-       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security."\r
+       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security. https://www.freertos.org/FreeRTOS-V10.3.x.html"\r
        #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 0\r
 #endif\r
 /*-----------------------------------------------------------*/\r
index 415255f6fd5ba8717f30fe51b9774f02928d7c9d..54f37e0e127fa89a34ff2b2825c9183da282cb1b 100644 (file)
@@ -295,7 +295,7 @@ portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue )
 #define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )\r
 \r
 #ifndef configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY\r
-       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security."\r
+       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security. https://www.freertos.org/FreeRTOS-V10.3.x.html"\r
        #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 0\r
 #endif\r
 /*-----------------------------------------------------------*/\r
index 7ce23b849ee8bc6bae5e744c8f2d98eda070fb02..995ec79379f055ffd77469351dab84107fc92756 100644 (file)
@@ -53,6 +53,7 @@
 #ifndef __FREERTOS_RISC_V_EXTENSIONS_H__\r
 #define __FREERTOS_RISC_V_EXTENSIONS_H__\r
 \r
+#define portasmHAS_SIFIVE_CLINT 1\r
 #define portasmHAS_MTIME 1\r
 #define portasmADDITIONAL_CONTEXT_SIZE 0 /* Must be even number on 32-bit cores. */\r
 \r
@@ -60,7 +61,6 @@
        /* No additional registers to save, so this macro does nothing. */\r
        .endm\r
 \r
-/* Restore the additional registers found on the Pulpino. */\r
 .macro portasmRESTORE_ADDITIONAL_REGISTERS\r
        /* No additional registers to restore, so this macro does nothing. */\r
        .endm\r
index 511882d3809a08e4e096f4578721d970b71a706f..89b468e997192e5ddf503d46b7bf152261410d5c 100644 (file)
 #include "string.h"\r
 \r
 #ifdef configCLINT_BASE_ADDRESS\r
-       #warning The configCLINT_BASE_ADDRESS constant has been deprecated.  configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS are currently being derived from the (possibly 0) configCLINT_BASE_ADDRESS setting.  Please update to define configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS dirctly in place of configCLINT_BASE_ADDRESS.\r
+       #warning The configCLINT_BASE_ADDRESS constant has been deprecated.  configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS are currently being derived from the (possibly 0) configCLINT_BASE_ADDRESS setting.  Please update to define configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS dirctly in place of configCLINT_BASE_ADDRESS.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifndef configMTIME_BASE_ADDRESS\r
-       #warning configMTIME_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtime register then set configMTIME_BASE_ADDRESS to the mapped address.  Otherwise set configMTIME_BASE_ADDRESS to 0.\r
+       #warning configMTIME_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtime register then set configMTIME_BASE_ADDRESS to the mapped address.  Otherwise set configMTIME_BASE_ADDRESS to 0.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifndef configMTIMECMP_BASE_ADDRESS\r
-       #warning configMTIMECMP_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtimecmp register then set configMTIMECMP_BASE_ADDRESS to the mapped address.  Otherwise set configMTIMECMP_BASE_ADDRESS to 0.\r
+       #warning configMTIMECMP_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtimecmp register then set configMTIMECMP_BASE_ADDRESS to the mapped address.  Otherwise set configMTIMECMP_BASE_ADDRESS to 0.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 /* Let the user override the pre-loading of the initial LR with the address of\r
@@ -72,7 +72,7 @@ interrupt stack after the scheduler has started. */
        /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for\r
        the task stacks, and so will legitimately appear in many positions within\r
        the ISR stack. */\r
-       #define portISR_STACK_FILL_BYTE 0xee    \r
+       #define portISR_STACK_FILL_BYTE 0xee\r
 #else\r
        extern const uint32_t __freertos_irq_stack_top[];\r
        const StackType_t xISRStackTop = ( StackType_t ) __freertos_irq_stack_top;\r
index a5756f9786b53fb50e92f7202ca8938c49395cf4..fe142dfc96cac63ade87364c73b59fbc81474e1f 100644 (file)
 /* Check the freertos_risc_v_chip_specific_extensions.h and/or command line\r
 definitions. */\r
 #if defined( portasmHAS_CLINT ) && defined( portasmHAS_MTIME )\r
-       #error The portasmHAS_CLINT constant has been depracted.  Please replace it with portasmHAS_CLINT.  portasmHAS_CLINT and portasmHAS_MTIME cannot both be defined at once.\r
+       #error The portasmHAS_CLINT constant has been deprecated.  Please replace it with portasmHAS_MTIME.  portasmHAS_CLINT and portasmHAS_MTIME cannot both be defined at once.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifdef portasmHAS_CLINT\r
-       #warning The portasmHAS_CLINT constant has been depracted.  Please replace it with portasmHAS_CLINT.  For now portasmHAS_MTIME is derived from portasmHAS_CLINT.\r
+       #warning The portasmHAS_CLINT constant has been deprecated.  Please replace it with portasmHAS_MTIME and portasmHAS_SIFIVE_CLINT.  For now portasmHAS_MTIME and portasmHAS_SIFIVE_CLINT are derived from portasmHAS_CLINT.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
        #define portasmHAS_MTIME portasmHAS_CLINT\r
+       #define portasmHAS_SIFIVE_CLINT portasmHAS_CLINT\r
 #endif\r
 \r
 #ifndef portasmHAS_MTIME\r
-       #error freertos_risc_v_chip_specific_extensions.h must define portasmHAS_MTIME to either 1 (MTIME clock present) or 0 (MTIME clock not present).\r
+       #error freertos_risc_v_chip_specific_extensions.h must define portasmHAS_MTIME to either 1 (MTIME clock present) or 0 (MTIME clock not present).  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifndef portasmHANDLE_INTERRUPT\r
-       #error portasmHANDLE_INTERRUPT must be defined to the function to be called to handle external/peripheral interrupts.  portasmHANDLE_INTERRUPT can be defined on the assmbler command line or in the appropriate freertos_risc_v_chip_specific_extensions.h header file.\r
+       #error portasmHANDLE_INTERRUPT must be defined to the function to be called to handle external/peripheral interrupts.  portasmHANDLE_INTERRUPT can be defined on the assembler command line or in the appropriate freertos_risc_v_chip_specific_extensions.h header file.  https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
+#endif\r
+\r
+#ifndef portasmHAS_SIFIVE_CLINT\r
+       #define portasmHAS_SIFIVE_CLINT 0\r
 #endif\r
 \r
 /* Only the standard core registers are stored by default.  Any additional\r
@@ -293,7 +298,7 @@ processed_source:
 .func\r
 xPortStartFirstTask:\r
 \r
-#if( portasmHAS_MTIME != 0 )\r
+#if( portasmHAS_SIFIVE_CLINT != 0 )\r
        /* If there is a clint then interrupts can branch directly to the FreeRTOS\r
        trap handler.  Otherwise the interrupt controller will need to be configured\r
        outside of this file. */\r
index 51de83ba043587daf194ba16f50af8eb18a3199b..f0e759fec3c6bc45901be98c3284bb61ae61d68f 100644 (file)
@@ -246,7 +246,7 @@ extern void vResetPrivilege( void );
 /*-----------------------------------------------------------*/\r
 \r
 #ifndef configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY\r
-       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security."\r
+       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security. https://www.freertos.org/FreeRTOS-V10.3.x.html"\r
        #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 0\r
 #endif\r
 /*-----------------------------------------------------------*/\r
index 51c9057babd5ee861455665c49b22473a587b00d..dda6f3f6d1dcd0eb8e72db209f6b05898c69a291 100644 (file)
@@ -53,6 +53,7 @@
 #ifndef __FREERTOS_RISC_V_EXTENSIONS_H__\r
 #define __FREERTOS_RISC_V_EXTENSIONS_H__\r
 \r
+#define portasmHAS_SIFIVE_CLINT 1\r
 #define portasmHAS_MTIME 1\r
 #define portasmADDITIONAL_CONTEXT_SIZE 0 /* Must be even number on 32-bit cores. */\r
 \r
@@ -60,7 +61,6 @@ portasmSAVE_ADDITIONAL_REGISTERS MACRO
        /* No additional registers to save, so this macro does nothing. */\r
        ENDM\r
 \r
-/* Restore the additional registers found on the Pulpino. */\r
 portasmRESTORE_ADDITIONAL_REGISTERS MACRO\r
        /* No additional registers to restore, so this macro does nothing. */\r
        ENDM\r
index 3fb3e22e669ed393bcba8b5bd75103bece44a248..985c9f0998cd8dc02819a4b5ac85af1b4beb8e07 100644 (file)
 #include "string.h"\r
 \r
 #ifdef configCLINT_BASE_ADDRESS\r
-       #warning The configCLINT_BASE_ADDRESS constant has been deprecated.  configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS are currently being derived from the (possibly 0) configCLINT_BASE_ADDRESS setting.  Please update to define configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS dirctly in place of configCLINT_BASE_ADDRESS.\r
+       #warning The configCLINT_BASE_ADDRESS constant has been deprecated.  configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS are currently being derived from the (possibly 0) configCLINT_BASE_ADDRESS setting.  Please update to define configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS dirctly in place of configCLINT_BASE_ADDRESS.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifndef configMTIME_BASE_ADDRESS\r
-       #warning configMTIME_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtime register then set configMTIME_BASE_ADDRESS to the mapped address.  Otherwise set configMTIME_BASE_ADDRESS to 0.\r
+       #warning configMTIME_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtime register then set configMTIME_BASE_ADDRESS to the mapped address.  Otherwise set configMTIME_BASE_ADDRESS to 0.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifndef configMTIMECMP_BASE_ADDRESS\r
-       #warning configMTIMECMP_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtimecmp register then set configMTIMECMP_BASE_ADDRESS to the mapped address.  Otherwise set configMTIMECMP_BASE_ADDRESS to 0.\r
+       #warning configMTIMECMP_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a memory-mapped mtimecmp register then set configMTIMECMP_BASE_ADDRESS to the mapped address.  Otherwise set configMTIMECMP_BASE_ADDRESS to 0.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 /* Let the user override the pre-loading of the initial LR with the address of\r
index d04a30802cfc04f7e1f492d52765e20fc72bd0c3..473725fa31515975ff725972270699e3d56dd9f6 100644 (file)
 /* Check the freertos_risc_v_chip_specific_extensions.h and/or command line\r
 definitions. */\r
 #if defined( portasmHAS_CLINT ) && defined( portasmHAS_MTIME )\r
-       #error The portasmHAS_CLINT constant has been depracted.  Please replace it with portasmHAS_CLINT.  portasmHAS_CLINT and portasmHAS_MTIME cannot both be defined at once.\r
+       #error The portasmHAS_CLINT constant has been deprecated.  Please replace it with portasmHAS_MTIME.  portasmHAS_CLINT and portasmHAS_MTIME cannot both be defined at once.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifdef portasmHAS_CLINT\r
-       #warning The portasmHAS_CLINT constant has been depracted.  Please replace it with portasmHAS_CLINT.  For now portasmHAS_MTIME is derived from portasmHAS_CLINT.\r
+       #warning The portasmHAS_CLINT constant has been deprecated.  Please replace it with portasmHAS_MTIME and portasmHAS_SIFIVE_CLINT.  For now portasmHAS_MTIME and portasmHAS_SIFIVE_CLINT are derived from portasmHAS_CLINT.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
        #define portasmHAS_MTIME portasmHAS_CLINT\r
+       #define portasmHAS_SIFIVE_CLINT portasmHAS_CLINT\r
 #endif\r
 \r
 #ifndef portasmHAS_MTIME\r
-       #error freertos_risc_v_chip_specific_extensions.h must define portasmHAS_MTIME to either 1 (MTIME clock present) or 0 (MTIME clock not present).\r
+       #error freertos_risc_v_chip_specific_extensions.h must define portasmHAS_MTIME to either 1 (MTIME clock present) or 0 (MTIME clock not present).  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 #ifndef portasmHANDLE_INTERRUPT\r
-       #error portasmHANDLE_INTERRUPT must be defined to the function to be called to handle external/peripheral interrupts.  portasmHANDLE_INTERRUPT can be defined on the assmbler command line or in the appropriate freertos_risc_v_chip_specific_extensions.h header file.\r
+       #error portasmHANDLE_INTERRUPT must be defined to the function to be called to handle external/peripheral interrupts.  portasmHANDLE_INTERRUPT can be defined on the assembler command line or in the appropriate freertos_risc_v_chip_specific_extensions.h header file.  https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
+#endif\r
+\r
+\r
+#ifndef portasmHAS_SIFIVE_CLINT\r
+       #define portasmHAS_SIFIVE_CLINT 0\r
 #endif\r
 \r
 /* CSR definitions. */\r
@@ -299,7 +305,7 @@ processed_source:
 \r
 xPortStartFirstTask:\r
 \r
-#if( portasmHAS_MTIME != 0 )\r
+#if( portasmHAS_SIFIVE_CLINT != 0 )\r
        /* If there is a clint then interrupts can branch directly to the FreeRTOS\r
        trap handler.  Otherwise the interrupt controller will need to be configured\r
        outside of this file. */\r
index be659fd4f49b3a11bae389cd9c0e16783120d12c..79e8b4d46334aa17de5ac82c69a4a46879ab1033 100644 (file)
@@ -248,11 +248,11 @@ void vPortEnterCritical( void )
 void vPortExitCritical( void )\r
 {\r
        configASSERT( uxCriticalNesting );\r
-    uxCriticalNesting--;\r
-    if( uxCriticalNesting == 0 )\r
-    {\r
-        portENABLE_INTERRUPTS();\r
-    }\r
+       uxCriticalNesting--;\r
+       if( uxCriticalNesting == 0 )\r
+       {\r
+               portENABLE_INTERRUPTS();\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 3cd73b29417ccd81dd7f9edc69208aef583fa8d3..0d92e0b314957fb87b20cd963a9ca9cade1420e3 100644 (file)
@@ -268,8 +268,8 @@ uint32_t ulReg, ulPC;
                case portSVC_RAISE_PRIVILEGE    :       /* Only raise the privilege, if the\r
                                                                                         * svc was raised from any of the\r
                                                                                         * system calls. */\r
-                                                                                       if( ulPC >= ( uint32_t ) __syscalls_flash_start__ &&\r
-                                                                                               ulPC <= ( uint32_t ) __syscalls_flash_end__ )\r
+                                                                                       if( ( ulPC >= ( uint32_t ) __syscalls_flash_start__ ) &&\r
+                                                                                               ( ulPC <= ( uint32_t ) __syscalls_flash_end__ ) )\r
                                                                                        {\r
                                                                                                __asm\r
                                                                                                {\r
index bd9e1c9a3963e5d6452016ceffa80f588323db71..431ea4c31862b2c9e53ee04ad5739eb47c721723 100644 (file)
@@ -303,7 +303,7 @@ BaseType_t xReturn;
 /*-----------------------------------------------------------*/\r
 \r
 #ifndef configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY\r
-       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security."\r
+       #warning "configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY is not defined. We recommend defining it to 1 in FreeRTOSConfig.h for better security. https://www.freertos.org/FreeRTOS-V10.3.x.html"\r
        #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 0\r
 #endif\r
 /*-----------------------------------------------------------*/\r
index 20044337e4675c68afa5835d6e555678b69593f1..e6efe7f8b4462c10dfe4f33db9c07ffa2f184d3f 100644 (file)
@@ -2195,7 +2195,6 @@ BaseType_t xTaskResumeAll( void )
 {\r
 TCB_t *pxTCB = NULL;\r
 BaseType_t xAlreadyYielded = pdFALSE;\r
-TickType_t xTicksToNextUnblockTime;\r
 \r
        /* If uxSchedulerSuspended is zero then this function does not match a\r
        previous call to vTaskSuspendAll(). */\r
@@ -2250,51 +2249,30 @@ TickType_t xTicksToNextUnblockTime;
                                they should be processed now.  This ensures the tick count does\r
                                not     slip, and that any delayed tasks are resumed at the correct\r
                                time. */\r
-                               while( xPendedTicks > ( TickType_t ) 0 )\r
                                {\r
-                                       /* Calculate how far into the future the next task will\r
-                                       leave the Blocked state because its timeout expired.  If\r
-                                       there are no tasks due to leave the blocked state between\r
-                                       the time now and the time at which the tick count overflows\r
-                                       then xNextTaskUnblockTime will the tick overflow time.\r
-                                       This means xNextTaskUnblockTime can never be less than\r
-                                       xTickCount, and the following can therefore not\r
-                                       underflow. */\r
-                                       configASSERT( xNextTaskUnblockTime >= xTickCount );\r
-                                       xTicksToNextUnblockTime = xNextTaskUnblockTime - xTickCount;\r
+                                       TickType_t xPendedCounts = xPendedTicks; /* Non-volatile copy. */\r
 \r
-                                       /* Don't want to move the tick count more than the number\r
-                                       of ticks that are pending, so cap if necessary. */\r
-                                       if( xTicksToNextUnblockTime > xPendedTicks )\r
+                                       if( xPendedCounts > ( TickType_t ) 0U )\r
                                        {\r
-                                               xTicksToNextUnblockTime = xPendedTicks;\r
-                                       }\r
+                                               do\r
+                                               {\r
+                                                       if( xTaskIncrementTick() != pdFALSE )\r
+                                                       {\r
+                                                               xYieldPending = pdTRUE;\r
+                                                       }\r
+                                                       else\r
+                                                       {\r
+                                                               mtCOVERAGE_TEST_MARKER();\r
+                                                       }\r
+                                                       --xPendedCounts;\r
+                                               } while( xPendedCounts > ( TickType_t ) 0U );\r
 \r
-                                       if( xTicksToNextUnblockTime == 0 )\r
-                                       {\r
-                                               /* xTicksToNextUnblockTime could be zero if the tick\r
-                                               count is about to overflow and xTicksToNetUnblockTime\r
-                                               holds the time at which the tick count will overflow\r
-                                               (rather than the time at which the next task will\r
-                                               unblock).  Set to 1 otherwise xPendedTicks won't be\r
-                                               decremented below. */\r
-                                               xTicksToNextUnblockTime = ( TickType_t ) 1;\r
+                                               xPendedTicks = 0;\r
                                        }\r
-                                       else if( xTicksToNextUnblockTime > ( TickType_t ) 1 )\r
+                                       else\r
                                        {\r
-                                               /* Move the tick count one short of the next unblock\r
-                                               time, then call xTaskIncrementTick() to move the tick\r
-                                               count up to the next unblock time to unblock the task,\r
-                                               if any.  This will also swap the blocked task and\r
-                                               overflow blocked task lists if necessary. */\r
-                                               xTickCount += ( xTicksToNextUnblockTime - ( TickType_t ) 1 );\r
+                                               mtCOVERAGE_TEST_MARKER();\r
                                        }\r
-                                       xYieldPending |= xTaskIncrementTick();\r
-\r
-                                       /* Adjust for the number of ticks just added to\r
-                                       xTickCount and go around the loop again if\r
-                                       xTicksToCatchUp is still greater than 0. */\r
-                                       xPendedTicks -= xTicksToNextUnblockTime;\r
                                }\r
 \r
                                if( xYieldPending != pdFALSE )\r
@@ -2646,91 +2624,6 @@ BaseType_t xYieldRequired = pdFALSE;
 }\r
 /*----------------------------------------------------------*/\r
 \r
-#if ( INCLUDE_xTaskAbortDelay == 1 )\r
-\r
-       BaseType_t xTaskAbortDelayFromISR( TaskHandle_t xTask, BaseType_t * const pxHigherPriorityTaskWoken )\r
-       {\r
-       TCB_t *pxTCB = xTask;\r
-       BaseType_t xReturn;\r
-       UBaseType_t uxSavedInterruptStatus;\r
-\r
-               configASSERT( pxTCB );\r
-\r
-               /* RTOS ports that support interrupt nesting have the concept of a maximum\r
-               system call (or maximum API call) interrupt priority.  Interrupts that are\r
-               above the maximum system call priority are kept permanently enabled, even\r
-               when the RTOS kernel is in a critical section, but cannot make any calls to\r
-               FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
-               then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
-               failure if a FreeRTOS API function is called from an interrupt that has been\r
-               assigned a priority above the configured maximum system call priority.\r
-               Only FreeRTOS functions that end in FromISR can be called from interrupts\r
-               that have been assigned a priority at or (logically) below the maximum\r
-               system call     interrupt priority.  FreeRTOS maintains a separate interrupt\r
-               safe API to ensure interrupt entry is as fast and as simple as possible.\r
-               More information (albeit Cortex-M specific) is provided on the following\r
-               link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
-               portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
-\r
-               uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
-               {\r
-                       /* A task can only be prematurely removed from the Blocked state if\r
-                       it is actually in the Blocked state. */\r
-                       if( eTaskGetState( xTask ) == eBlocked )\r
-                       {\r
-                               xReturn = pdPASS;\r
-\r
-                               /* Remove the reference to the task from the blocked list.  A higher\r
-                               priority interrupt won't touch the xStateListItem because of the\r
-                               critical section. */\r
-                               ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
-\r
-                               /* Is the task waiting on an event also?  If so remove it from\r
-                               the event list too. */\r
-                               if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL )\r
-                               {\r
-                                       ( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
-\r
-                                       /* This lets the task know it was forcibly removed from the\r
-                                       blocked state so it should not re-evaluate its block time and\r
-                                       then block again. */\r
-                                       pxTCB->ucDelayAborted = pdTRUE;\r
-                               }\r
-                               else\r
-                               {\r
-                                       mtCOVERAGE_TEST_MARKER();\r
-                               }\r
-\r
-                               /* Place the unblocked task into the appropriate ready list. */\r
-                               prvAddTaskToReadyList( pxTCB );\r
-\r
-                               if( pxTCB->uxPriority > pxCurrentTCB->uxPriority )\r
-                               {\r
-                                       if( pxHigherPriorityTaskWoken != NULL )\r
-                                       {\r
-                                               /* Pend the yield to be performed when the scheduler\r
-                                               is unsuspended. */\r
-                                               *pxHigherPriorityTaskWoken = pdTRUE;\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       mtCOVERAGE_TEST_MARKER();\r
-                               }\r
-                       }\r
-                       else\r
-                       {\r
-                               xReturn = pdFAIL;\r
-                       }\r
-               }\r
-               portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
-\r
-               return xReturn;\r
-       }\r
-\r
-#endif\r
-/*----------------------------------------------------------*/\r
-\r
 #if ( INCLUDE_xTaskAbortDelay == 1 )\r
 \r
        BaseType_t xTaskAbortDelay( TaskHandle_t xTask )\r