Skip to content

Commit

Permalink
feat: Upgraded FreeRTOS to v10.4.6
Browse files Browse the repository at this point in the history
Signed-off-by: Taras Drozdovskyi <[email protected]>
  • Loading branch information
tdrozdovsky committed May 16, 2024
1 parent f25e91b commit 71d1ebb
Show file tree
Hide file tree
Showing 61 changed files with 23,313 additions and 21,524 deletions.
75 changes: 75 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,40 @@ arch/cortex-m23/m2351/src/StdDriver/

freertos/
^^^^^^^^
/*
* FreeRTOS Kernel V10.4.6
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/

freertos/portable/GCC/RISC-V/pmp.c
freertos/portable/GCC/RISC-V/pmp.h
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/* Copyright 2020 SiFive, Inc */
/* SPDX-License-Identifier: Apache-2.0 */

/*
* FreeRTOS Kernel V10.2.1
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Expand Down Expand Up @@ -310,6 +344,47 @@ freertos/
* 1 tab == 4 spaces!
*/

/*
* The FreeRTOS kernel's RISC-V port is split between the the code that is
* common across all currently supported RISC-V chips (implementations of the
* RISC-V ISA), and code which tailors the port to a specific RISC-V chip:
*
* + The code that is common to all RISC-V chips is implemented in
* FreeRTOS\Source\portable\GCC\RISC-V-RV32\portASM.S. There is only one
* portASM.S file because the same file is used no matter which RISC-V chip is
* in use.
*
* + The code that tailors the kernel's RISC-V port to a specific RISC-V
* chip is implemented in freertos_risc_v_chip_specific_extensions.h. There
* is one freertos_risc_v_chip_specific_extensions.h that can be used with any
* RISC-V chip that both includes a standard CLINT and does not add to the
* base set of RISC-V registers. There are additional
* freertos_risc_v_chip_specific_extensions.h files for RISC-V implementations
* that do not include a standard CLINT or do add to the base set of RISC-V
* registers.
*
* CARE MUST BE TAKEN TO INCLUDE THE CORRECT
* freertos_risc_v_chip_specific_extensions.h HEADER FILE FOR THE CHIP
* IN USE. To include the correct freertos_risc_v_chip_specific_extensions.h
* header file ensure the path to the correct header file is in the assembler's
* include path.
*
* This freertos_risc_v_chip_specific_extensions.h is for use on RISC-V chips
* that include a standard CLINT and do not add to the base set of RISC-V
* registers.
*
*/

/* ------------------------------------------------------------------
* This file is part of the FreeRTOS distribution and was contributed
* to the project by SiFive
* ------------------------------------------------------------------
*/

freertos/portable/GCC/RISC-V/port.c
freertos/portable/GCC/RISC-V/portASM.S
freertos/portable/GCC/RISC-V/portmacro.h
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

crypto/libtomcrypt/include/tomcrypt_argchk.h
crypto/libtomcrypt/include/tomcrypt_cfg.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CFLAGS += -I$(TOPDIR)/tee_client/public
CFLAGS += -I$(TOPDIR)/tee_client/libteec/include/freertos

CFLAGS += -I../../Device/ARM/ARMCM33/Include \
-I../../CMSIS/Core/Include \
-I../../CMSIS/Include \
-I../common

ifeq ($(CONFIG_APPS_HELLO_WORLD),y)
Expand Down
2 changes: 1 addition & 1 deletion arch/cortex-m33/mps2/src/mps2_an505_qemu/secure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CFLAGS += -I../../CMSIS/Include
CFLAGS += -I../../StdDriver/inc
CFLAGS += -I../../Device/
CFLAGS += -I../../Device/ARM/ARMCM33/Include
CFLAGS += -I../../CMSIS/Core/Include
CFLAGS += -I../../CMSIS/Include
CFLAGS += -I../common

CFLAGS += -I$(TOPDIR)/tee_client/public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/* Freedom metal includes. */
#include <metal/machine.h>
#include <metal-platform.h>
#include <printf.h>

