PSoC™ 6 Forum Discussions
Please unlock my discussion "Looking for eval board that does it all", as I would like to add to it.
Hi, I am searching for information on how to get printf working over the SWD port.
I have a miniprog3 connected and I would like a terminal on my computer where I can see debug messages.
Does anyone have some code to set this up? (I guess more is needed than selecting "SWD+SWV" in Programming/Debugging)
Also what is the best way to watch the output? Is it getting a J-link, looking in the Output tab of PSOC Creator, or something else?
So far I have borrowed this together off the internet,
best regards
Anders
/*********************************************************************
*
* Defines for Cortex-M debug unit
*/
#define ITM_STIM_U32 (*(volatile unsigned int*)0xE0000000) // Stimulus Port Register word access
#define ITM_STIM_U8 (*(volatile char*)0xE0000000) // Stimulus Port Register byte access
#define ITM_ENA (*(volatile unsigned int*)0xE0000E00) // Trace Enable Ports Register
#define ITM_TCR (*(volatile unsigned int*)0xE0000E80) // Trace control register
/*********************************************************************
*
* SWO_PrintChar()
*
* Function description
* Checks if SWO is set up. If it is not, return,
* to avoid program hangs if no debugger is connected.
* If it is set up, print a character to the ITM_STIM register
* in order to provide data for SWO.
* Parameters
* c: The Chacracter to be printed.
* Notes
* Additional checks for device specific registers can be added.
*/
void SWO_PrintChar(char c) {
//
// Check if ITM_TCR.ITMENA is set
//
if ((ITM_TCR & 1) == 0) {
return;
}
//
// Check if stimulus port is enabled
//
if ((ITM_ENA & 1) == 0) {
return;
}
//
// Wait until STIMx is ready,
// then send data
//
while ((ITM_STIM_U8 & 1) == 0);
ITM_STIM_U8 = c;
}
int _write(int file, char *ptr, int len)
{
int i;
for (i = 0; i < len; i++)
{
SWO_PrintChar(*ptr++);
}
return len;
}
Show LessHi Everyone.
I'm testing CY8C6247BZI-D54. I have a question about UART.
My customer want to use 9 Uart. but PSoC62 doesn't seem to support that although It have 9 x SCB blocks..
Is it right that PSoC62 doesn't use 9 uart port?
I want to know that there is possible to use.
Regards.
Robert
Show LessI am using PSoC Creator 4.2 CapSense v2.0 and sometimes the hardware will be stuck in the busy state after calling CapSense_1_ScanAllWidgets(). Calling CapSense_1_IsBusy() always returns CapSense_1_SW_STS_BUSY. I can recover by calling CapSense_1_Stop() then CapSense_1_Start(). What conditions will cause the hardware to be stuck and how can I detect the error or prevent it? Right now I just poll periodically with CapSense_1_IsBusy(). Is there a function that returns an error if the hardware is stuck? I attached the capsense settings.
Show LessHi all!
Trying to figure this error I get when I program the (CM0p) :
"There was an error while programming the device: PSoC Programmer reported error (100 - EraseAll API returned: Error code 0x76AFF110: Unknown SROM status code)"
I am programming the Psoc63 CY8C6347FMI-BLD53 using the MiniProg4 on Psoc Creator 4.2.
Does anyone have suggestion as to what could cause this error?
Thank you in advance!
Felix
Show LessHi,
I am a complete beginner with the PSoC devices and I use the PSoC 6 CY8CKIT-062-WiFi-BT Pioneer Kit. What I'm trying to accomplish is to stream an audio signal from a Windows PC to a buffer in the PSoC device using the J28 USB connector. The USB is configured as a composite device using CDC and Audio 1.0 I included the cycfh_usbdev.h below.
I already looked at the Audio Recorder example for the PSoC 6 but I can't seem to import the project so it wasn't really useful.
Thank you in advance for your help.
Show LessI've been programming a CYBLE-416045-02 with PSoC Creator 4.2.
Does the chip verify its program on startup? I've seen similar questions with answers that
say things like the bootloader automatically verifies flash on startup.
However, I am unable to add a bootloader or bootloadable component to the design,
and they don't show up in the components list unless I make a new project for a different chip.
No bootloader component (should be under system)
Does the CYBLE-416045-02 not have a bootloader? If so, how can I get it to verify flash on startup?
Show LessI am using a Timer Counter to provide the elapsed time in seconds from when it is started.
However, when I start the timer and begin reading the Timer Count value, I get a value of zero for the first two seconds, then, it gives me incremental readings for each second thereafter. In other words, when I read the count I get: 0, 0, 1, 2, 3 ....
If I've deciphered the documentation correctly, they mention something about the settings you make to the Timer Counter not being effected until the first occurrence of the (pre-scaled) clock, in my case 1Hz. This might explain why I see the initial zero for the first second, until the first 1Hz clock starts/inits the timer.
I would greatly appreciate any ideas/suggestions on how I should implement this correctly. I need to be able to start the timer at a given instant and begin reading the elapsed time in seconds, starting at zero. Thanks!
Here is my Timer Counter in the designer (by the way, using PSoC6 and PSoC Creator):
My code is as follows:
void elapsedTimerInit()
{
ElapsedTimeCounter_Init( &ElapsedTimeCounter_config );
ElapsedTimeCounter_Enable();
ElapsedTimeCounter_Start();
}
The routine that tests this is below.
At the breakpoint, the values of t0, t1, t2 and t3 are: 0, 0, 1, 2
void timerTest()
{
volatile uint32 t0, t1, t2, t3;
elapsedTimerInit();
t0 = ElapsedTimeCounter_GetCounter();
CyDelay( 1100 ); // Wait a little over one second
t1 = ElapsedTimeCounter_GetCounter();
CyDelay( 1000 ); // Wait one second
t2 = ElapsedTimeCounter_GetCounter();
CyDelay( 1000 ); // Wait one second
t3 = ElapsedTimeCounter_GetCounter();
// Breakpoint here. t0 = 0, t1 = 0, t2 = 1, t3 = 2
// But I want t0 = 0, t1 = 1, t2 = 2, t3 = 3, etc...
}
Show LessHi.
I'm reviewing about PSoC62 ADC. The power domain of PSoC6 is max 3.6V at datasheet.
I know PSoC6 Vref can be selected to System bandgap(1.2V) or VDDA/2 or VDDA or External device pin.
I have any questions.
1. Does it be possible to use adc input from 0~3.3V in Mbed platform? If possible, How do I control firmware? I want you to let me know sample code if you have one.
2. When VDDA is 3.3V and Vneg for Single ended is Vref as following, Is that mean Input range is 0 to 6.6V?
Thanks
Robert.
Show Less