Skip to content

Commit

Permalink
added stack overflow message and fixed memory problem with stats prin…
Browse files Browse the repository at this point in the history
…ting. Stats seem to be broken also
  • Loading branch information
Known4225 committed Nov 18, 2024
1 parent 02ce396 commit 06b5e2d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion sdk/freertos_app_cpu0/src/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configCHECK_FOR_STACK_OVERFLOW 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 0
#define configUSE_APPLICATION_TASK_TAG 0
Expand Down Expand Up @@ -160,6 +160,9 @@ extern void vInitialiseTimerForRunTimeStats(void);
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vInitialiseTimerForRunTimeStats()
#define portGET_RUN_TIME_COUNTER_VALUE() ((0xffffffffUL - XScuWdt_ReadReg(xTimerStats.Config.BaseAddr, XSCUWDT_COUNTER_OFFSET)) >> 1)

/* https://forums.freertos.org/t/run-time-statistics-overrun/12928 */
#define configRUN_TIME_COUNTER_TYPE uint64_t


/* The size of the global output buffer that is available for use when there
are multiple command interpreters running at once (for example, one on a UART
Expand Down
4 changes: 4 additions & 0 deletions sdk/freertos_app_cpu0/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ void vApplicationGetTimerTaskMemory(StaticTask_t **ppxTimerTaskTCBBuffer, StackT
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}

void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) {
xil_printf("STACK OVERRFLOW ON TASK %s\n", pcTaskName);
}

/*******************************************************************************/
/* S E T U P I N T E R R U P T S Y S T E M */
/*******************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion sdk/freertos_app_cpu0/src/usr/vsiApp/task_vsiApp.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void task_vsiApp(void *arg)
// Read in values sampled on the AMDS (plugged into your GPIO port) from all channels:
int err;
err = amds_get_data(amds_port, AMDS_CH_1, &out_ch_1);
amds_current_a = out_ch_1;
amds_current_a = 0.00125 * out_ch_1;
// Now, "out" variables contain the sign-extended 16-bit
// sample value for each channel
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/shared/sys/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ void commands_init(void)
printf("CMD:\tInitializing command tasks...\n");
// Command parse & exec task (UART)
if (uartTaskExists == 0) {
xTaskCreate(commands_uart, (const char *) "command_uart", 1024,
xTaskCreate(commands_uart, (const char *) "command_uart", 2048,
NULL, tskIDLE_PRIORITY, &tcb_uart);
uartTaskExists = 1;
}

// Command parse task (ETH)
if (ethTaskExists == 0) {
xTaskCreate(commands_eth, (const char *) "command_eth", 1024,
xTaskCreate(commands_eth, (const char *) "command_eth", 2048,
NULL, tskIDLE_PRIORITY, &tcb_eth);
ethTaskExists = 1;
}
Expand Down

0 comments on commit 06b5e2d

Please sign in to comment.