MemoryAllocationStatistics not compiling

Post here first, or if you can't find a relevant section!
Post Reply
Dimdim
Posts: 2
Joined: Wed Apr 01, 2020 12:54 pm

MemoryAllocationStatistics not compiling

Post by Dimdim »

Hi guys, I'm glad to see the forum being back up. :)

I'm trying to compile this sketch : https://github.com/stm32duino/STM32Exam ... istics.ino

And getting this error:

Code: Select all

free_memory_3:30:38: error: '_get_MSP' was not declared in this scope

   char * stack_ptr = (char*)_get_MSP();

                                      ^

exit status 1
'_get_MSP' was not declared in this scope
I'm using Roger's core.

Any ideas?
stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: MemoryAllocationStatistics not compiling

Post by stas2z »

that example is for HAL based core, probably roger's core gcc doesn't support it
but it's not a problem

Code: Select all

__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
{
  register uint32_t result;

  __ASM volatile ("MRS %0, msp\n" : "=r" (result) );
  return(result);
}
Dimdim
Posts: 2
Joined: Wed Apr 01, 2020 12:54 pm

Re: MemoryAllocationStatistics not compiling

Post by Dimdim »

Thank you very much stas2z.

But where should I put this code?
Post Reply

Return to “General discussion”