Skip to content

Hex-files spanning more than 64K not supported #24

Open
@mafiltenborg

Description

@mafiltenborg

Having little knowledge on all things github, I will refrain from trying to commit stuff that'll break more than it fixes, and in stead upload information + test files to document an observed anomaly. I hope maintainers will find the below info useful:

The AVR ATmega2560 comes with 256KBytes of internal flash. However, trying to program in excess of 64K fails, as the expanded memory range record type 04 in intel Hex file format is not supported.

Run the attached code.py with the attached 128K test file on an ATmega2560 target and you will get the following output:

code.py output:
**************************************************************
* AVR ATmega2560 programmer                                  *
* 02-11-2021                                                 *
* Type 'g' to start:                                         *g
**************************************************************
Working with an ATmega2560 CPU. Good!
Read lockbits: ['0xf7', '0x17', '0x4', '0x3f']
Erasing chip...
Re-read lockbits: ['0xf7', '0x17', '0x4', '0x3f']
Programming flash with Tester_128K.hex
Traceback (most recent call last):
  File "code.py", line 68, in <module>
  File "adafruit_avrprog.py", line 139, in program_file
  File "adafruit_avrprog.py", line 425, in read_hex_page
RuntimeError: Unsupported record type 4 on line 1

Code done running.

Unsupported record type 4 on line 1
On line 1 of the HEX-file you find

:020000040000FA

which, according to https://en.wikipedia.org/wiki/Intel_HEX#Record_types
is an extended memory specifier allowing for up to 4GByte address range, of which we need up to 0x3FFFF.

Programming with a HEX file that uses Record type 4 is not supported.

ExtMemCode.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions