Teensy 3.2 and mbed-rtos

Status
Not open for further replies.

ryano88

New member
I am trying to get mbed-rtos working on my Teensy 3.2.

I am using the following code:

Code:
#include "mbed.h"
#include "rtos.h"
 
DigitalOut led(D13);
 
void blink(void const *args)
{
    led = !led;
}
 
int main(void)
{
    RtosTimer led_timer(blink, osTimerPeriodic, (void *)0);
    led_timer.start(1000);
    Thread::wait(osWaitForever);
}

When compiling using the online mbed compiler I get the following errors:

Warning: Incompatible redefinition of macro "MBED_CMSIS_RTOS_CM" in "mbed-rtos/rtx/TARGET_CORTEX_M/cmsis_os.h", Line: 60, Col: 10

Warning: Incompatible redefinition of macro "CMSIS_RTOS" in "mbed-rtos/rtx/TARGET_CORTEX_M/cmsis_os.h", Line: 62, Col: 10

Warning: Intrinsic is deprecated in "mbed-rtos/rtx/TARGET_CORTEX_M/rt_HAL_CM.h", Line: 209, Col: 17

Warning: Intrinsic is deprecated in "mbed-rtos/rtx/TARGET_CORTEX_M/rt_HAL_CM.h", Line: 212, Col: 13

Warning: Intrinsic is deprecated in "mbed-rtos/rtx/TARGET_CORTEX_M/rt_HAL_CM.h", Line: 214, Col: 18

Warning: Intrinsic is deprecated in "mbed-rtos/rtx/TARGET_CORTEX_M/rt_HAL_CM.h", Line: 216, Col: 13

Warning: Incompatible redefinition of macro "MBED_CMSIS_RTOS_CM" in "mbed-rtos/rtx/TARGET_CORTEX_M/cmsis_os.h", Line: 60, Col: 10

Warning: Incompatible redefinition of macro "CMSIS_RTOS" in "mbed-rtos/rtx/TARGET_CORTEX_M/cmsis_os.h", Line: 62, Col: 10

Error: A1854E: Unknown opcode 'VSTMDBEQ', maybe wrong target CPU? in "mbed-rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_ARM/HAL_CM4.c", Line: 167, Col: 1

Error: A1854E: Unknown opcode 'VLDMIANE', maybe wrong target CPU? in "mbed-rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_ARM/HAL_CM4.c", Line: 187, Col: 1

Error: A1854E: Unknown opcode 'VSTMDBEQ', maybe wrong target CPU? in "mbed-rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_ARM/HAL_CM4.c", Line: 250, Col: 1

Error: A1854E: Unknown opcode 'VLDMIANE', maybe wrong target CPU? in "mbed-rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_ARM/HAL_CM4.c", Line: 269, Col: 1

Has anyone had any luck with this?
 
Last edited:
Why not use the existing FreeRTOS adaptation to the Teensy?

There is a CMSIS RTOS port that is just API wrappers for FreeRTOS.

The CMSIS RTOS wrappers add no value other that vague RTOS independence which, in the end, won't be independent and/or isn't essential, since FreeRTOS is stable and ubiquitous
 
Make sure the Teensy is selected as your CPU in mbed. I have successfully compiled and ran the mbed rtos but don't have any info right now on it. I'll see if I can dig up the info for you later.
 
Why not use the existing FreeRTOS adaptation to the Teensy?

There is a CMSIS RTOS port that is just API wrappers for FreeRTOS.

The CMSIS RTOS wrappers add no value other that vague RTOS independence which, in the end, won't be independent and/or isn't essential, since FreeRTOS is stable and ubiquitous

I am just playing around with mbed to get a feel for it, I don't actually need an rtos right now. I just wanted to be able to compile this snippet and see it work.

Make sure the Teensy is selected as your CPU in mbed. I have successfully compiled and ran the mbed rtos but don't have any info right now on it. I'll see if I can dig up the info for you later.

Yeah I do have the Teensy selected as I have another program in my compiler which works as expected. For this program I've imported both the mbed and mbed-rtos libraries.
 
I'm following up on this old thread, mbed has come out with what they call mbed-os which bundles up their RTOS and others features into one library. It doesn't work with the Teensy 3.2 out of the box so I forked it here and made the fixes so the RTOS part of the OS will compile and work. With the mbed online IDE you can import my forked copy into your program and use it, see below. They do have the fix I did queued up for future release but until then you play with it now at least. I tested it with their blinky example and other RTOS examples also.
mbed_import_url.png


mbed_source_url.png
 
Status
Not open for further replies.
Back
Top