Sie sind auf Seite 1von 6

Alternative environments on Teensy

4
Table of Contents
Configuring MCUXpresso.........................................................................................................................1
Using MCUXpresso...................................................................................................................................1
A working example with Usb serial..................................................................................................1
Setting the Led Pin on Teensy 4.......................................................................................................4
Problems with MCUXpresso.....................................................................................................................6
Using Teensyduino.....................................................................................................................................7
Resources...................................................................................................................................................7

Configuring MCUXpresso
• Dowload IDE (account required): https://www.nxp.com/design/software/development-
software/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-
ide:MCUXpresso-IDE
• Open IDE
• Select Install SDK
• Select Processors tab
• Search for MIMXRT1062, Teensy4 is MIMXRT1062DVL6A

Using MCUXpresso
A working example with Usb serial
The only way to get a project with serial usb it is to export the hello_world_virtual_com example.
There is also a FreeRTOS version called “cdc_vcom_freertos”. These are the steps
1. select import example
2. Select the correct board/processor

3. choose hello_world_virtual_com
4. modify post build options to generate a hex file, right click current project → properties → C++
build → Settings → Build steps tab → post build → edit button. Add this line arm-none-eabi-
objcopy -v -O ihex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex"
5. Build the project
6. On Project folder there is a “Debug” folder, inside it you can find the hex file.
7. Use the teensy loader to load this file by selecting It (you can open the teensy loader with
arduino).
8. Click the reboot or programming button in Teensy
9. The example echoes back text through terminal

Setting the Led Pin on Teensy 4


Using the Teensy 4 schematics you can see that the LED (teensy pin 13) is acutally the “D8” which
uses GPIO2 port and its pin number is 3, all that info is important to set it up. Setting the pins up you
need to use a graphical tool. The steps are the folling:
1. Right-click your project → MCUXpresso Config tools → Open pins
2. Select “D8”
3. Activate it as GPIO2_IO3
4. Set direction as Output
5. Click Update Code

Now you can set the pin to HIGH: GPIO_PinWrite(GPIO2, 3U, 1);
or to LOW: GPIO_PinWrite(GPIO2, 3U, 0);

Problems with MCUXpresso


• It is mandatory the use of the reset button in teensy to be able to flash hex file. Meaning you
always need access to this button to update firmware.
• Using serial over Usb causes infinite waiting when no connected
• Development is hard on this environment
• There are very little online info on how to use MCUXpresso it
• Examples are not explained and often are link to old version of the libraries, that seem to have
change so much that you cannot copy paste their code to your project
Using Teensyduino
I quote from Arduino FAQ
Using the Arduino core and libraries for the firmware of a commercial product does not
require you to release the source code for the firmware.

Although legally speaking if a client explicitly ask for it, we might need to give them the binaries to be
able to change the Arduino parts, but never our source code. However this is very unlikely to happen,
since It would not make any sense for a customer to do this
The LGPL does, however, require you to make available object files that allow for the
relinking of the firmware against updated versions of the Arduino core and libraries.

Source: https://www.arduino.cc/en/main/FAQ#toc10
The teensy libraries use MIT license, so it is fine to use them, even you can modify them. Paul from
teensy mentions this many times on the forum, like in here
So in conclusion, it should be fine to go with teensyduino, this does not apply for 3rd arduino libraries,
but we do not use any.

Resources
Processor reference: https://www.pjrc.com/teensy/IMXRT1060RM_rev2.pdf
Teensy schematics: https://www.pjrc.com/teensy/schematic.html
MCUXpresso SDK api description: https://mcuxpresso.nxp.com/api_doc/dev/1414/index.html
Forum conversation: https://forum.pjrc.com/threads/53662-Teensy-4-RTOS and
https://forum.pjrc.com/threads/57568-Teensy-4-compatible-hex-files-using-MCUXpresso-IDE?
highlight=mcuxpresso
Example project using teensy 3.5 on MCUXpresso:
https://github.com/sceaj/teensy35_virtualcom/blob/master/source/virtualcom.c

Das könnte Ihnen auch gefallen