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 explicitly specify the...
@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 code (FLASH_SIZE -...
@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 can find here:
...
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 have?
Which...
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 = FLASH_SIZE/4 = 64K....
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 Flasher3c. Then I tried...
@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 card, you can use the...
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.
@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, with about a year in...
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 or 1.8V and operate...
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 followed by...
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 records of length 8 and...
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 (a) flash and LMEM...
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 that I made, plus my...
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 becomes an offset to...
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 environment other...
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 bytes as shown...
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 flash size, so 128K...
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"
#elif...
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 Serial.println( FLASH_ID );
...
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 string, e.g....
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 program to send a hex...
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 that is not...
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 ":flash" command...
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 to disable LMEM code...