cancel
Showing results for 
Search instead for 
Did you mean: 

Voice compressing in STM32L4

RFlod.2
Associate II
I need to compress voice in STM32L4. Here are my requirements:
* STM32L4 run at maximum 80 MHz
* Voice to be sampled by ADC/DMA
* Flash usage for voice compression < 50 kBytes
* RAM usage for voice compression < 64 kBytes
* Compressed data < 10% of orignal data
* Compress library shall not be GPL (cannot disclose all source code in my project)
* Compressed voice need to be decompressed at Linux OS
 
 
So I have searched some libraries and here are my findings:
* ST Opus Cube
- Flash size to big, 163 kBytes
* Speex_STM32_master
- GPL license
* STM32F10x_AN2812_FW_V2.0.0 (speex library)
- Contains assembler files for STM32F1
*  ST X-CUBE-AUDIO
- Only for STM32F4 and STM32F7
 
So non of these solutions fits my requirements. Any other ideas?
9 REPLIES 9
Danish1
Lead III

Stm32F1 and stm32L4 both have arm cortex M processors.

What problems do you get offering the STM32F1 assembly files to an assembler for L4?

STM32F1 uses M3 core

STM32L4 uses M4 core

I do not want to put a lot effort into getting it to work if there is an obvious issue.

Opus is BSD licensed. If that works for you you can use a non-ST port/implementation of OPUS.

https://opus-codec.org/license/
https://github.com/xiph/opus

 

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Problem with Opus is the flash size, not the license.

Have you tried porting the speex library? What assembler files need to be ported? I can't find the example.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

No, I wrote I donot put effort in something that already have issues.

 

The STM32F1 code is not at ST website, but found it here

https://community.element14.com/products/devtools/technicallibrary/w/documents/24440/stm32f10xxx-speex-library-firmware-stm32---stdperiph-lib---speex---audio

 

Cortex-M4 is a superset of Cortex-M3.

JW


@RFlod.2 wrote:

No, I wrote I donot put effort in something that already have issues.


What issues? Do you get compile errors or doesn't the program operate properly?

Like @waclawek.jan wrote the M4 is a superset of the M3. So inline assembly should work.

If not use C code instead of assembly code. If that doesn't perform enough you can try to see if you can use CMSIS DSP library: https://github.com/ARM-software/CMSIS-DSP

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

It wil take time to implement and verify this implementation.. It would be preferable to use an existing working solution.

Debugging assembler is something I would like to avoid. Even though the core might be compatible there can be callls to other oarthe in the STM32 which are not compatible.