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

Thread: Teensy 4.1 debugging

  1. #1
    Junior Member
    Join Date
    May 2022
    Posts
    9

    Teensy 4.1 debugging

    I have a teensy 4.1 board here on my desk. It is my first teensy project and my first contact to the arduino frame work. I started with PlatformIO and get a blinky program successful running. Now I want to test the debugger, but it seems ther is no possibility to debug on a teensy 4.1. First I thought I can do this with a segger J-link, but cannot find any connector.
    Can anybody confirm?? Is there no way for debugging a teeny 4.1 board out of the box even with a j-link -- really ? I cannoz beleive that.

  2. #2
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    754
    No there is no hardware debugging available.
    However there are debugging facilities, especially using VisualMicro with VisualStudio, see here.
    I use it all the time and would not be without it. It also does not suffer the same problems as PlatformIO.
    Give it a try, it's free for a month, then a low one off payment for an annual or forever license.

  3. #3
    Junior Member
    Join Date
    May 2022
    Posts
    9
    I' very disappointed. From my point of view I freely avaibale SWD or JTAG connecter is a must have. The board has a very powerfull MCU but without a debug connector not usable for me.

  4. #4
    Quote Originally Posted by jokn View Post
    I' very disappointed. From my point of view I freely avaibale SWD or JTAG connecter is a must have. The board has a very powerfull MCU but without a debug connector not usable for me.
    Teensy is a great product, with exceptionally good software and the best support forum/community. If you decide to try to do something with your T4.1, you'll find good resources here.

  5. #5
    Junior Member
    Join Date
    May 2022
    Posts
    9
    I'm profosisional developer and did look for a small board with ethernet and high speed usb. So I was happy to find teensy. Maybe teensy is a gread produkt but I would like to undestand how it works in in junktion with the arduino framework. Please take in account so far I had never worked with the arduino framework. Mostly i used STM based eval boards for new projects which has an st-link debugger on board. At first I though it's almost the same with teensy, but there seems to be a complete another pilosophy to develop embedded applikations. There is an mysterious chip om the bord which occupies the jtag interface but do not have a connection to the usb device. What is this chip doing? Is there any preinstaled bootloader on the chip? Is it possible to develop applikations with otther framesworks than arduino?
    Meanwhile I have found a lot of hardware hacking examples to get the Jtag interface usable.It seems there a lot of other peaple which are not happy to work without a professional debug interface.

  6. #6
    Quote Originally Posted by jokn View Post
    I'm profosisional developer and did look for a small board with ethernet and high speed usb. So I was happy to find teensy. Maybe teensy is a gread produkt but I would like to undestand how it works in in junktion with the arduino framework. Please take in account so far I had never worked with the arduino framework. Mostly i used STM based eval boards for new projects which has an st-link debugger on board. At first I though it's almost the same with teensy, but there seems to be a complete another pilosophy to develop embedded applikations. There is an mysterious chip om the bord which occupies the jtag interface but do not have a connection to the usb device. What is this chip doing? Is there any preinstaled bootloader on the chip? Is it possible to develop applikations with otther framesworks than arduino?
    Meanwhile I have found a lot of hardware hacking examples to get the Jtag interface usable.It seems there a lot of other peaple which are not happy to work without a professional debug interface.
    Maybe others will give their opinion, but I'll try to answer. Arduino makes it easy for the beginner to get started. You can buy a board and immediately write programs, with little or no knowledge of what is going on behind the scenes. Instead of a debugger connection, there is a USB serial connection used for both firmware update and serial I/O with the device. Arduino is open source, with many freely available libraries. Arduino was originally 8-bit AVR devices, though some are now 32-bit ARM devices. Teensy is Arduino-compatible, meaning you can develop with the Arduino IDE, and it uses the Arduino APIs for basic analog and digital I/O, etc., but made 32-bit ARM devices available when Arduino was entirely (?) 8-bit AVR, so it has always provided more processing power than the official Arduino devices and other Arduino-compatible boards. If you google things like "Arduino versus bare metal" you will find many articles and blog posts about the trade-offs. The chip on Teensy that is attached to the JTAG pins is a bootloader. This makes it easy to load code, but it does make the debugger unavailable for general use. A few people have modified boards to use a hardware debugger. You can find the posts on this forum. The way that I update firmware in my own projects is through the method shown in this thread (https://forum.pjrc.com/threads/43165...l=1#post297272). The code to update firmware is included in the application. New code is received by the application, buffered in flash (or RAM), then overwrites the old firmware.

  7. #7
    Junior Member
    Join Date
    May 2022
    Posts
    9
    Thank you very much for the detailed explanations. I understand you very well and I would agree, but I'm just curious about the specific solution for this bootloader. As far as I know the i.MX controller has different capabilities to boot from extern device, such has UART and even USB. What is the mystery of using the valuable JTAG port to boot, are there some compatibility reason or is it possibly something like a software protection?

  8. #8
    Quote Originally Posted by jokn View Post
    Thank you very much for the detailed explanations. I understand you very well and I would agree, but I'm just curious about the specific solution for this bootloader. As far as I know the i.MX controller has different capabilities to boot from extern device, such has UART and even USB. What is the mystery of using the valuable JTAG port to boot, are there some compatibility reason or is it possibly something like a software protection?
    Both, perhaps, but thatís a question for Paul.

  9. #9
    Junior Member
    Join Date
    May 2022
    Posts
    9
    Meanwhile I have a RT1060 evaluation board here on my desk which has a SWD debug port on board. So I can develop on the eval board and finaly download a hexfile to the teensy board. My first attempts were quite successful and can be found here.

Posting Permissions

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