pocketsphinx icon indicating copy to clipboard operation
pocketsphinx copied to clipboard

Is it possible to run on edge device like STM32

Open kronee0516 opened this issue 10 months ago • 4 comments

Hi,

I saw an article in China said stm32 can run on STM32 but it didn't explain in details

is this possible? which files should i move to compile?

i tried on another edge device but some of the code have defined for some kind of platform which do not include edge device like platform and cause the error

like in this

void
ptmr_start(ptmr_t * tm)
{
#if (! defined(_WIN32)) || defined(GNUWINCE) || defined(__SYMBIAN32__)
    struct timeval e_start;     /* Elapsed time */

#if (! defined(_HPUX_SOURCE))  && (! defined(__SYMBIAN32__))
    struct rusage start;        /* CPU time */

the errors

./src/asr/src/util/profile.c: In function 'ptmr_start':
./src/asr/src/util/profile.c:186:19: error: storage size of 'start' isn't known
  186 |     struct rusage start;        /* CPU time */
      |                   ^~~~~
./src/asr/src/util/profile.c:189:5: warning: implicit declaration of function 'getrusage' [-Wimplicit-function-declaration]
  189 |     getrusage(RUSAGE_SELF, &start);
      |     ^~~~~~~~~
./src/asr/src/util/profile.c:189:15: error: 'RUSAGE_SELF' undeclared (first use in this function)
  189 |     getrusage(RUSAGE_SELF, &start);
      |               ^~~~~~~~~~~
./src/asr/src/util/profile.c:189:15: note: each undeclared identifier is reported only once for each function it appears in
./src/asr/src/util/profile.c:193:5: warning: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
  193 |     gettimeofday(&e_start, 0);
      |     ^~~~~~~~~~~~

kronee0516 avatar Feb 24 '25 06:02 kronee0516

What OS and what compiler? The issue is not the STM32 platform itself, probably, but the development environment.

dhdaines avatar Feb 24 '25 19:02 dhdaines

What OS and what compiler? The issue is not the STM32 platform itself, probably, but the development environment.

thanks for the reply the os should be rtos? and the compiler i believe is arm gcc?

the other mcu i want to run on probably rtos too . and the compiler is risc-v gcc

kronee0516 avatar Feb 25 '25 01:02 kronee0516

Hmm... the problem then is that RTOS isn't supported. I'm not totally sure how to support it as I don't know much about it and what subset of POSIX it implements.

dhdaines avatar Feb 25 '25 22:02 dhdaines

OK ,thanks for the help

kronee0516 avatar Feb 26 '25 02:02 kronee0516