Hi Jan,

In the Codec2 library, there are some flags that are turned on in order to
get it to function on the SM1000 (which also uses a STM32F4 series MCU).
You can find out more at
https://github.com/drowe67/codec2/blob/main/stm32/CMakeLists.txt but the
important ones are as follows:

add_definitions(-DSTM32F40_41xxx -DCORTEX_M4 -D__EMBEDDED__)

Note that you'll also need to implement a few functions to (a) ensure that
CMSIS gets used and (b) indicate how memory is to be allocated once
__EMBEDDED__ gets set. You can just include
https://github.com/drowe67/codec2/blob/main/src/codec2_math_arm.c and the
codec2_*alloc/codec2_free functions from
https://github.com/drowe67/codec2/blob/4f4f7304542c4c3ef49d443ae78732b0e6683a0f/stm32/src/memtools.c#L14
for that. Hope this helps!

Thanks,

-Mooneer K6AQ

On Mon, Nov 20, 2023 at 5:24 AM Jan Ropek <ropek...@gmail.com> wrote:

> Hello,
>
> my goal was to get Codec2 (encoding and decoding) working on STM32F446
> running on 180MHz. So, I created a new project for Nucleo with F446RE and
> added Codec2 libraries to it. I compile with GCC (using STM32CubeIDE -
> based on Eclipse).
>
> I have GCC optimization turned off and encoding and decoding works, but
> the problem is that encoding one 40ms frame (320 B) takes about 47 ms, so I
> am not able to use Codec2 in real-time. So, I am asking whether my
> requirements are unrealistic, or have I implemented Codec2 incorrectly?
>
> - I tried comparing CMSIS FFT and KISS FFT, it takes roughly the same time.
>
> - When I turned on GCC optimization to O1 - encoding sped up to about 15
> ms, but during decoding, a HardFault always occurred.
>
> Can you please suggest what I might be doing wrong? Many thanks!
>
> Best regards, Jan.
> _______________________________________________
> Freetel-codec2 mailing list
> Freetel-codec2@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>
_______________________________________________
Freetel-codec2 mailing list
Freetel-codec2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to