1 Reply Latest reply on May 21, 2020 10:37 PM by TakashiM_61

    How to fill unused area of flash memory with a certain value for PSoC4S

    YoIs_1298666

      Hello,

       

      If you need to fill  unused area of flash memory, this is available.

      If you build your project with PSoC Creator, the unused area of flash memory are filled with ""0x0000".

       

      We know that machine code "0xe7fe" means "while(1)".

      So, let's fill with "0xe7fe". We need to add it to Linker script.

      We prepare the .ld that added fill script.

      ...\FillUnusedFlash\SCB_Uart_FilledUnusedFlash.cydsn\Generated_Source\cm0plusgcc_filled.ld

      The value to be filled is described in big endian.

            FILL(0xfee7);

       

      For the .ld file, refer to the application note AN89610 below.

      https://japan.cypress.com/documentation/application-notes/an89610-psoc-4-and-psoc-5lp-arm-cortex-code-optimization

       

      You must specify the "Custom Linker Script" in "Build Settings..." of PSoC Creator.

            .\Generated_Source\cm0plusgcc_filled.ld

       

      The result of building is as follows.

      The firmware echoes back when you type a character in your terminal software.

       

      Best regards,

      Yocchi