Using Teensyduino Libraries in MCUXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Teensyduino Libraries in MCUXpresso

2,401 Views
nolan_mcculloch
Contributor II

I am trying to bring in the Teensyduino libraries into MCUXpresso to work on a Teensy 3.5. I have modified the Teensy 3.5 hardware successfully and tested it with a PE Micro Multilink Universal debugger. Does anyone know of any good tutorials on how I can use the Teensy with the advantages of the MCUXpresso debugger?

NOTE: I pulled in the chip from the MCUXpresso SDK generator and have been creating projects with the K64FX512xxx12 chip set. 

Thanks in advance!

Labels (1)
4 Replies

1,716 Views
jon_ove_storhau
Contributor I

It would be very helpful if you could share how you got it working. I want to do much of the same. At the moment I am struggling with getting the PE Multilink Universal communicate with the teensy. How did you modify the teensy? Removed the bootloader chip or driven the reset pin (pin 15) low? Did you do any configurations to the debug setup in MCUxpresso to make it work?

I am getting this error: 

"Can not enter background mode. Unable to initialize PEDebug. PEmicro GDB Launch Failure : The GDB Server was not able to establish a connection to the target processor. Please check your connections and power. Verify that the launch settings in the Debug Configuration are accurate. Target Disconnected."

I have measured the reset, DIO and CLK, but see no activity.

Thanks in advance!

0 Kudos

1,716 Views
jon_ove_storhau
Contributor I

Got the programming working. The problem was probably a bad solder of one of the pins I soldered.

But it would still be helpful if you could share how you set up the project, etc. 

0 Kudos

1,716 Views
nolan_mcculloch
Contributor II

False alarm, I was able to get the GPIO working and tested the hardware serial and I2C lines somewhat successfully, but using the USB serial causes the code to enter an infinite loop in the fault_isr. In order to get the GPIO working we had to hack the reset vector provided by the chip SDK with some of the stuff Paul was using.

I am currently working on trying to figure out how to get the Teensy Hardware to properly configure as a USB device for the project I am working on. 

.. in short .. only the GPIO, and Hardware serial are working, I2C and SPI are on crutches and USB is dead. 

In order to get to this point here is what you need to do, 

1. Install the chip SDK from the MCUXpresso SDK dashboard https://mcuxpresso.nxp.com/en/select 

      - NOTE: Durring the creation of the SDK I de-selected all the middle ware options for the lightest build. Many of the       Arduino libraries already account for this. 

2. Create a project with the chip using the SDK in MCUXpresso. This project should build and can be uploaded to the 

      Teensy alone (good default state test). 

3. Include the Teensy Core Libraries (../Arduino/hardware/teensy/avr/cores/teensy3)

      - NOTE: Most of the start up (reset vector, etc) is contained in the file mk20dx128.c file. This can be compared to 

       startup_mk64f12.ccp file that the is generated by the SDK. We moved most of the reset_isr from the core library 

       over to this file in order to get it to build and run. The core library will make calls to these isr functions, but they 

       originally have different names, so make sure that all the interupt service routines called by the core library have        matching names in the vector tables or the clocks and other utilities will never get initialized for the core library. 

      - In order to get the project to build you need to include the flowing symbols. These are #defines added by the 

       Arduino when you code builds in their environment. You can find these in board.txt for your specific Teensy. 

      __MK64FX512__

      F_CPU=120000000

      LAYOUT_US_ENGLISH

      TEENSYDUINO=144

      USB_SERIAL

That's as far as I got. I'll keep you posted on any further progress. I may just end up using the CMSIS structure and Kenetis's libraries and examples. I've been working on getting this integration for a couple weeks and I am running out of time to devote to this project. Hope this helps. 

0 Kudos

1,716 Views
nolan_mcculloch
Contributor II

I was able to figure this out. I'll post a full description of the resolution and link it to this thread.