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

Thread: teensy_loader_cli and Teensy 4.0?

  1. #1
    Senior Member
    Join Date
    Feb 2015
    Location
    Finland
    Posts
    119

    teensy_loader_cli and Teensy 4.0?

    Will teensy_loader_cli get support for Teensy 4.0?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,309
    Yes, eventually.

    If you want to try now (editing the code yourself), the protocol is the same as Teensy 3.6. Block size is 1K. It has 1984 blocks instead of 1024.

    Might also need to allow longer delay on the 1st block, as erasing a previously fully written flash is slower than prior boards.

  3. #3
    Senior Member
    Join Date
    Feb 2015
    Location
    Finland
    Posts
    119
    Thanks. I don't have a 4.0 yet, but will do that when I get one.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,053
    I think I have the changes in, which I still need to test, up at: https://github.com/KurtE/teensy_loader_cli/tree/T4

    I may next try plugging in RPI and see if I can program a new blink on a T4...

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,053
    Again I tried running this on RPI4...

    I was able to compile one of my programs for Teensy 3.2 on my Windows machine, winSCP over the hex file and use the built teensycli to program the T3.2

    Code:
    pi@RPI4B:~/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY31 -v -w Blink_any_pin.ino.TEENSY31.hex
    Teensy Loader, Command Line, Version 2.1
    Read "Blink_any_pin.ino.TEENSY31.hex": 32084 bytes, 12.2% usage
    Waiting for Teensy device...
     (hint: press the reset button)
    Found HalfKay Bootloader
    Read "Blink_any_pin.ino.TEENSY31.hex": 32084 bytes, 12.2% usage
    Programming................................
    Booting
    However if I then build the same program for Teensy40 and transfer and try to use the CLI, I see:
    Code:
    pi@RPI4B:~/teensy_loader_cli $ ./teensy_loader_cli --mcu=TEENSY40 -v -w Blink_any_pin.ino.TEENSY40.hex
    Teensy Loader, Command Line, Version 2.1
    Warning, HEX parse error line 2
    error reading intel hex file "Blink_any_pin.ino.TEENSY40.hex"
    pi@RPI4B:~/teensy_loader_cli $
    So there appears to be some differences that the CLI is not aware of...

    Here is the head of both generated files:
    Code:
    pi@RPI4B:~/teensy_loader_cli $ head Blink_any_pin.ino.TEENSY40.hex
    :0200000460009A
    :100000004643464200000156000000000101020084
    :1000100000000000000000000000000000000000E0
    :1000200000000000000000000000000000000000D0
    :1000300000000000000000000000000000000000C0
    :1000400000000000010403000000000000000000A8
    :100050000000200000000000000000000000000080
    :100060000000000000000000000000000000000090
    :100070000000000000000000000000000000000080
    :10008000EB04180A063204260000000000000000FD
    pi@RPI4B:~/teensy_loader_cli $ head Blink_any_pin.ino.TEENSY31.hex
    :1000000000800020BD010000850700003D070000C2
    :100010003D0700003D0700003D0700003D070000D0
    :100020003D0700003D0700003D0700008507000078
    :10003000850700003D070000051D0000091E0000A7
    :100040008507000085070000850700008507000080
    :100050008507000085070000850700008507000070
    :100060008507000085070000850700008507000060
    :100070008507000085070000850700008507000050
    :100080008507000085070000850700008507000040
    :100090008507000085070000850700008507000030
    pi@RPI4B:~/teensy_loader_cli $
    Edit: Might mention tail of each file shows differences in lines as well:
    (Obviously content would be different, but the 40 one is not filling full lines like the 31
    Code:
    pi@RPI4B:~/teensy_loader_cli $ tail Blink_any_pin.ino.TEENSY40.hex
    :107F2C00E80F0020E80F0020F00F0020F00F0020D9
    :107F3C00F80F0020F80F0020001000200010002087
    :107F4C000810002008100020101000201010002035
    :107F5C0018100020181000202010002020100020E5
    :107F6C002810002028100020301000203010002095
    :107F7C003810002038100020401000204010002045
    :107F8C0048100020481000205010002050100020F5
    :107F9C0000000200FFFFFFFF0000000000000000D7
    :040000056000100087
    :00000001FF
    pi@RPI4B:~/teensy_loader_cli $ tail Blink_any_pin.ino.TEENSY31.hex
    :107CC400F890FF1FF890FF1F0091FF1F0091FF1F06
    :107CD4000891FF1F0891FF1F1091FF1F1091FF1FB4
    :107CE4001891FF1F1891FF1F2091FF1F2091FF1F64
    :107CF4002891FF1F2891FF1F3091FF1F3091FF1F14
    :107D04003891FF1F3891FF1F4091FF1F4091FF1FC3
    :107D14004891FF1F4891FF1F5091FF1F5091FF1F73
    :107D24005891FF1F5891FF1F6091FF1F6091FF1F23
    :107D34006891FF1F6891FF1F7091FF1F7091FF1FD3
    :107D44007891FF1F7891FF1F00000200FFFFFFFFE3
    :00000001FF
    pi@RPI4B:~/teensy_loader_cli $

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,053
    Another quick update... I enabled some of the printf statements, and also a check to see if we were aborting due to size...
    Code:
    Line: length=2 Addr=0
    After addr... test: 2
    ext addr = 60000000
    Line: length=16 Addr=0
    Addr > Max: 1610612752 > 1048576
    Warning, HEX parse error line 2
    error reading intel hex file "Blink_any_pin.ino.TEENSY40.hex"
    So that first line is saying use an extended addr of 60000000 (hex) or 1610612736
    which exceeds what the program says it's max size is of: #define MAX_MEMORY_SIZE 0x100000
    Which our extended address blows that limit up!

Posting Permissions

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