Hi:
I’m trying to do a simple test combining USB Serial and RTOS
and I get this error during compiling:
… /arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld: region RAM overflowed with stack
collect2: error: ld returned 1 exit status
*** [.pioenvs/lpc1549/firmware.elf] Error 1
OS: Mac OS High Sierre (10.13.6)
platformio.ini
[env:lpc1549]
platform = nxplpc
board = lpc1549
framework = mbed
upload_protocol = jlink
build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT
If I comment the last line of platformio.ini (and remove all te usage of RTOS) the compiling is ok
Here is a copy of the code
#include <mbed.h>
#include <USBSerial.h>
USBSerial deb;
// Thread thread1,thread2;
DigitalOut led1(LED1);
DigitalOut led2(LED2);
void led1thread() {
while (true) {
// Signal flags that are reported as event are automatically cleared.
led1 = !led1;
wait(2);
}
}
void led2thread() {
while (true) {
// Signal flags that are reported as event are automatically cleared.
led2 = !led2;
wait(1);
}
}
int main (void) {
// thread1.start(callback(led1thread));
// thread2.start(callback(led2thread));
while (true) {
wait(5);
deb.printf("Hello W\n");
led1=!led1;
led2=!led1;
}
}