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 f8d64ca
Show file tree
Hide file tree
Showing 60 changed files with 23,238 additions and 21,524 deletions.
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 f8d64ca

Please sign in to comment.