Skip to content

Commit

Permalink
Fixed the stack overflow and removed the workaround for it
Browse files Browse the repository at this point in the history
  • Loading branch information
mryndzionek committed Aug 17, 2024
1 parent 8e0c74e commit 90f9e51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ target_link_libraries(rpi_inmp441_kws
CMSISDSP
)

#target_compile_definitions(rpi_inmp441_kws PRIVATE PICO_STACK_SIZE=0x1000)
target_compile_definitions(rpi_inmp441_kws PRIVATE PICO_CORE1_STACK_SIZE=0x1000)
pico_add_extra_outputs(rpi_inmp441_kws)

6 changes: 3 additions & 3 deletions src/fast_grnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ void sha_rnn_get_max_logit(const sha_rnn_output_t input, float *max_logit, size_

void sha_rnn_process(const sha_rnn_input_t input, float *max_logit, size_t *max_idx)
{
float output[64] = {0.0f};
float output2[32] = {0.0f};
float output3[6] = {0.0f};
static float output[64] = {0.0f};
static float output2[32] = {0.0f};
static float output3[6] = {0.0f};

sha_rnn_rnn0_process(input, output);
sha_rnn_rnn1_process(output, output2);
Expand Down
6 changes: 4 additions & 2 deletions src/fbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ static void preemphasis(float *input, size_t len)

static void powspec(const float input[FRAME_LEN], float output[NUM_FFT_BINS])
{
float32_t tmp[NUM_FFT] = {0.0f};
float32_t out[NUM_FFT];
static float32_t tmp[NUM_FFT];
static float32_t out[NUM_FFT];

memset(tmp, 0, sizeof(tmp));

for (size_t i = 0; i < FRAME_LEN; i++)
{
Expand Down
4 changes: 1 addition & 3 deletions src/rpi_inmp441_kws.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ static void(core1_entry)(void)
}
}

static uint32_t core1_stack[8 * 1024UL];

static float fbins_out[SHARNN_BRICK_SIZE][NUM_FILT];

int main()
Expand All @@ -147,7 +145,7 @@ int main()
}
printf("\n");

multicore_launch_core1_with_stack(core1_entry, core1_stack, sizeof(core1_stack));
multicore_launch_core1(core1_entry);

fbank_init();

Expand Down

0 comments on commit 90f9e51

Please sign in to comment.