Teensy 3.6 and MK66FX1M0VMD18 support?

ChibiOS public support forum for topics related to the Freescale Kinetis family of micro-controllers.

Moderator: utzig

walkerstop
Posts: 9
Joined: Fri Apr 27, 2018 2:35 am
Been thanked: 1 time

Teensy 3.6 and MK66FX1M0VMD18 support?

Postby walkerstop » Fri Apr 27, 2018 2:51 am

Hello everyone, I am trying to get this MCU / board working under ChibiOS.

Some basic things are working now like pin control, but USB communication between the Teensy and my PC is broken.

Here is what the messages look like on the Ubuntu PC I am connecting via USB to this board:

Code: Select all

[795986.548379] usb 4-3: new full-speed USB device number 23 using ohci-pci
[795986.700300] usb 4-3: device descriptor read/64, error -62
[795986.992387] usb 4-3: device descriptor read/64, error -62
[795987.276293] usb 4-3: new full-speed USB device number 24 using ohci-pci
[795987.436337] usb 4-3: device descriptor read/64, error -62
[795987.724336] usb 4-3: device descriptor read/64, error -62
[795988.012357] usb 4-3: new full-speed USB device number 25 using ohci-pci
[795988.428354] usb 4-3: device not accepting address 25, error -62
[795988.576271] usb 4-3: new full-speed USB device number 26 using ohci-pci
[795988.996313] usb 4-3: device not accepting address 26, error -62
[795988.996374] usb usb4-port3: unable to enumerate USB device


Looking at the USB driver running on the MCU, I can see that it is sending data, and it seems to receive as well, the interrupt handler is getting called, but USB0->ERRSTAT is always set. Seems but 0 of USB0->ERRSTAT gets set, which according to the datasheet, means USB PID verification failed. Based on my very limited understanding of USB communication, I think this is something like a checksum, so it might mean that the data coming into the MCU is somehow corrupted.

Does anyone have any pointers for how I could debug this further, or what kind of mistake I might have made in the HALs to lead to this problem?

I can share the code I have so far if that helps! In fact here is what I have so far:
https://github.com/walkerstop/ChibiOS-Contrib

Any help you can provide is greatly appreciated. Also, if anybody is ALREADY porting ChibiOS to this MCU or board, please let me know, I would hate to duplicate the same effort :)

D\0\0gan
Posts: 1
Joined: Fri Apr 27, 2018 2:51 pm
Has thanked: 3 times

Re: Teensy 3.6 and MK66FX1M0VMD18 support?

Postby D\0\0gan » Fri Apr 27, 2018 3:07 pm

Hi walkerstop,

I just wanted to reach out to say that I JUST started working with ChibiOS on the Teensy 3.6.

I am using this library with the arduino environment (THANKS Greiman!!!):
https://github.com/greiman/ChRt

Like I said, I just started, and I am working my way through Giovanni's documentation:
http://www.chibios.org/dokuwiki/doku.ph ... book:start

I haven't experienced any USB issues yet. I am actually watching my teensy print to the serial monitor right now. I have 5 threads one for each easily accessible UART on the T36, and I have them all talking to each other. So far I2c is working no problem, SPI is working no problem, and I did some very basic SD card writes and reads. I ran into a problem when using the SD card, but it's just because I have never used an RTOS before and I decided I would read up on Chibi before I moved forward. I've really enjoyed Giovanni's documentation, I feel like I've learned a lot (I have no formal computer science education... Just google).

This probably isn't very helpful information, but I wanted to let you know that it's working great for me using Greiman's code.

dreydean
Posts: 2
Joined: Thu Jan 17, 2019 8:23 am

Re: Teensy 3.6 and MK66FX1M0VMD18 support?

Postby dreydean » Thu Jan 17, 2019 8:31 am

Hello,

I too have been programming with this wonderful library on my teensy projects. I specifically have been trying to get a CAN Bus up and running but have been running into some problems. I can send CAN messages out using the FlexCan library but I don't believe I am implementing a proper receive thread because I can not receive any messages. Anyone know anything I can do to troubleshoot this?

dreydean
Posts: 2
Joined: Thu Jan 17, 2019 8:23 am

Re: Teensy 3.6 and MK66FX1M0VMD18 support?

Postby dreydean » Thu Jan 17, 2019 8:40 am

Also,
To answer the first question in the post, I think the problem was you didn't have HAL_USE_SERIAL_USB enabled. I'm not positive but I would try there if you aren't already using the ChRt software.


ChibiOS-Contrib/testhal/KINETIS/TEENSY3_x/SERIAL/halconf.h lines 139-143

/**
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB FALSE
#endif

ballanux
Posts: 1
Joined: Tue Jul 02, 2019 10:27 am

Re: Teensy 3.6 and MK66FX1M0VMD18 support?

Postby ballanux » Tue Jul 02, 2019 10:54 am

Hi!
I started a project with Teensy 3.6 where I want to do a USB to uart bridge among other things, I used a teensy 3.2 example as reference and I saw that the output of the UART was slower than should be.

I'm assuming I have something wrong in the clock configuration in mcuconf.h, can anyone confirm if this is correct or should I change/add something:

Code: Select all

#ifndef _MCUCONF_H_
#define _MCUCONF_H_

#define MK66FX1M0_MCUCONF

/*
 * HAL driver system settings.
 */
/* PEE mode - 48MHz system clock driven by external crystal. */
#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_PEE
#define KINETIS_PLLCLK_FREQUENCY    96000000UL
#define KINETIS_SYSCLK_FREQUENCY    48000000UL

/*
 * SERIAL driver system settings.
 */
#define KINETIS_SERIAL_USE_UART0              TRUE

/*
 * USB driver settings
 */
#define KINETIS_USB_USE_USB0                  TRUE

#endif /* _MCUCONF_H_ */


I got it "half-working" by configuring the serial port as 11392 bauds so it actually outputs 9600 bauds. I have some other issues, but I think is best to first solve this before...

By the way, I'm using version 5.1 as the contrib libraries seem not to work with the last one

stapelberg
Posts: 10
Joined: Wed Jun 03, 2020 9:17 pm
Has thanked: 4 times
Been thanked: 3 times

Re: Teensy 3.6 and MK66FX1M0VMD18 support?

Postby stapelberg » Wed Jun 03, 2020 9:21 pm

ballanux wrote:Hi!
I started a project with Teensy 3.6 where I want to do a USB to uart bridge among other things, I used a teensy 3.2 example as reference and I saw that the output of the UART was slower than should be.

I'm assuming I have something wrong in the clock configuration in mcuconf.h, can anyone confirm if this is correct or should I change/add something:


I realize this is an old post, but if anyone else ends up here looking for a solution, check out https://github.com/ChibiOS/ChibiOS-Contrib/pull/222 where I add a demo for the Teensy 3.6 that works with the full 180 MHz.


Return to “Kinetis Support”

Who is online

Users browsing this forum: No registered users and 0 guests