Constant dynamic array: AVR/embedded flash problem

Summary

Constant dynamic array data doesn't get stored in flash memory when using section 'progmem' with AVR/embedded target.

System Information

  • Operating system: Host Windows 11, target: embedded
  • Processor architecture: AVR6
  • Compiler version: Lazarus 2.3.0 (rev main-2_3-1133-g2ac55d4800) FPC 3.3.1 i386-win32-win32/win64
  • Device: Microcontroller ATmega2561

Steps to reproduce

test : array of byte = (1, 2, 3, 4, 10); section '.progmem';

What is the current bug behavior?

Only pointer to the array is stored in flash memory (says @PascalDragon).

Lazarus forum discussion