#include <stdio.h>
#include <string.h>
Expand All @@ -24,7 +25,6 @@ __attribute__((constructor)) static void FreeRTOS_init(void);

void vExceptionFaultHandler(struct metal_cpu *cpu, int ecode)
{
const char * const pcException = "Exception cause: ";
const char *pcCauses[] = {
"0 Instruction address misaligned",
"1 Instruction access fault",
Expand All @@ -35,9 +35,7 @@ void vExceptionFaultHandler(struct metal_cpu *cpu, int ecode)
"6 Store/AMO address misaligned",
"7 Store/AMO access fault"};

write( STDOUT_FILENO, pcException, strlen( pcException ) );
write( STDOUT_FILENO, pcCauses[ecode], strlen( pcCauses[ecode] ) );
write( STDOUT_FILENO, "\r\n", 2 );
printf("Exception cause: %s\r\n", pcCauses[ecode]);
}
__attribute__((constructor)) static void FreeRTOS_init(void)
{
Expand Down
24 changes: 12 additions & 12 deletions arch/riscv32/fe310/src/sparkfun_redboard/nonsecure/main_ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ find the queue full. */
*
* @return pdFALSE if privilege was raised, pdTRUE otherwise.
*/
BaseType_t xPortRaisePrivilege( void ) FREERTOS_SYSTEM_CALL;
// BaseType_t xPortRaisePrivilege( void ) FREERTOS_SYSTEM_CALL;
extern pmp_info_t xPmpInfo;
#endif

Expand Down Expand Up @@ -1080,7 +1080,8 @@ static void prvSetupHardware( void )
// led0_blue = metal_led_get_rgb("LD0", "blue");
// if ((led0_red == NULL) || (led0_green == NULL) || (led0_blue == NULL))
// {
// write( STDOUT_FILENO, pcWarningMsg, strlen( pcWarningMsg ) );
// printf(pcWarningMsg);
// // write( STDOUT_FILENO, pcWarningMsg, strlen( pcWarningMsg ) );
// }
// else
// {
Expand All @@ -1090,9 +1091,12 @@ static void prvSetupHardware( void )
// metal_led_enable(led0_blue);

// // All Off
// metal_led_on(led0_red);
// metal_led_on(led0_green);
// metal_led_on(led0_blue);
// metal_led_off(led0_red);
// metal_led_off(led0_green);
// metal_led_off(led0_blue);
// // metal_led_on(led0_red);
// // metal_led_on(led0_green);
// // metal_led_on(led0_blue);
// }
}
/*-----------------------------------------------------------*/
Expand All @@ -1111,15 +1115,13 @@ void vApplicationMallocFailedHook( void )
to query the size of free heap space that remains (although it does not
provide information on how the remaining heap might be fragmented). */

const char * const pcErrorMsg = "ERROR malloc \r\n";

taskDISABLE_INTERRUPTS();

#if( portUSING_MPU_WRAPPERS == 1 )
/* need to be machine mode */
xPortRaisePrivilege();
// xPortRaisePrivilege();
#endif /* ( portUSING_MPU_WRAPPERS == 1 ) */
write( STDOUT_FILENO, pcErrorMsg, strlen(pcErrorMsg) );
printf("ERROR malloc\r\n");

if ( led0_red != NULL )
{
Expand Down Expand Up @@ -1155,9 +1157,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
function is called if a stack overflow is detected. */
taskDISABLE_INTERRUPTS();

write( STDOUT_FILENO, "ERROR Stack overflow on func: ", 30 );
write( STDOUT_FILENO, pcTaskName, strlen( pcTaskName ) );
write( STDOUT_FILENO, "\r\n", 3 );
printf("ERROR Stack overflow on func: %s\r\n",pcTaskName);

// if ( led0_red != NULL )
// {
Expand Down
Loading

0 comments on commit 71d1ebb

Please sign in to comment.