Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: MSP432P401R: Program goes into a hard fault when array is variable size

$
0
0
[quote user="Reid Kersey"] My main thought is that this is a memory error, but increasing the and stack sizes doesn't do/help anything. [/quote]Is your code bare-metal, or does it use some sort of RTOS? Looking at the assembler generated by the TI ARM compiler v16.9.0.LTS shows that when variable size arrays are used the compiler makes calls to the __vla_alloc() and __vla_dealloc() to allocate and deallocate space for the variable size arrays. The implementation for __vla_alloc() and __vla_dealloc() is in the lib\src\vla_alloc.cpp source file in the compiler installation. When I took a SYS/BIOS example with two threads, when a variable size array was used in two threads then the __vla_dealloc() function ended up aborting the program after detecting an assertion failure. I.e. the __vla_alloc() and __vla_dealloc() implementation doesn't appear to be thread safe.

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>