Run mbed-os on Teensy 4.0?

Status
Not open for further replies.
I was wondering whether there's any relatively easy way to run mbed-os on the new Teensy 4.0. As far as I can tell the MCU itself should be supported after all.

I've been playing around with custom targets without any luck so far. If someone has already done this I'd be very happy to get some guidance.

Thanks :)
 
Replying to myself.. so, I'm able to compile and flash a HEX file. I've no idea whether what I'm uploading to the teensy is actually executable, though. Next step would be to upload a simple blinky example. For that I probably have to figure out the correct PinNames.h for this board.

So far I've got a custom target targeting the Cortex-M7FD core (I'm assuming the FD stands for floating point double precision?)

Anyway, this is my custom_targets.json. I suppose a lot of the stuff defined in here is still wrong, but one step at a time... :)

Code:
{
    "TEENSY4_0": {
        "inherits": ["Target"],
        "core": "Cortex-M7FD",
        "supported_toolchains": ["ARM", "GCC_ARM"],
        "extra_labels": ["NXP", "MCUXpresso_MCUS", "EVK", "MIMXRT1050", "IMX", "NXP_EMAC"],
        "is_disk_virtual": true,
        "macros": [
            "CPU_MIMXRT1052DVL6B",
            "FSL_RTOS_MBED",
            "XIP_BOOT_HEADER_ENABLE=1",
            "XIP_EXTERNAL_FLASH=1",
            "XIP_BOOT_HEADER_DCD_ENABLE=1",
            "SKIP_SYSCLK_INIT",
            "FSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE",
            "MBED_MPU_CUSTOM",
            "MBED_TICKLESS"
        ],
        "post_binary_hook": {
            "function": "TEENSY3_1Code.binary_hook",
            "toolchains": ["ARM_STD", "ARM_MICRO", "GCC_ARM"]
        },
        "detect_code": ["0270"],
        "device_has": [
            "RTC",
            "SLEEP",
            "USTICKER",
            "LPTICKER",
            "ANALOGIN",
            "EMAC",
            "I2C",
            "I2CSLAVE",
            "ERROR_RED",
            "INTERRUPTIN",
            "PORTIN",
            "PORTINOUT",
            "PORTOUT",
            "PWMOUT",
            "SERIAL",
            "SPI",
            "SPISLAVE",
            "STDIO_MESSAGES",
            "TRNG"
        ],
        "OUTPUT_EXT": "hex",
        "release_versions": ["2", "5"],
        "device_name": "MIMXRT1062xxxxA"
    }
}

If I make any further progress I'll be documenting it in here. And if anyone wants to point out some obvious errors, please go ahead, as I don't really know what I'm doing.
 
I don't know if building for 1050 will work with T4 which is a 1060. I did pre-beta evaluation using mbed and NXP 1050 eval board. mbed compiler didn't support NXP 1060 eval board, so I had to use NXP's MCUXpresso IDE for testing 1060.
 
Oh, you're right! It's supposed to target the 1060, I didn't catch that. I'll be looking into this, thanks for pointing this out!
 
Keen to hear how you got on with this? I’m keen to have access to a better HAL than Arduino for my project.
 
Keen to hear how you got on with this? I’m keen to have access to a better HAL than Arduino for my project.
I am following up on this thread to see if any progress has been made on getting mbed to work on a Teensy 4.x.
The 4.0 and 4.1 really beg for an RTOS (with good HAL support, especially I2C and SPI).
 
Something that you may be interested in trying, if you're using Teensyduino is HeliOS - https://github.com/MannyPeterson/HeliOS - it gives you some RTOS features without getting in the way. I have successfully used FreeRTOS, but I find the APIs less than ergonomic. Alas, this is as far as I've gotten.
 
Something that you may be interested in trying, if you're using Teensyduino is HeliOS - https://github.com/MannyPeterson/HeliOS - it gives you some RTOS features without getting in the way. I have successfully used FreeRTOS, but I find the APIs less than ergonomic. Alas, this is as far as I've gotten.


Thanks, that looks interesting.
I've played with FreeRTOS on the Teensy. It's a bit painful as all the Arduino library calls have to have synchronization calls around them. That's the thing that cool about mbed, i2C, SPI, Ethernet, etc, are all reentrant and efficient (don't block use of CPU during transmissions).
Helios is still blocking (Arduino library calls), though you don't have to worry about synchronization so much.
 
I am following up on this thread to see if any progress has been made on getting mbed to work on a Teensy 4.x.
The 4.0 and 4.1 really beg for an RTOS (with good HAL support, especially I2C and SPI).

Totally agree with this rhyde - if it was available - I'd be using it already. Hmmm....

Regards,
John W.
 
Status
Not open for further replies.
Back
Top