Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: joepasquariello

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Increase Code Size with const arrays

    I needed large hex files for testing on T3.x, and used this approach to increase code size. Thought I'd share in case anyone can use such a thing. Is there a shorter/easier method?

    //nested arrays...
  2. I've built a new version of Flasher to allow the...

    I've built a new version of Flasher to allow the largest possible upload by identifying empty sectors from the top of existing firmware to the bottom of flash reserve. This eliminates the need to...
  3. @gonzales, yes, you're right. I simply replaced...

    @gonzales, yes, you're right. I simply replaced FLASH_SIZE/2 with FLASH_BUF_ADDR everywhere. In that case, the original code should have been (FLASH_SIZE - FLASH_SIZE/2 - RESERVE_FLASH) and the new...
  4. @the_boss, yes, you could adapt this serial...

    @the_boss, yes, you could adapt this serial download/flash process to Ethernet. The same person (jonr) who wrote the original Flasher program for T3.x has also written Flasher4, for T4.x, which you...
  5. In the SMALL program source code, you should have...

    In the SMALL program source code, you should have FLASH_BUFFER_ADDR = (FLASH_SIZE / 4)
    In the LARGE program source code, you should have FLASH_BUFFER_ADDR = (3 * FLASH_SIZE / 4)

    Is that what you...
  6. Here is Flasher3d.zip. This version lets you set...

    Here is Flasher3d.zip. This version lets you set FLASH_BUFFER_ADDR (in file FlashT3x.h). I have only tested on T3.2 so far. The size of Flasher3d is about 42K, so I have set FLASH_BUFFER_ADDR =...
  7. Yes, it's possible. I did a test by replacing all...

    Yes, it's possible. I did a test by replacing all instances of (FLASH_SIZE / 2) with a new macro FLASH_BUFFER_ADDR. First, I defined FLASH_BUFFER_ADDR = (FLASH_SIZE / 2), so that's the same as...
  8. @gonzales, you are on the right track. Code size...

    @gonzales, you are on the right track. Code size limit is 1/2 of flash size, but the hex file is much larger due to all of the overhead of the hex file format. If you have the hex file on your SD...
  9. Replies
    172
    Views
    9,793

    Thanks for the info, @mlewus. I'm sure it's just...

    Thanks for the info, @mlewus. I'm sure it's just a matter of investing the time to get past the initial hurdles. One of these days I'll give it another go.
  10. Replies
    172
    Views
    9,793

    @mlewus and @mkingforger, can you comment on the...

    @mlewus and @mkingforger, can you comment on the process of updating your VSCode/PlatformIO environment when there is a new release of Arduino and/or TeensyDuino? I tried VSCode/PlatformIO twice,...
  11. Replies
    16
    Views
    614

    Thank you. I'm glad I asked.

    Thank you. I'm glad I asked.
  12. Replies
    16
    Views
    614

    I'm not experienced in electronic design, but...

    I'm not experienced in electronic design, but I've been curious about using Teensy 4.x in retrofit applications with 5V devices, including SPI. NXP's latest level shifters support 5V to either 3.3V...
  13. The hex lines below from a T3.6 hex file show the...

    The hex lines below from a T3.6 hex file show the 4-byte record at AD78 that breaks the 64-bit alignment. Further below are lines from the symbol file. AD78 is .fini (language cleanup code), which is...
  14. Thanks for letting us know, Frank. That's good...

    Thanks for letting us know, Frank. That's good news. I'd like to understand why the hex files always have the same pattern of record lengths ...16,16,16,8,4,16,16,16... There must be reason those...
  15. Flasher3c.zip is attached. This update accepts...

    Flasher3c.zip is attached. This update accepts the as-built Teensy hex files and so avoids the need to pre-process to get 64-bit aligned hex records for T35/T36. The differences from Flasher3b are...
  16. Thanks for letting us know, Frank. I will update...

    Thanks for letting us know, Frank. I will update IntelHex to handle larger files so that you don't have to hand edit.
  17. Agree, Jon. That's at the top of my list for the...

    Agree, Jon. That's at the top of my list for the next update to Flasher. Better to integrate what I did with IntelHex directly into Flasher.
  18. All Teensy hex files seem to have those lines....

    All Teensy hex files seem to have those lines. The IntelHex program does the same "fix" that you did manually. It is based on a C file (ihex.c) written by Paul, with just a couple of small changes...
  19. The address field in the intel hex format is 16...

    The address field in the intel hex format is 16 bits, so the max is 65535. For files larger than 64K, additional record types come into play that specify "base address", and the 16-bit address field...
  20. Yes, you're right, IntelHex is currently limited...

    Yes, you're right, IntelHex is currently limited to 64K. I'll have to modify it to handle larger files. Please provide the info about your target and your build environment. If you're using a build...
  21. I did a little more digging, and to clarify, for...

    I did a little more digging, and to clarify, for all T3.x, the 16 bytes from 0400 to 040F are set aside as "flashconfig" in the linker files (*.ld). File mk20dx128.c in cores\teensy3 defines those 16...
  22. I just repeated my tests with T3.2, T3.5, and...

    I just repeated my tests with T3.2, T3.5, and T3.6, and in all 3 cases, I get a match on the FSEC field between upper (new program) and lower (existing program). The program size limit is 1/2 of the...
  23. Okay. This is the set of conditional defines you...

    Okay. This is the set of conditional defines you need to add to your program, than add the Serial.println(FLASH_ID);

    #if defined(__MK20DX128__)
    #define FLASH_ID "fw_teensy3.0"...
  24. You just need the #define FLASH_ID...

    You just need the #define FLASH_ID "fw_teensy3.5", and then you need to make sure that string gets used within your program. What I suggest is adding a line in your setup function that says...
  25. For T35/T36, you must use the IntelHex.exe to...

    For T35/T36, you must use the IntelHex.exe to convert from 32-bit aligned records to 64-bit aligned. That will avoid the "align error".

    Any application you upload must contain the appropriate ID...
  26. This is a limitation of using a terminal emulator...

    This is a limitation of using a terminal emulator to send an ASCII hex file. There is no error checking except the record-level checks within the target. I can write a very simple command-line...
  27. Hi Jon. Yes, what the Flasher program is doing...

    Hi Jon. Yes, what the Flasher program is doing now (and has always done), is report the number of valid lines received. If it receives any invalid lines or, in the case of T35/T36, it receives a line...
  28. I use Teraterm, and it works, though I can't say...

    I use Teraterm, and it works, though I can't say I'm crazy about it.
  29. After you see those messages, you need to type in...

    After you see those messages, you need to type in ":flash XXXX", where XXXX is the number of lines reported by the program, and then hit Enter. When you hit Enter, as long as you have typed in the...
  30. Thanks very much. I like the option of a text...

    Thanks very much. I like the option of a text display.
  31. iniitu, that looks great. Would you mind...

    iniitu, that looks great. Would you mind providing a short summary of your connections and the working code?
  32. Flasher3b.zip is attached, with improvements from...

    Flasher3b.zip is attached, with improvements from Flasher3a and has been 100% reliable on many updates of T32/T35/T36. I was having trouble with T3.6, and after a lot of trial-and-error, added code...
  33. Thanks, Paul. Good to know. I'll experiment by...

    Thanks, Paul. Good to know. I'll experiment by decoupling the file transfer from the flash writes and see if I can figure out why doing Serial.print/flush after each record seems to fix it.
  34. Yes, or at least make it clear that firmware...

    Yes, or at least make it clear that firmware upload requires a "shutdown" of the application. Can you comment on whether disabling HSRUN might affect file transfer via the USB serial?
  35. The attached file Flasher3a.zip contains an...

    The attached file Flasher3a.zip contains an update to jonr's "flasher" for T32, with support for T35 and T36. The primary change relative to flasher is addition of a flash_phrase() function to write...
  36. Continuing to work on Flasher for T35/T36. As...

    Continuing to work on Flasher for T35/T36. As dahollen mentioned, flash operations are not reliable with high-speed mode enabled. The NXP reference manuals are clear that high-speed mode is not...
  37. Something a little different about T35 and T36....

    Something a little different about T35 and T36. The simple test of erase/write/read at the beginning of the program works fine, but the hex file transfer via TeraTerm seems to be failing. There are...
  38. Okay, thanks. The original flasher keeps...

    Okay, thanks. The original flasher keeps interrupts disabled from the the beginning of stage 2 (moving upper to lower) through the reboot. I'll keep it that way.
  39. jonr, I'm working on integrating dahollen's flash...

    jonr, I'm working on integrating dahollen's flash routines for T35 and T36 with your flasher program, and I have a few questions.

    (1) In flasher, you specify RESERVE_FLASH for T31 and T32. Is this...
  40. Ah, light dawns on Marblehead. Thank you. I...

    Ah, light dawns on Marblehead. Thank you. I thought the 2MB of flash on T4.0 was on-chip. Now I understand there is only the external serial flash, 2MB for T4.0, 8MB for T4.1. How interesting. I need...
  41. Thanks, Paul. I'm still unclear on why the T4.1...

    Thanks, Paul. I'm still unclear on why the T4.1 page says it has 8 MB of flash and not 2+8 = 10 MB. For code space, it has the same 2MB on-chip flash as T4.0, plus the 8MB U3 for EEPROM + future...
  42. Question on T4.1 Serial Flash (U3)

    I'm confused about flash on the T4.1. It has the same iMXRT1062 as T4.0, so it must have the same 2 MB on-chip flash. It also has 8 MB serial flash (W25U64) chip on U3, so doesn't it have 10 MB...
  43. IEEE 754 was established in 1985. It guarantees...

    IEEE 754 was established in 1985. It guarantees interoperability, meaning the representation of any and every floating-point value is guaranteed to be identical on any compliant processor. There is...
  44. Sounds like you've got it working. Floating point...

    Sounds like you've got it working. Floating point formats have long been standardized via IEEE 754. The only processor I've ever worked with that did not use IEEE 754 was the TI TMS320C30 DSP. I...
  45. Bingo. millis()

    Bingo. millis()
  46. Even if overflow of that 32-bit cycle counter can...

    Even if overflow of that 32-bit cycle counter can trigger increment of another counter, you still won't have a coherent 64-bit counter with nanosecond resolution. Best to use the cycle counter for...
  47. Try removing "volatile" from those variable...

    Try removing "volatile" from those variable definitions.
  48. You can reduce the number of comparisons from 8...

    You can reduce the number of comparisons from 8 to 4 by combining the two portb values into one variable

    uint8_t last_current = (last_portb << 4) | (current_portb);
    bIsStart =...
  49. Very, very nice. If this is what your prototype...

    Very, very nice. If this is what your prototype looks like, I would love to see your production design.
  50. Replies
    2
    Views
    1,090

    There are scenarios where OTA updates are...

    There are scenarios where OTA updates are necessary. There is a working method on this forum for update via UART for Teensy 3.2, and maybe 3.5 and 3.6, too. The main limitation is that the new...
Results 1 to 50 of 87
Page 1 of 2 1 2