How can I add postbuild options to compute a checksum and add it at an address in Flash?

Hi,

Currently I use a custom linker section for my code.

.my_code_section :
{
PROVIDE(__my_code_section_start = .);
KEEP(*(.my_code_section))
PROVIDE(__my_code_section_end = .);
} > FLASH

.my_crc32_data_section :
{
PROVIDE(__my_crc32_data_section_start = .);
KEEP(*(.my_crc32_data_section))
PROVIDE(__my_crc32_data_section_end = .);
} > FLASH

I have to compute a checksum using "__my_code_section_start" during the build and write the computed checksum at "__my_crc32_data_section_start" during the post build phase.

Is there any scripting facility available to do this in Zephyr?

Related