]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/Secure/main_s.c
Update version number ready for next release.
[freertos] / FreeRTOS / Demo / CORTEX_MPU_M33F_Simulator_Keil_GCC / Secure / main_s.c
index 0d7600a41b8b9fe96fa8271bf12fbbe5fdc68adf..f32f47a215867ed8dae711e6831dd680a6984054 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * FreeRTOS Kernel V10.2.0\r
+ * FreeRTOS Kernel V10.2.1\r
  * Copyright (C) 2019 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
 #include "secure_port_macros.h"\r
 \r
 /* Start address of non-secure application. */\r
-#define mainNONSECURE_APP_START_ADDRESS     ( 0x200000U )\r
+#define mainNONSECURE_APP_START_ADDRESS                ( 0x200000U )\r
 \r
 /* typedef for non-secure Reset Handler. */\r
-typedef void ( *NonSecureResetHandler_t )   ( void ) __attribute__( ( cmse_nonsecure_call ) );\r
+typedef void ( *NonSecureResetHandler_t )      ( void ) __attribute__( ( cmse_nonsecure_call ) );\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Boot into the non-secure code. */\r
 void BootNonSecure( uint32_t ulNonSecureStartAddress );\r
 /*-----------------------------------------------------------*/\r
 \r
-void BootNonSecure( uint32_t ulNonSecureStartAddress )\r
-{\r
-    NonSecureResetHandler_t pxNonSecureResetHandler;\r
-\r
-    /* Main Stack Pointer value for the non-secure side is the first entry in\r
-     * the non-secure vector table. Read the first entry and assign the same to\r
-     * the non-secure main stack pointer(MSP_NS). */\r
-    secureportSET_MSP_NS( *( ( uint32_t * )( ulNonSecureStartAddress ) ) );\r
+/*\r
+ *     Instructions to Build and Run:\r
+ *      - The Keil multi-project workspace FreeRTOSDemo.uvmpw contains projects for\r
+ *        both the secure project, and non secure project.\r
+ *      - Set the FreeRTOSDemo_s project as Active - Right click on\r
+ *        "Project: FreeRTOSDemo_s" and select "Set as Active Project".\r
+ *      - Build the FreeRTOSDemo_s project using "Project --> Build" or by pressing\r
+ *        "F7".\r
+ *      - Set the FreeRTOSDemo_ns project as Active - Right click on\r
+ *        "Project: FreeRTOSDemo_ns" and select "Set as Active Project".\r
+ *      - Build the FreeRTOSDemo_ns project using "Project --> Build" or by\r
+ *        pressing "F7".\r
+ *      - Start Debug Session using "Debug -> Start/Stop Debug Session" or by\r
+ *        pressing "Ctrl+F5".\r
+ */\r
 \r
-    /* Non secure Reset Handler is the second entry in the non-secure vector\r
-     * table. Read the non-secure reset handler.\r
-     */\r
-    pxNonSecureResetHandler = ( NonSecureResetHandler_t )( * ( ( uint32_t * ) ( ( ulNonSecureStartAddress ) + 4U ) ) );\r
+/* Secure main() */\r
+int main( void )\r
+{\r
+       /* Boot the non-secure code. */\r
+       BootNonSecure( mainNONSECURE_APP_START_ADDRESS );\r
 \r
-    /* Start non-secure software application by jumping to the non-secure Reset\r
-     * Handler. */\r
-    pxNonSecureResetHandler();\r
+       /* Non-secure software does not return, this code is not executed. */\r
+       for( ; ; )\r
+       {\r
+               /* Should not reach here. */\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-/* Secure main() */\r
-int main( void )\r
+void BootNonSecure( uint32_t ulNonSecureStartAddress )\r
 {\r
-    /* Boot the non-secure code. */\r
-    BootNonSecure( mainNONSECURE_APP_START_ADDRESS );\r
+       NonSecureResetHandler_t pxNonSecureResetHandler;\r
 \r
-    /* Non-secure software does not return, this code is not executed. */\r
-    for( ; ; )\r
-    {\r
-        /* Should not reach here. */\r
-    }\r
+       /* Main Stack Pointer value for the non-secure side is the first entry in\r
+        * the non-secure vector table. Read the first entry and assign the same to\r
+        * the non-secure main stack pointer(MSP_NS). */\r
+       secureportSET_MSP_NS( *( ( uint32_t * )( ulNonSecureStartAddress ) ) );\r
+\r
+       /* Non secure Reset Handler is the second entry in the non-secure vector\r
+        * table. Read the non-secure reset handler.\r
+        */\r
+       pxNonSecureResetHandler = ( NonSecureResetHandler_t )( * ( ( uint32_t * ) ( ( ulNonSecureStartAddress ) + 4U ) ) );\r
+\r
+       /* Start non-secure software application by jumping to the non-secure Reset\r
+        * Handler. */\r
+       pxNonSecureResetHandler();\r
 }\r
 /*-----------------------------------------------------------*/\r
+\r