5 Replies Latest reply on Feb 19, 2018 7:39 AM by e.pratt_1639216

    Out of flash when not out of flash?


      New guy here - no prior experience with PSoC Creator or this family of hw.


      I just inherited an existing 3-part project (launcher, stack, app) and am trying to simply build it to get oriented with the system. I was able to build the launcher project with no problem. When I build the stack project, I get this error:


      Error: flash row: 1024 is either already used or does not exist.

      The command 'cyelftool.exe' failed with exit code '1'.


      The device in question (CY8C4128LQI-BL543) has 256k of flash, which, at 256 bytes/row (as seen on the cyelftool.exe command shown in the output), translates to 1023 rows - namely, row 1024 is surely out of range. My project does not appear to be actually out of flash resource, though, as the Resource Meter for the project shows flash at 50.9% and SRAM at 55%. I took a look at the map file and found that the last code in the flash area were constants located at 0x20182 - roughly half of 0x40000 - consistent with that 50% metric.


      There was one tiny block of data later, at the very high end of flash:




                      0x0003ffc0       0x40 .\CortexM0\ARM_GCC_541\Debug\cymetadata.o

                      0x0003ffc0                cy_meta_loadable


      But at size 0x40, it should fit exactly in that last little bit of space, ending neatly at 0x3FFFF and not overrunning my 0x40000 limit.


      I ran cyelftool on the command line to see if it had any verbosity arguments - hoping to get it to tell me the name of the thing it was working on when it overran memory - but found nothing in its help output that looked promising.


      I'm seeking guidance for even how to investigate this issue. Thank you!


      Here's the section header output from objdump.

      It confirms that DATA/TEXT parts occupy just over 0x20000, half the flash. The cyloadablemeta section butts up against the end of flash space, but appears to end just at 3FFFFF - no reason to think cyelftool would need to allocate anything after row 1023.


      1561 .eh_frame     00000004 000000000001ea84 DATA

      1562 .rodata       00000ad8 000000000001ea88 TEXT DATA

      1563 .constdata    00000d18 000000000001f560 DATA

      1564 .conststring  00000091 0000000000020278 DATA

      1565 .ramvectors   000000c0 0000000020000000 BSS

      1566 .btldr_run    00000004 00000000200000c0 BSS

      1567 .data         00000658 00000000200000c8 DATA

      1568 .bss          00001250 0000000020000720 BSS

      1569 .heap         00002500 0000000020001970 BSS

      1570 .stack        00000800 0000000020007800 BSS

      1571 .cyloadermeta 00000040 00000000f0000000 DATA

      1572 .cyloadablemeta 00000040 000000000003ffc0 DATA

      1573 .cyflashprotect 00000080 0000000090400000

      1574 .cymeta       0000000c 0000000090500000

      1575 .cychipprotect 00000001 0000000090600000

      1576 .stab         00000084 0000000000000000

      1577 .stabstr      00000117 0000000000000000

      1578 .debug_aranges 00000a90 0000000000000000

      1579 .debug_info   0000a11b 0000000000000000

      1580 .debug_abbrev 0000236c 0000000000000000

      1581 .debug_line   00002f84 0000000000000000

      1582 .debug_frame  0001e154 0000000000000000

      1583 .debug_str    000077e9 0000000000000000

      1584 .debug_loc    00004325 0000000000000000

      1585 .debug_ranges 00000a38 0000000000000000

      1586 .comment      00022b4b 0000000000000000

      1587 .arm_vfe_header 000001a8 0000000000000000

      1588 .ARM.attributes 0000002a 0000000000000000

      1589 .shstrtab     0000bed1 0000000000000000

      1590 .symtab       00078210 0000000000000000

      1591 .strtab       0005e400 0000000000000000

      1592 .cychecksum   00000002 0000000090300000



      PSoC Creator  4.1 Update 1 (

      Culture: English (United States)

      OS Version: Microsoft Windows NT 10.0.16299.0

      CLR Version: 4.0.30319.42000


      GCC 541


      Note: project was originally created with a prior version of PSoC Creator and components. The version of PSoC Creator required that the components be updated to their latest ones, which I allowed.



      1. ObjDump output added

      2. Version and component update note added (2018-02-13 @ 1612 (GMT-5))

        • 1. Re: Out of flash when not out of flash?

          Potentially, the project component update caused the issues? Did you try compiling it on the older PSoC Creator version to see if it was working on the earlier version?

          • 2. Re: Out of flash when not out of flash?

            At the time, I did not have access to the older PSoC Creator. I have since acquired an older version from company archives and, indeed, it appears to build just fine. I am still very much concerned that the update process appears to have broken the build without any really helpful messages. Needless to say, I would ordinarily be keen to use the most recent versions of everything.

            • 3. Re: Out of flash when not out of flash?

              Yeah, sadly some projects encounter some interesting bugs when attempting to upgrade/use the projects in the newer PSoC Creator version(s).

              First of all, save a copy of the working project and PSoC creator version that are working so you have that going for you

              Secondly, I would suggest trying to update the components of the project within the older version first, then open the project with the newer version and see if it can correctly port the project to the new version.

              Worst case, recreating the project with the components for the top design and importing just the c/h files into the new project to recreate it in the newer version should be relatively straightforward if the PSoC Creator can't handle the project version update.

              • 4. Re: Out of flash when not out of flash?

                Thanks for the ideas and confirmation that I'm not hallucinating. I had actually thought about rebuilding the project in the later version, too. I suspect that is the most likely to succeed, frankly. It probably isn't a big deal to do so, though when I said "new guy", I meant "I'd never even heard of this tool before yesterday", so it'll be at least a little bit of learning, no doubt. For now, I have something at hand that is working for me well enough to get my work done, so I'm inclined to carry on with that and follow the update path, however twisty it may turn out to be, only if I actually run into problems with what's in front of me.

                • 5. Re: Out of flash when not out of flash?

                  Since the project uses mostly .c/.h files and PSoC Creator configuration settings for hardware components and settings, then you could theoretically copy just the c-code files into the new project, and manually set the topdesign schematic and hardware settings to match the older version, while just importing the c-code files again. The underlying compiler is/uses the GNU/GCC compiler, so it should be pretty standard underneath.