Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Teensy 3.2 and mbed-rtos

  1. #1
    Junior Member
    Join Date
    Jun 2016
    Posts
    2

    Teensy 3.2 and mbed-rtos

    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 by ryano88; 06-10-2016 at 06:36 PM.

  2. #2
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    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

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Quote Originally Posted by stevech View Post
    Why not use the existing FreeRTOS adaptation to the Teensy?
    Could a post a link ? Is it compatible to teensyduino ?

  4. #4
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Quote Originally Posted by Frank B View Post
    Could a post a link ? Is it compatible to teensyduino ?
    See post #38 on this thread
    https://forum.pjrc.com/threads/540-C...light=freertos

    I recall running this FreeRTOS port on T3. There are two different ports of FreeRTOS for T3, as I recall.

    Beware the config options: preemption and cooperative scheduler modes. The latter is safer/easier
    Last edited by stevech; 06-10-2016 at 11:45 PM.

  5. #5
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    969
    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.

  6. #6
    Junior Member
    Join Date
    Jun 2016
    Posts
    2
    Quote Originally Posted by stevech View Post
    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.

    Quote Originally Posted by duff View Post
    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.

  7. #7
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    969
    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.
    Click image for larger version. 

Name:	mbed_import_url.png 
Views:	479 
Size:	131.6 KB 
ID:	7817

    Click image for larger version. 

Name:	mbed_source_url.png 
Views:	457 
Size:	41.7 KB 
ID:	7818

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •