PSoC™ 5, 3 & 1 Forum Discussions
I am running a C based application on PSoC Creator for PSoC3 based board.I applied three breakpoints to debug the code.In this process,when i stepped into the code at the third breakpoint using "step into" debug option,the control is swicthing to a disassembly code rather than the C-code instruction.Any help to solve this is appreciated.
Show LessSo I am trying to figure out whether I have just a code size issue or a memory allocation issue or a linker issue. I had a project in 4.4 with csd and ezi2c. I loaded into 5.1. It told me it was going to update boot.ldr and update csd from version 1.0 to 1.5. after it was done I regenerated and compiled and got the following errors
Linking..
LMM info: area 'InterruptRAM' uses 65 bytes in SRAM bank 0
LMM info: area 'ram2' item of 83 bytes allocated in SRAM page 0
LMM info: area 'ram1' item of 80 bytes allocated in SRAM page 0
LMM info: area 'data' item of 26 bytes allocated in SRAM page 0
LMM info: area 'data' item of 2 bytes allocated in SRAM page 0
LMM info: area 'data' item of 1 bytes allocated in SRAM page 1
!E <library>(2569): {linker} Cannot allocate space for 12 bytes for 'bss' area
!E <library>(2569): {linker} Cannot allocate space for 40 bytes for 'bss' area
!E <library>(2569): {linker} Cannot allocate space for paged area 'virtual_registers'
!E <library>(2569): {linker} Cannot allocate space for 1 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 1 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 2 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 2 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 2 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 1 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 1 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 1 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 2 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 2 bytes for 'data' area
!E <library>(2569): {linker} Cannot allocate space for 2 bytes for 'data' area
So is the new csd module bigger and so now it won't fit into my part or do I need to configure the imagecraft compiler or linker some how to make this fit?
Any insight into this would be greatly appreciated.
Ray
Show Less
} // end of main()
In military and medical applications, it is vital to know if the code you are running is what was written. That is why the ECC idea is great. I love that the processor takes care of this issue instead of me having to run a CRC on the Flash at run-time.
I have written a simple piece of code that re-writes an instruction in flash after programming to force a fault. For example, I set up a simple sum in normal code and then switch it to a subtraction afterwards. When I turn on ECC mode, the ECC prevents the switch from occurring (great...ECC works!). I haven't checked, but I imagine the subtract opcode is only 1-bit different from the add opcode. The trouble is I can't figure out how to register the ISR code when a supposed ECC event occurs. I have found allusions to this ability in the PSoC 5 datasheet and in several appnotes, but there are no examples or further information. Does anyone have this working or have any suggestions? My code is shown below. It is a variation on what I found in an application note. I have commented out my attempts at registering the ISR. I tried a system-level interrupt (only available on the ARM) and a regular one.
#include
volatile uint8 a = 5; // don't let the compiler optimize this away
volatile uint8 b = 3; // don't let the compiler optimize this away
volatile uint8 sum; // don't let the compiler optimize this away
/* To find Row number by dividing the address by 256 */
#define ADDRESS_TO_ROW(A) (A / SIZEOF_FLASH_ROW)
/* To find address of next row */
#define ROW_INCREMENT SIZEOF_FLASH_ROW
/* Define PSoC 5 Flash Base */
#define FLASH_BASE CYDEV_FLASH_BASE
/* define the ECC interrupt code */
/*
CY_ISR(ECC_Fault_ISR)
{
LCD_ClearDisplay();
LCD_Position(0,0);
LCD_PrintString("PROG MEM FAULT");
}
*/
void main()
{
/* Array which contains value to be written to the Flash Row */
uint8 rowFinalData[SIZEOF_FLASH_ROW];
/* Temp Buffer for Flash line of code*/
uint8 rowBuffer[SIZEOF_FLASH_ROW SIZEOF_ECC_ROW];
/* Start and end locaton of the concerned data */
uint8 rowDataOffset;
uint16 rowDataEnd;
/* Row address for instruction in flash */
uint16 rowAddress1;
uint16 index1;
uint8 runTwice = 0;
// Various attempts at assigning the ECC ISR to the vector table
//CyIntSetSysVector(1, ECC_Fault_ISR);
//CyIntSetVector(1, ECC_Fault_ISR);
//CyIntSetPriority(1, 3);
//CyIntEnable(1);
/* Start LCD */
LCD_Start();
/* To display demo started */
LCD_Position(0,0);
LCD_PrintString("Flash Mem CRC TST");
LCD_Position(1,0);
LCD_PrintNumber(a);
LCD_PrintString(" ");
LCD_PrintNumber(b);
LCD_PrintString("=");
//CYGlobalIntEnable; /* enable global interrupts */
/* create a label for the difference operation. In GCC, this will also be
the address of the operation. This code is never called after the initial
declaration. The instruction will be copied into the SUM flash location after
to simulate a program memory fault. */
DIFOPERATION:
sum = a - b;
while( runTwice != 2 )
{
/* create a label for the difference operation. In GCC, this will also be
the address of the operation. This instruction will get clobbered in flash
as this code executes. I do not recommend re-writing flash too much as this
will weaken the holding-power of the flash. If you really want to test the
program memory fault code every time, then you will need a seperate label
to copy the code back to it's original state. */
SUMOPERATION:
sum = a b;
LCD_Position(1,0);
LCD_PrintNumber(a);
LCD_PrintString(" ");
LCD_PrintNumber(b);
LCD_PrintString("=");
LCD_PrintNumber(sum);
LCD_PrintString(" a:"); // show address for verification
LCD_PrintHexUint16( &&SUMOPERATION );
LCD_PrintString(" ");
LCD_PrintNumber(runTwice);
CyDelay(2000); // wait 2 seconds
if( runTwice == 0 )
{
/* Get the address where the sine lookup table is stored */
rowAddress1 = (uint16) &&SUMOPERATION;
/* Calculate the row number from the address, which is the remainder of address/256 (max row size) */
rowDataOffset = rowAddress1%SIZEOF_FLASH_ROW;
/* Calculate the starting address of row */
rowAddress1 = rowAddress1 - rowDataOffset;
for(index1 = 0; index1 < SIZEOF_FLASH_ROW; index1 )
{
if ( index1 == rowDataOffset )
{
rowFinalData[index1] = (uint16) (void*)(&&DIFOPERATION); // replace sum operation with difference operation
}
else
{
/* Save the other elements of the flash row in the same position as they were */
rowFinalData[index1] = CY_GET_XTND_REG8((const void *)(FLASH_BASE rowAddress1 index1));
}
}
/* Must get temperature and set a temp buffer first. My understanding is different power is used
to write to the flash depending upon its temperature. */
if(!CySetTemp() && !CySetFlashEEBuffer(rowBuffer))
{
/* Erase and Program the row. */
CyWriteRowData(0, ADDRESS_TO_ROW(rowAddress1), rowFinalData);
}
runTwice = 1;
}
else
{
runTwice = 2;
}
}
while( 1 )
{
/* Never exit */
}
Show Less
Hello there,
I try to enter for this PsoC5 contest but I am not sure where my entered details gone?
How I can see my status?
I cannot see on myProfile the details of this contest.
Is the Web pages for this contest operate correctly?
Or I have done something wrong?
Kind Regards,
electronix79
Show LessWhy I can select Vdd 5V or 3.3V?
I read It determines the Oscillator Value and I know it determines some ranges, as the DAC's.
But my question is:
Can I choose both values in all the chips or depends on the family, (that is, pSoc 1, pSoc 2, pSoc 3) ?
All parts could be supplied with both Vdd?
Thanks
Show LessHi,
I am trying to design a USB to SPI converter with 24 data bits per word. How can I increase the number of data bits in the SPIM & SPIS components?
Show LessHello,
I use a "Up and Down" counter ( 32 bits ) configured as follows :
-period : 4294967295 (2^32 - 1)
-clock mode : count input and direction
-run mode : continuous
-reload counter on "reset" and on "tc"
Besides my input pin is configured in "resistive pull down" as drive mode, my goal is to count rising edge of a rotary encoder (in order to know the position of a robot), however my problem is when I turn my encoder the counter increment too fast whereas I turn a little bit the encoder. What's the problem ?
Thanks.
PS : I'm French what explain the quality of my English, I joined the project with the post, the name of the counter is "Counter_debug" in the PSOC Creator project!
Show LessI updated my Designer 5.1 to 5.1 SP1 with two computers. One is working and the other one doesn't work. The sypotom is that when I open a project, a fail prompt shown in screen as above. Then I uninstalled the SP1 and installed Designer 5.1. But when I open a project, the same fail message appeared. Can somebody help me out with this problem?
I've done it example project is USBFS Bootloader for PSoC® 3 and PSoC 5(EP64299) in PSoC5. Also I worked to size up bootloader code. However, it doesn't work after making size up source.
For example I enlarged the bootloader flash size to 74640 of 26144 bytes. In other words, flash sizes are gonna be larger than 64kb. Then I wrote bootloadable code to flash memory via USB but it doesn't work. I don't know why.
Please let me know if you know the reason.
Best regards,
Lee.
Show Less