- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The datasheet of PSoC6 describes that it is possible to execute code from the code and the sram regions.
Are there any code examples available for executing a whole program in the SRAM?
Many thanks,
Nadja
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I realized that the my previous post might be misleading. Actually you can not use PSoC Creator/Programmer to program SRAM, because the tools are a command cluster manipulating inside flash.
The feasible way for you might be to conduct a copy of code from flash to sram after each time power on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want to put whole program in SRAM, put the sections originally defined in flash to ram by modifying the linker file for each core, just like below section .text:
.text :
{
. = ALIGN(4);
__Vectors = . ;
KEEP(*(.vectors))
. = ALIGN(4);
__Vectors_End = .;
__Vectors_Size = __Vectors_End - __Vectors;
__end__ = .;
. = ALIGN(4);
*(.text*)
KEEP(*(.init))
KEEP(*(.fini))
/* .ctors */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* .dtors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
/* Read-only code (constants). */
*(.rodata .rodata.* .constdata .constdata.* .conststring .conststring.*)
KEEP(*(.eh_frame*))
} > flash -> ram
If you just want to put single function in SRAM, you can refer to the method mentioned in the following artical for P5 - Running code in RAM using PSoC5 and the GCC compiler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your answer.
I tried this with the Dual Core Blinky Example in PSoc Creator with the PSoC 6 BLE Poineer Kit. In both linkerfiles (cy8c6xx7_cm0plus.ld and cy8c6xx7_cm4.ld) I replaced every "} > flash" with "} > ram".
I can build the software, but after programming it is not running on the device. Do I need to do something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I realized that the my previous post might be misleading. Actually you can not use PSoC Creator/Programmer to program SRAM, because the tools are a command cluster manipulating inside flash.
The feasible way for you might be to conduct a copy of code from flash to sram after each time power on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much, this is the right way for me!